5 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
8 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
12 host_arch := $(dpkg-architecture -qDEB_HOST_ARCH)
15 pkg-p4 := ctsim-pentium4
16 pkg-athlon := ctsim-athlon
17 pkg-help := ctsim-help
20 ctsim-shared := usr/share/ctsim
22 prefix := debian/$(pkg)
23 prefix-p4 := debian/$(pkg-p4)
24 prefix-athlon := debian/$(pkg-athlon)
25 prefix-help := debian/$(pkg-help)
26 prefix-doc := debian/$(pkg-doc)
28 DESTDIR := `pwd`/$(prefix)
29 DESTDIR-P4 := `pwd`/$(prefix-p4)
30 DESTDIR-ATHLON := `pwd`/$(prefix-athlon)
31 HELPDIR := `pwd`/$(prefix-help)/$(ctsim-shared)
32 doc-dir := usr/share/doc/$(pkg-doc)
33 pixmap-dir := usr/X11R6/include/X11/pixmaps
36 configure: configure-stamp
39 # Add here commands to configure the package.
43 build-arch: configure-stamp build-arch-stamp
46 # Add here commands to compile the package.
47 dh_installdirs -p $(pkg-help) $(ctsim-shared)
48 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
51 ifeq ($(host_arch),i386)
54 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
59 ./configure --prefix=$(DESTDIR-ATHLON)/usr --mandir=$(DESTDIR-ATHLON)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon
63 touch build-arch-stamp
65 build-indep: configure-stamp build-indep-stamp
68 # Add here command to compile/build the arch indep package.
69 # It's ok not to do anything here, if you don't need to build
70 # anything for this package.
71 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
72 (cd docs; tar xzf html.tar.gz)
73 touch build-indep-stamp
75 build: build-arch build-indep
80 rm -f build-arch-stamp build-indep-stamp configure-stamp
81 # Add here commands to clean up after the build process.
83 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
84 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
93 # Add here commands to install the package into debian/ctsim.
94 dh_installdirs -p $(pkg) $(pixmap-dir)
95 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
96 dh_installdirs -p $(pkg-athlon) $(pixmap-dir)
97 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
98 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
99 dh_install -p $(pkg-athlon) debian/ctsim.xpm $(pixmap-dir)
100 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
101 dh_install -p $(pkg-doc) docs/html $(doc-dir)
102 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
103 gzip -9 docs/ctsim.pdf
104 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
105 gunzip docs/ctsim.pdf.gz
106 chmod +x helical/*.sh tools/*.sh
108 # Build architecture-independent files here.
109 # Pass -i to all debhelper commands in this target to reduce clutter.
110 binary-indep: build install
113 # dh_installdebconf -i
115 dh_installexamples -i
117 # dh_installlogrotate -i
118 # dh_installemacsen -i
126 dh_installchangelogs ChangeLog -i
136 # Build architecture-dependent files here.
137 binary-arch: build install
140 # dh_installdebconf -a
142 dh_installexamples -a tools/sample-ctsim.sh helical/sample-helical.sh
144 # dh_installlogrotate -a
145 # dh_installemacsen -a
153 dh_installchangelogs ChangeLog -a
166 binary: binary-indep binary-arch
168 .PHONY: build clean binary-indep binary-arch binary install configure