summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules102
1 files changed, 102 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..f57e4bb
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,102 @@
+#!/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)
+ENDIANNESS=$(shell dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)
+
+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 -Wno-error=unused-but-set-variable $(OPTIMIZE) -g -D_REENTRANT" PREFIX=/usr \
+ ENDIAN=-Dbig_endian
+else
+ $(MAKE) DEBUG="-Wall -Werror -Wno-error=unused-but-set-variable $(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: