1899
|
1 #!/usr/bin/make -f
|
|
2 # Sample debian/rules that uses debhelper.
|
|
3 # GNU copyright 1997 to 1999 by Joey Hess.
|
|
4
|
|
5 # Uncomment this to turn on verbose mode.
|
|
6 #export DH_VERBOSE=1
|
|
7
|
|
8 # These are used for cross-compiling and for saving the configure script
|
|
9 # from having to guess our platform (since we know it already)
|
|
10 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
11 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
12
|
|
13 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
|
|
14 confflags += --build $(DEB_HOST_GNU_TYPE)
|
|
15 else
|
|
16 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
|
|
17 endif
|
|
18
|
|
19 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
|
20 CFLAGS += -g
|
|
21 endif
|
|
22 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
23 INSTALL_PROGRAM += -s
|
|
24 endif
|
|
25
|
|
26 config.status: configure
|
|
27 dh_testdir
|
|
28
|
|
29 # Apply Debian specific patches
|
|
30 cp $(CURDIR)/ccache.c $(CURDIR)/ccache.c.unpatched
|
|
31 cp $(CURDIR)/util.c $(CURDIR)/util.c.unpatched
|
|
32 cp $(CURDIR)/ccache.1 $(CURDIR)/ccache.1.unpatched
|
|
33 cp $(CURDIR)/ccache.h $(CURDIR)/ccache.h.unpatched
|
|
34 cp $(CURDIR)/ccache.yo $(CURDIR)/ccache.yo.unpatched
|
|
35 cp $(CURDIR)/config.h.in $(CURDIR)/config.h.in.unpatched
|
|
36 cp $(CURDIR)/configure $(CURDIR)/configure.unpatched
|
|
37 cp $(CURDIR)/configure.in $(CURDIR)/configure.in.unpatched
|
|
38 cp $(CURDIR)/Makefile.in $(CURDIR)/Makefile.in.unpatched
|
|
39 if test ! -f patch-stamp; then \
|
|
40 for patch in $(CURDIR)/debian/patches/*.diff ;\
|
|
41 do \
|
|
42 echo APPLYING PATCH\: $${patch##*/};\
|
|
43 patch -p0 < $$patch ;\
|
|
44 done ;\
|
|
45 touch patch-stamp ;\
|
|
46 fi
|
|
47 chmod +x $(CURDIR)/manage-cache.sh
|
|
48
|
|
49 ./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
|
|
50
|
|
51 build: build-stamp
|
|
52
|
|
53 build-stamp: config.status
|
|
54 dh_testdir
|
|
55
|
|
56 $(MAKE)
|
|
57
|
|
58 touch build-stamp
|
|
59
|
|
60 clean:
|
|
61 dh_testdir
|
|
62 dh_testroot
|
|
63 rm -f build-stamp
|
|
64
|
|
65 # Unapply patches
|
|
66 -test -r $(CURDIR)/ccache.c.unpatched && mv $(CURDIR)/ccache.c.unpatched $(CURDIR)/ccache.c
|
|
67 -test -r $(CURDIR)/util.c.unpatched && mv $(CURDIR)/util.c.unpatched $(CURDIR)/util.c
|
|
68 -test -r $(CURDIR)/ccache.1.unpatched && mv $(CURDIR)/ccache.1.unpatched $(CURDIR)/ccache.1
|
|
69 -test -r $(CURDIR)/ccache.h.unpatched && mv $(CURDIR)/ccache.h.unpatched $(CURDIR)/ccache.h
|
|
70 -test -r $(CURDIR)/ccache.yo.unpatched && mv $(CURDIR)/ccache.yo.unpatched $(CURDIR)/ccache.yo
|
|
71 -test -r $(CURDIR)/config.h.in.unpatched && mv $(CURDIR)/config.h.in.unpatched $(CURDIR)/config.h.in
|
|
72 -test -r $(CURDIR)/configure.unpatched && mv $(CURDIR)/configure.unpatched $(CURDIR)/configure
|
|
73 -test -r $(CURDIR)/configure.in.unpatched && mv $(CURDIR)/configure.in.unpatched $(CURDIR)/configure.in
|
|
74 -test -r $(CURDIR)/Makefile.in.unpatched && mv $(CURDIR)/Makefile.in.unpatched $(CURDIR)/Makefile.in
|
|
75 -rm -f $(CURDIR)/manage-cache.sh
|
|
76 -rm -f patch-stamp
|
|
77
|
|
78 [ ! -f Makefile ] || $(MAKE) distclean
|
|
79
|
|
80 dh_clean
|
|
81
|
|
82 # Update config.sub and config.guess
|
|
83 -test -r /usr/share/misc/config.sub && \
|
|
84 cp -f /usr/share/misc/config.sub config.sub
|
|
85 -test -r /usr/share/misc/config.guess && \
|
|
86 cp -f /usr/share/misc/config.guess config.guess
|
|
87
|
|
88
|
|
89 install: build
|
|
90 dh_testdir
|
|
91 dh_testroot
|
|
92 dh_clean -k
|
|
93 dh_installdirs
|
|
94
|
|
95 # Add here commands to install the package into debian/ccache.
|
|
96 $(MAKE) install prefix=$(CURDIR)/debian/ccache/usr
|
|
97
|
|
98 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc
|
|
99 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++
|
|
100 set -e; for ver in 2.95 3.0 3.2 3.3 3.4 4.0 4.1 4.2 4.3; do \
|
|
101 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc-$$ver; \
|
|
102 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc-$$ver; \
|
|
103 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++-$$ver; \
|
|
104 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++-$$ver; \
|
|
105 done
|
|
106 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/cc
|
|
107 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/c++
|
|
108 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc
|
|
109 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++
|
|
110 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-c++
|
|
111 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-cc
|
|
112 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-g++
|
|
113 ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-gcc
|
|
114
|
|
115 # Build architecture-independent files here.
|
|
116 binary-indep: build install
|
|
117 # We have nothing to do by default.
|
|
118
|
|
119 # Build architecture-dependent files here.
|
|
120 binary-arch: build install
|
|
121 dh_testdir
|
|
122 dh_testroot
|
|
123 dh_installdocs
|
|
124 dh_installexamples
|
|
125 dh_installmenu
|
|
126 dh_installcron
|
|
127 dh_installman
|
|
128 dh_installinfo
|
|
129 dh_installchangelogs
|
|
130 dh_link
|
|
131 dh_strip
|
|
132 dh_compress
|
|
133 dh_fixperms
|
|
134 dh_installdeb
|
|
135 dh_shlibdeps
|
|
136 dh_gencontrol
|
|
137 dh_md5sums
|
|
138 dh_builddeb
|
|
139
|
|
140 binary: binary-indep binary-arch
|
|
141 .PHONY: build clean binary-indep binary-arch binary install
|