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-p := ctsim-pentium
17 pkg-athlon := ctsim-athlon
18 pkg-athlon-mp := ctsim-athlon-mp
19 pkg-help := ctsim-help
22 ctsim-shared := usr/share/ctsim
24 prefix := debian/$(pkg)
25 prefix-p4 := debian/$(pkg-p4)
26 prefix-p := debian/$(pkg-p)
27 prefix-athlon := debian/$(pkg-athlon)
28 prefix-athlon-mp:= debian/$(pkg-athlon-mp)
29 prefix-help := debian/$(pkg-help)
30 prefix-doc := debian/$(pkg-doc)
32 DESTDIR := `pwd`/$(prefix)
33 DESTDIR-P4 := `pwd`/$(prefix-p4)
34 DESTDIR-P := `pwd`/$(prefix-p)
35 DESTDIR-ATHLON := `pwd`/$(prefix-athlon)
36 DESTDIR-ATHLON-MP := `pwd`/$(prefix-athlon-mp)
37 HELPDIR := `pwd`/$(prefix-help)/$(ctsim-shared)
38 doc-dir := usr/share/doc/$(pkg-doc)
39 pixmap-dir := usr/X11R6/include/X11/pixmaps
42 configure: configure-stamp
45 # Add here commands to configure the package.
46 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
50 build-arch: configure-stamp build-arch-stamp
53 # Add here commands to compile the package.
55 touch build-arch-stamp
57 build-indep: configure-stamp build-indep-stamp
60 # Add here command to compile/build the arch indep package.
61 # It's ok not to do anything here, if you don't need to build
62 # anything for this package.
63 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
64 (cd docs; tar xzf html.tar.gz)
65 touch build-indep-stamp
67 build: build-arch build-indep
72 rm -f build-arch-stamp build-indep-stamp configure-stamp
73 # Add here commands to clean up after the build process.
75 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
76 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
86 dh_installdirs -p $(pkg-help) $(ctsim-shared)
88 # Testing for i386 optimized builds
89 echo Host architecture is $(host_arch)
90 ifneq (,$(findstring i386,$(host_arch)))
91 # Building CPU-specific i386 flavors
94 ./configure --prefix=$(DESTDIR-P)/usr --mandir=$(DESTDIR-P)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium
99 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
104 ./configure --prefix=$(DESTDIR-ATHLON)/usr --mandir=$(DESTDIR-ATHLON)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon
109 ./configure --prefix=$(DESTDIR-ATHLON-MP)/usr --mandir=$(DESTDIR-ATHLON-MP)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon-mp
112 dh_installdirs -p $(pkg-p) $(pixmap-dir)
113 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
114 dh_installdirs -p $(pkg-athlon) $(pixmap-dir)
115 dh_installdirs -p $(pkg-athlon-mp) $(pixmap-dir)
116 dh_install -p $(pkg-p) debian/ctsim.xpm $(pixmap-dir)
117 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
118 dh_install -p $(pkg-athlon) debian/ctsim.xpm $(pixmap-dir)
119 dh_install -p $(pkg-athlon-mp) debian/ctsim.xpm $(pixmap-dir)
121 # Add here commands to install the package into debian/ctsim.
122 dh_installdirs -p $(pkg) $(pixmap-dir)
123 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
124 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
125 dh_install -p $(pkg-doc) docs/html $(doc-dir)
126 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
127 gzip -9 docs/ctsim.pdf
128 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
129 gunzip docs/ctsim.pdf.gz
130 chmod +x helical/*.sh tools/*.sh
132 # Build architecture-independent files here.
133 # Pass -i to all debhelper commands in this target to reduce clutter.
134 binary-indep: build install
137 # dh_installdebconf -i
139 dh_installexamples -i
141 # dh_installlogrotate -i
142 # dh_installemacsen -i
150 dh_installchangelogs ChangeLog -i
160 # Build architecture-dependent files here.
161 binary-arch: build install
164 # dh_installdebconf -a
166 dh_installexamples -a tools/sample-ctsim.sh helical/sample-helical.sh
168 # dh_installlogrotate -a
169 # dh_installemacsen -a
177 dh_installchangelogs ChangeLog -a
188 dh_builddeb -p $(pkg)
189 ifneq (,$(findstring i386,$(host_arch)))
190 dh_builddeb -p $(pkg-p)
191 dh_builddeb -p $(pkg-p4)
192 dh_builddeb -p $(pkg-athlon)
193 dh_builddeb -p $(pkg-athlon-mp)
196 binary: binary-indep binary-arch
198 .PHONY: build clean binary-indep binary-arch binary install configure