3 include /usr/share/quilt/quilt.make
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11 export HOME=$(CURDIR)/build
13 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
17 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21 clean: clean-patched unpatch
25 # Clean up files that Makefile should have cleaned
26 rm -rf $(CURDIR)/build
27 rm -f support/cpp/configargs.h,.log
28 rm -f support/cpp/config.log
29 rm -f support/cpp/config.status
30 rm -f sim/ucsim/config.guess
31 rm -f sim/ucsim/config.sub
32 rm -f sim/ucsim/config.status
33 rm -f sim/ucsim/config.log
35 rm -f device/lib/small-stack-auto/Makefile
36 rm -f as/link/asxxxx_config.h
37 rm -f device/lib/large/*.asm
38 rm -f device/lib/medium/*.asm
39 rm -f device/lib/small/*.asm
40 rm -f device/lib/small-stack-auto/*.asm
41 rm -f support/cpp/configargs.h
42 find -type f -name '*.o' -exec rm -f {} \;
43 find -type f -name '.stamp' -exec rm -f {} \;
44 find . -name '*.rel' -exec rm -f {} \;
45 #find 'device/lib/{small*,large,medium}' -name *.asm -exec rm -f {} \;
46 find . -name '*.sym' -exec rm -f {} \;
47 find . -name '*.lst' -exec rm -f {} \;
48 # Clean up the Debian specific files
49 rm -f config.status doc/sdccman.ps
50 rm -f build-stamp configure-stamp install-arch-stamp install-indep-stamp install-stamp
51 rm -f as/link/lk_readnl.c # Remove in next version
52 rm -f as/link/lk_readnl.h # Remove in next version
53 [ ! -f Makefile ] || $(MAKE) distclean
56 configure: configure-stamp
57 configure-stamp: $(QUILT_STAMPFN)
59 mkdir -p $(CURDIR)/build
60 cp /usr/share/misc/config.sub sim/ucsim/config.sub
61 cp /usr/share/misc/config.guess sim/ucsim/config.guess
62 cp debian/lk_readnl.h as/link/lk_readnl.h # Remove in next version
63 cp debian/lk_readnl.c as/link/lk_readnl.c # Remove in next version
65 --host=$(DEB_HOST_GNU_TYPE) \
66 --build=$(DEB_BUILD_GNU_TYPE) \
69 --disable-ds390-port \
70 --disable-ds400-port \
71 --disable-gbz80-port \
75 --disable-pic16-port \
82 build-stamp: configure-stamp
85 cd doc && lyx -e ps sdccman.lyx
88 install: install-stamp
94 $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
95 mkdir -p debian/tmp/usr/share/doc/cc1111
96 install -o root -g root -m 644 doc/sdccman.ps debian/tmp/usr/share/doc/cc1111
97 mv debian/tmp/usr/share/doc/sdcc/* debian/tmp/usr/share/doc/cc1111/
99 mkdir -p debian/tmp/usr/share/sdcc/scripts
100 install -o root -g root -m 755 support/scripts/inc2h-pic16.pl debian/tmp/usr/share/sdcc/scripts
101 install -o root -g root -m 755 support/scripts/inc2h.pl debian/tmp/usr/share/sdcc/scripts
102 install -o root -g root -m 755 support/scripts/keil2sdcc.pl debian/tmp/usr/share/sdcc/scripts
104 #Remove extra license file
105 rm -f $(CURDIR)/debian/tmp/usr/share/sdcc/lib/src/pic16/COPYING
107 find $(CURDIR)/debian/tmp -type d -empty -delete
109 #Clean up unnecessary directories
110 rm -rf `find $(CURDIR)/debian/tmp -type d -name .deps`
112 dh_install --sourcedir=debian/tmp
115 mkdir -p $(CURDIR)/debian/cc1111/usr/share/lintian/overrides/
116 install -p -o root -g root -m 644 $(CURDIR)/debian/cc1111.overrides \
117 $(CURDIR)/debian/cc1111/usr/share/lintian/overrides/cc1111
119 cp -a device/examples $(CURDIR)/debian/cc1111/usr/share/doc/cc1111
122 # Must not depend on anything. This is to be called by binary-arch/binary-indep
123 # in another 'make' thread.
127 dh_installchangelogs ChangeLog
132 dh_strip -Xusr/share/sdcc/lib/
141 # Build architecture-independent files here.
142 binary-indep: install
143 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
145 # Build architecture-dependent files here.
147 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
149 binary: binary-arch binary-indep
150 .PHONY: build clean binary-indep binary-arch binary install install-arch install-indep