3 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
6 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
10 host_arch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
13 pkg-p4 := ctsim-pentium4
14 pkg-athlon := ctsim-athlon
15 pkg-help := ctsim-help
18 ctsim-shared := usr/share/ctsim
20 prefix := debian/$(pkg)
21 prefix-p4 := debian/$(pkg-p4)
22 prefix-athlon := debian/$(pkg-athlon)
23 prefix-help := debian/$(pkg-help)
24 prefix-doc := debian/$(pkg-doc)
26 DESTDIR := `pwd`/$(prefix)
27 DESTDIR-P4 := `pwd`/$(prefix-p4)
28 DESTDIR-ATHLON := `pwd`/$(prefix-athlon)
29 HELPDIR := `pwd`/$(prefix-help)/$(ctsim-shared)
30 doc-dir := usr/share/doc/$(pkg-doc)
31 pixmap-dir := usr/share/pixmaps
34 configure: configure-stamp
37 # Add here commands to configure the package.
38 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
42 build-arch: configure-stamp build-arch-stamp
45 # Add here commands to compile the package.
47 touch build-arch-stamp
49 build-indep: configure-stamp build-indep-stamp
52 # Add here command to compile/build the arch indep package.
53 # It's ok not to do anything here, if you don't need to build
54 # anything for this package.
55 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
56 (cd docs; tar xzf html.tar.gz)
57 touch build-indep-stamp
59 build: build-arch build-indep
64 rm -f build-arch-stamp build-indep-stamp configure-stamp
65 # Add here commands to clean up after the build process.
67 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
68 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
78 dh_installdirs -p $(pkg-help) $(ctsim-shared)
80 # Testing for i386 optimized builds
81 echo Host architecture is $(host_arch)
82 ifneq (,$(findstring i386,$(host_arch)))
83 # Building CPU-specific i386 flavors
86 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
91 ./configure --prefix=$(DESTDIR-ATHLON)/usr --mandir=$(DESTDIR-ATHLON)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon
94 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
95 dh_installdirs -p $(pkg-athlon) $(pixmap-dir)
96 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
97 dh_install -p $(pkg-athlon) debian/ctsim.xpm $(pixmap-dir)
99 # Add here commands to install the package into debian/ctsim.
100 dh_installdirs -p $(pkg) $(pixmap-dir)
101 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
102 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
103 dh_install -p $(pkg-doc) docs/html $(doc-dir)
104 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
105 gzip -9 docs/ctsim.pdf
106 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
107 gunzip docs/ctsim.pdf.gz
108 chmod +x helical/*.sh tools/*.sh
110 # Build architecture-independent files here.
111 # Pass -i to all debhelper commands in this target to reduce clutter.
112 binary-indep: build install
115 # dh_installdebconf -i
117 dh_installexamples -i
119 # dh_installlogrotate -i
120 # dh_installemacsen -i
128 dh_installchangelogs ChangeLog -i
138 # Build architecture-dependent files here.
139 binary-arch: build install
142 # dh_installdebconf -a
144 dh_installexamples -p $(pkg) tools/sample-ctsim.sh helical/sample-helical.sh
145 ifneq (,$(findstring i386,$(host_arch)))
146 dh_installexamples -p $(pkg-p4) tools/sample-ctsim.sh helical/sample-helical.sh
147 dh_installexamples -p $(pkg-athlon) tools/sample-ctsim.sh helical/sample-helical.sh
149 # dh_installlogrotate -a
150 # dh_installemacsen -a
160 ifeq (,$(findstring i386,$(host_arch)))
161 dh_installchangelogs -p $(pkg)ChangeLog
164 dh_compress -p $(pkg)
165 dh_fixperms -p $(pkg)
166 dh_installmenu -p $(pkg)
167 dh_installdeb -p $(pkg)
168 dh_gencontrol -p $(pkg)
169 dh_shlibdeps -p $(pkg)
171 dh_builddeb -p $(pkg)
173 dh_installchangelogs ChangeLog -a
186 binary: binary-indep binary-arch
188 .PHONY: build clean binary-indep binary-arch binary install configure