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
|
#!/usr/bin/make -f
# Debian package build rules file for xtrs
# Copyright 1997-1999 Joey Hess.
# Copyright 1999, 2004 Branden Robinson.
# Licensed under the GNU General Public License, version 2. See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Command for converting HTML to plain text.
#HTML2TEXT=lynx -dump -nolist
HTML2TEXT=html2text -nobs -style pretty
ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
ifneq (,$(findstring $(ARCH),alpha amd64 arm i386 ia64 mipsel sh3 sh4))
ENDIANNESS=little
endif
ifneq (,$(findstring $(ARCH),armeb hppa m68k mips powerpc ppc64 sparc s390))
ENDIANNESS=big
endif
ifeq ($(ENDIANNESS),)
$(error endianness of $(ARCH) architecture is unknown\; cannot continue)
endif
# if $DEB_BUILD_OPTIONS *doesn't* contain "noopt"
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPTIMIZE:=-O2
endif
PLAINTEXT_GOALS=cpmutil.txt dskspec.txt debian/trs80faq.txt
%.txt: %.html
$(HTML2TEXT) $< >$@
build: build-stamp
build-stamp: $(PLAINTEXT_GOALS)
dh_testdir
# Touch the mtimes on some of the assembled .hex files; when Tim Mann
# renamed the Z-80 assembly sources from ".z" to ".z80", their mtimes got
# updated and therefore Make thinks the .hex files need to be remade, using
# the zmac assembler, which is not widely available.
#
# This is hopefully a temporary kludge, and the timestamps will be fixed in
# the next (post-4.9c) xtrs release.
for F in \
fakerom.hex \
xtrsrom4p.hex \
; do \
touch "$$F"; \
done
ifeq ($(ENDIANNESS),big)
$(MAKE) DEBUG="-Wall -Werror $(OPTIMIZE) -g -D_REENTRANT" PREFIX=/usr \
ENDIAN=-Dbig_endian
else
$(MAKE) DEBUG="-Wall -Werror $(OPTIMIZE) -g -D_REENTRANT" PREFIX=/usr
endif
: >$@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
-rm $(PLAINTEXT_GOALS)
$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) PREFIX=debian/xtrs/usr install
install -m 755 cassette.sh debian/xtrs/usr/bin/cassette
install -m 644 cpmutil.dsk utility.dsk debian/xtrs/usr/lib/xtrs
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs README xtrsrom4p.README cpmutil.html dskspec.html \
debian/README.contrib-only debian/trs80faq.html $(PLAINTEXT_GOALS)
dh_installdebconf
dh_installmenu
dh_installman cassette.man cmddump.man hex2cmd.man mkdisk.man xtrs.man
dh_installchangelogs ChangeLog
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# This source package builds no architecture-independent binary packages.
binary-indep:
binary: binary-arch
.PHONY: build clean binary-arch binary-indep binary install
# vim:set ai noet sw=8 ts=8 tw=80:
|