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) \
71 build-stamp: configure-stamp
74 cd doc && lyx -e ps sdccman.lyx
77 install: install-stamp
83 $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
84 mkdir -p debian/tmp/usr/share/doc/sdcc-doc
85 install -o root -g root -m 644 doc/sdccman.ps debian/tmp/usr/share/doc/sdcc-doc
86 mv debian/tmp/usr/share/doc/sdcc/* debian/tmp/usr/share/doc/sdcc-doc/
87 rm -f debian/tmp/usr/share/doc/sdcc-doc/z80/combined_i186_z80_design.tex
88 rm -f debian/tmp/usr/share/doc/sdcc-doc/z80/Makefile
90 mkdir -p debian/tmp/usr/share/sdcc/scripts
91 install -o root -g root -m 755 support/scripts/inc2h-pic16.pl debian/tmp/usr/share/sdcc/scripts
92 install -o root -g root -m 755 support/scripts/inc2h.pl debian/tmp/usr/share/sdcc/scripts
93 install -o root -g root -m 755 support/scripts/keil2sdcc.pl debian/tmp/usr/share/sdcc/scripts
95 #Remove extra license file
96 rm -f $(CURDIR)/debian/tmp/usr/share/sdcc/lib/src/pic16/COPYING
98 find $(CURDIR)/debian/tmp -type d -empty -delete
100 #Clean up unnecessary directories
101 rm -rf `find $(CURDIR)/debian/tmp -type d -name .deps`
103 dh_install --sourcedir=debian/tmp
106 mkdir -p $(CURDIR)/debian/sdcc-libraries/usr/share/lintian/overrides/
107 install -p -o root -g root -m 644 $(CURDIR)/debian/sdcc-libraries.overrides \
108 $(CURDIR)/debian/sdcc-libraries/usr/share/lintian/overrides/sdcc-libraries
110 cp -a device/examples $(CURDIR)/debian/sdcc-doc/usr/share/doc/sdcc-doc
113 # Must not depend on anything. This is to be called by binary-arch/binary-indep
114 # in another 'make' thread.
118 dh_installchangelogs ChangeLog
121 #dh_installexamples -psdcc-doc device/examples/* -X\.bat
124 dh_strip -Xusr/share/sdcc/lib/
133 # Build architecture-independent files here.
134 binary-indep: install
135 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
137 # Build architecture-dependent files here.
139 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
141 binary: binary-arch binary-indep
142 .PHONY: build clean binary-indep binary-arch binary install install-arch install-indep