5 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
8 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
12 host_arch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
15 pkg-p4 := ctsim-pentium4
16 pkg-p3 := ctsim-pentium3
17 pkg-athlon := ctsim-athlon
18 pkg-help := ctsim-help
21 ctsim-shared := usr/share/ctsim
23 prefix := debian/$(pkg)
24 prefix-p4 := debian/$(pkg-p4)
25 prefix-p3 := debian/$(pkg-p3)
26 prefix-athlon := debian/$(pkg-athlon)
27 prefix-help := debian/$(pkg-help)
28 prefix-doc := debian/$(pkg-doc)
30 DESTDIR := `pwd`/$(prefix)
31 DESTDIR-P4 := `pwd`/$(prefix-p4)
32 DESTDIR-P3 := `pwd`/$(prefix-p3)
33 DESTDIR-ATHLON := `pwd`/$(prefix-athlon)
34 HELPDIR := `pwd`/$(prefix-help)/$(ctsim-shared)
35 doc-dir := usr/share/doc/$(pkg-doc)
36 pixmap-dir := usr/X11R6/include/X11/pixmaps
39 configure: configure-stamp
42 # Add here commands to configure the package.
43 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
47 build-arch: configure-stamp build-arch-stamp
50 # Add here commands to compile the package.
52 touch build-arch-stamp
54 build-indep: configure-stamp build-indep-stamp
57 # Add here command to compile/build the arch indep package.
58 # It's ok not to do anything here, if you don't need to build
59 # anything for this package.
60 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
61 (cd docs; tar xzf html.tar.gz)
62 touch build-indep-stamp
64 build: build-arch build-indep
69 rm -f build-arch-stamp build-indep-stamp configure-stamp
70 # Add here commands to clean up after the build process.
72 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
73 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
83 dh_installdirs -p $(pkg-help) $(ctsim-shared)
85 # Testing for i386 optimized builds
86 echo Host architecture is $(host_arch)
87 ifneq (,$(findstring i386,$(host_arch)))
88 # Building CPU-specific i386 flavors
91 ./configure --prefix=$(DESTDIR-P3)/usr --mandir=$(DESTDIR-P3)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium3
96 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
101 ./configure --prefix=$(DESTDIR-ATHLON)/usr --mandir=$(DESTDIR-ATHLON)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon
104 dh_installdirs -p $(pkg-p3) $(pixmap-dir)
105 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
106 dh_installdirs -p $(pkg-athlon) $(pixmap-dir)
107 dh_install -p $(pkg-p3) debian/ctsim.xpm $(pixmap-dir)
108 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
109 dh_install -p $(pkg-athlon) debian/ctsim.xpm $(pixmap-dir)
111 # Add here commands to install the package into debian/ctsim.
112 dh_installdirs -p $(pkg) $(pixmap-dir)
113 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
114 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
115 dh_install -p $(pkg-doc) docs/html $(doc-dir)
116 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
117 gzip -9 docs/ctsim.pdf
118 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
119 gunzip docs/ctsim.pdf.gz
120 chmod +x helical/*.sh tools/*.sh
122 # Build architecture-independent files here.
123 # Pass -i to all debhelper commands in this target to reduce clutter.
124 binary-indep: build install
127 # dh_installdebconf -i
129 dh_installexamples -i
131 # dh_installlogrotate -i
132 # dh_installemacsen -i
140 dh_installchangelogs ChangeLog -i
150 # Build architecture-dependent files here.
151 binary-arch: build install
154 # dh_installdebconf -a
156 dh_installexamples -p $(pkg) tools/sample-ctsim.sh helical/sample-helical.sh
157 ifneq (,$(findstring i386,$(host_arch)))
158 dh_installexamples -p $(pkg-p3) tools/sample-ctsim.sh helical/sample-helical.sh
159 dh_installexamples -p $(pkg-p4) tools/sample-ctsim.sh helical/sample-helical.sh
160 dh_installexamples -p $(pkg-athlon) tools/sample-ctsim.sh helical/sample-helical.sh
162 # dh_installlogrotate -a
163 # dh_installemacsen -a
173 ifeq (,$(findstring i386,$(host_arch)))
174 dh_installchangelogs -p $(pkg)ChangeLog
177 dh_compress -p $(pkg)
178 dh_fixperms -p $(pkg)
179 dh_installmenu -p $(pkg)
180 dh_installdeb -p $(pkg)
181 dh_gencontrol -p $(pkg)
182 dh_shlibdeps -p $(pkg)
184 dh_builddeb -p $(pkg)
186 dh_installchangelogs ChangeLog -a
199 binary: binary-indep binary-arch
201 .PHONY: build clean binary-indep binary-arch binary install configure