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 168 169 170 171 172 173
|
#!/usr/bin/make -f
export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export HOME=$(CURDIR)/build
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall -Wno-comment
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g -O0
export STRIP=true
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
clean:
dh_testdir
dh_testroot
# Clean up files that Makefile should have cleaned
rm -rf $(CURDIR)/build
rm -f support/cpp/configargs.h,.log
rm -f support/cpp/config.log
rm -f support/cpp/config.status
rm -f sim/ucsim/config.guess
rm -f sim/ucsim/config.sub
rm -f sim/ucsim/config.status
rm -f sim/ucsim/config.log
rm -f config.log
rm -f device/lib/small-stack-auto/Makefile
rm -f as/link/asxxxx_config.h
rm -f device/lib/large/*.asm
rm -f device/lib/medium/*.asm
rm -f device/lib/small/*.asm
rm -f device/lib/small-stack-auto/*.asm
rm -f support/cpp/configargs.h
find -type f -name '*.o' -exec rm -f {} \;
find -type f -name '.stamp' -exec rm -f {} \;
find . -name '*.rel' -exec rm -f {} \;
#find 'device/lib/{small*,large,medium}' -name *.asm -exec rm -f {} \;
find . -name '*.sym' -exec rm -f {} \;
find . -name '*.lst' -exec rm -f {} \;
# Clean up the Debian specific files
rm -f config.status doc/sdccman.ps
rm -f build-stamp configure-stamp install-arch-stamp install-indep-stamp install-stamp
rm -f as/link/lk_readnl.c # Remove in next version
rm -f as/link/lk_readnl.h # Remove in next version
[ ! -f Makefile ] || $(MAKE) distclean
dh_clean
configure: configure-stamp
configure-stamp:
dh_testdir
mkdir -p $(CURDIR)/build
cp /usr/share/misc/config.sub sim/ucsim/config.sub
cp /usr/share/misc/config.guess sim/ucsim/config.guess
cp debian/lk_readnl.h as/link/lk_readnl.h # Remove in next version
cp debian/lk_readnl.c as/link/lk_readnl.c # Remove in next version
./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--disable-avr-port \
--disable-ds390-port \
--disable-ds400-port \
--disable-gbz80-port \
--disable-hc08-port \
--enable-mcs51-port \
--disable-pic-port \
--disable-pic16-port \
--disable-xa51-port \
--disable-z80-port \
--disable-z80-port
touch $@
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE)
# cd doc && lyx -e ps sdccman.lyx
touch $@
install: install-stamp
install-stamp: build
dh_testdir
dh_testroot
dh_installdirs
dh_prep
$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
mkdir -p debian/tmp/usr/share/doc/cc1111
# install -o root -g root -m 644 doc/sdccman.ps debian/tmp/usr/share/doc/cc1111
mv debian/tmp/usr/share/doc/sdcc/* debian/tmp/usr/share/doc/cc1111/
# Add some scripts
mkdir -p debian/tmp/usr/share/sdcc/scripts
install -o root -g root -m 755 support/scripts/inc2h.pl debian/tmp/usr/share/sdcc/scripts
install -o root -g root -m 755 support/scripts/keil2sdcc.pl debian/tmp/usr/share/sdcc/scripts
#Remove extra license file
rm -f $(CURDIR)/debian/tmp/usr/share/sdcc/lib/src/pic16/COPYING
# Remove empty dirs:
find $(CURDIR)/debian/tmp -type d -empty -delete
#Clean up unnecessary directories
rm -rf `find $(CURDIR)/debian/tmp -type d -name .deps`
dh_install --sourcedir=debian/tmp
mkdir -p $(CURDIR)/debian/cc1111/usr/share/lintian/overrides/
install -p -o root -g root -m 644 $(CURDIR)/debian/cc1111.overrides \
$(CURDIR)/debian/cc1111/usr/share/lintian/overrides/cc1111
# Install examples
cp -a device/examples $(CURDIR)/debian/cc1111/usr/share/doc/cc1111
rm -rf $(CURDIR)/debian/cc1111/usr/share/doc/cc1111/examples/ds400
rm -rf $(CURDIR)/debian/cc1111/usr/share/doc/cc1111/examples/ds390
rm -rf $(CURDIR)/debian/cc1111/usr/share/doc/cc1111/examples/xa51
# clean up things cc1111 doesn't need
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/pic
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/pic16
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/ds400
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/hc08
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/z80
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/ds390
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/lib/src/gbz80
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/ds400rom.h
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/*390*
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/asm/pic
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/asm/pic16
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/asm/z80
rm -rf $(CURDIR)/debian/cc1111/usr/share/sdcc/include/asm/gbz80
touch $@
# Must not depend on anything. This is to be called by binary-arch/binary-indep
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installman
dh_installemacsen
dh_link
dh_strip -Xusr/share/sdcc/lib/
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-independent files here.
binary-indep: install
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture-dependent files here.
binary-arch: install
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
binary: binary-arch binary-indep
.PHONY: build-indep build-arch build clean binary-indep binary-arch binary install install-arch install-indep
|