File: rules

package info (click to toggle)
gdb 4.18.19990928-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 60,584 kB
  • ctags: 87,859
  • sloc: ansic: 730,078; exp: 37,844; sh: 16,142; makefile: 10,039; cpp: 4,670; asm: 4,139; yacc: 4,117; lisp: 2,214; perl: 1,730; sed: 620; awk: 170; fortran: 5
file content (167 lines) | stat: -rwxr-xr-x 5,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/make -f

CC = gcc
CFLAGS = -O2 -Wall
# When using glibc 2 on Linux we must always use vtable thunks.
CXXFLAGS = $(CFLAGS) -fvtable-thunks

LDFLAGS =
install = /usr/bin/install -p

# Rather paranoid than sorry. Make the shell exit with an error if an
# untested command fails.
SHELL+= -e

dir=`pwd`
arch=`./config.guess|sed -e 's/unknown/debian/'`
ARCH=$(shell dpkg --print-architecture)
p=gdb

# --- patch handling
#
#patch_dir = debian
#debian_patches = 
#ifeq ($(ARCH),i386)
#  debian_patches += i386-threads
#endif
#
#patched-%: $(patch_dir)/%.patch
#	patch -p1 < $< 2>&1 | tee $@ 
#	echo "$* patch applied." >> $@
#
#apply-patches: patched-stamp
#
#patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
#	touch patched-stamp
#
#reverse-patches:
#	for stamp in patched-*; do \
#	  case "$$stamp" in patched-stamp|patched-\*) continue; esac; \
#	  patch=`echo $$stamp | sed -e 's/patched-//'`; \
#	  echo "trying to revert patch $$patch ..."; \
#	  if patch -p1 -R -E < $(patch_dir)/$$patch.patch; then \
#	    echo "reverted $$patch patch."; \
#	    rm -f $$stamp; \
#	  else \
#	    echo "error in reverting $$patch patch."; \
#	    exit 1; \
#	  fi; \
#	done
#	rm -f patched-stamp
#
# --- end patch handling

config: config-stamp
config-stamp:
	env INSTALL="$(install)" ./configure --prefix=/usr -v --enable-shared
	touch config-stamp

build: config ##patched-stamp
	$(checkdir)
# Regenerate the configure scripts, so they contain our libtools brokenness
# workarounds
	##for am in `find . -type f -name 'Makefile.am'` ; do \
	##  (cd `dirname $$am` ; \
	##   if [ -e configure.in ] ; then \
	##     echo "Recreating configure scripts in $$am" ; \
	##     libtoolize --force --copy --automake ; \
	##     automake --cygnus ; \
	##     aclocal ; \
	##     autoconf ; \
	##   fi ) ; \
	##done
# Builds the binary package.
	### env INSTALL="$(install)" ./configure --prefix=/usr -v --enable-shared
	make CC="$(CC)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
            LDFLAGS="$(LDFLAGS)" all info
	cd gdb/doc && make refcard.dvi refcard.ps 
	touch build

clean: ##reverse-patches
# Undoes the effect of `make -f debian.rules build'.
	$(checkdir)
	-make distclean
	-make -C gdb/gdbserver distclean
	-find . -name \*.info\* -print | xargs rm -f
	-find . -name \*.tab.c -print | xargs rm -f
	-rm -f gdb/xm.h gdb/tm.h gdb/nm.h readline/sysdep.h config.log gdb/doc/GDBvn.texi
	rm -f build config-stamp
	rm -rf debian/tmp debian/*~ debian/*.bak debian/files* debian/substvars gdb/doc/refcard.{ps,dvi}

binary: checkroot build binary-indep binary-arch
	$(checkdir)

binary-indep: checkroot build
	$(checkdir)

binary-arch: checkroot build
# Makes a binary package.
	$(checkdir)
	rm -rf debian/tmp
	$(install) -d -m 755 debian/tmp
	chmod g-s debian/tmp
	cd debian/tmp ; \
	  for dir in DEBIAN usr usr/include usr/include/readline usr/man \
	             usr/man/man1 usr/info usr/bin; do \
	    $(install) -d -m 755 $$dir ; \
	  done
	make install INSTALL_PROGRAM_ARGS="-s" \
	    prefix=$(dir)/debian/tmp/usr
#	mv -f debian/tmp/usr/bin/$(aa)-linux-gdb \
#	  debian/tmp/usr/bin/gdb
#	mv -f debian/tmp/usr/man/man1/$(aa)-linux-gdb.1 \
#	  debian/tmp/usr/man/man1/gdb.1
	make install-info \
	     prefix=$(dir)/debian/tmp/usr
# We need not distribute the includes and libraries.
	rm -rf debian/tmp/usr/$(arch)
	rm -rf debian/tmp/usr/include
	find debian/tmp/usr/info -type f ! \( -name 'gdb*' -o -name 'stabs*' \) | xargs rm -f
	rm -rf debian/tmp/usr/lib
	rm -f debian/tmp/usr/man/man1/configure.1
	chmod -R g-w debian/tmp
	$(install) -d -m 755 debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 gdb/doc/refcard.tex debian/tmp/usr/doc/$(p)/
	$(install) -m 644 gdb/doc/refcard.dvi debian/tmp/usr/doc/$(p)/
	$(install) -m 644 gdb/doc/refcard.ps debian/tmp/usr/doc/$(p)/
	$(install) -m 644 debian/copyright debian/tmp/usr/doc/$(p)/copyright
	$(install) -m 644 debian/changelog debian/tmp/usr/doc/$(p)/changelog.Debian
	$(install) -m 644 gdb/ChangeLog debian/tmp/usr/doc/$(p)/changelog
	$(install) -m 644 debian/m68k.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 debian/objc.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 debian/objC2.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 debian/4.17.gnat.diff.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 debian/gdb-4.17-4.17.0.4.diff.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	$(install) -m 644 debian/gdb-4.17.0.4-4.17.0.8.diff.bz2.uue debian/tmp/usr/doc/$(p)/applied-patches
	cd debian/tmp/usr/doc/$(p)/applied-patches/ && \
	for patch in * none; do \
		case "$$patch" in none) continue; esac; \
		uudecode $$patch; \
		rm $$patch; \
	done
	$(install) -m 755 debian/postinst debian/tmp/DEBIAN/postinst
	$(install) -m 755 debian/prerm debian/tmp/DEBIAN/prerm
	-gzip -9f debian/tmp/usr/info/*
	-gzip -9 debian/tmp/usr/man/man*/*
	-gzip -9 debian/tmp/usr/doc/$(p)/changelog*
	-rm -f debian/tmp/usr/bin/[^g]*
	-rm -rf debian/tmp/usr/share
	dpkg-shlibdeps gdb/gdb
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R a+rX,g-w,o-w,u+w debian/tmp
	dpkg --build debian/tmp ..

source diff:
	echo "Source and diff are obsolete. Use dpkg-source -b instead." >&2
	false

checkroot:
	$(checkdir)
	test root = "`whoami`"

define checkdir
	test -r config-ml.in
endef

.PHONY: source diff binary binary-arch binary-indep checkroot testdir