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-help := ctsim-help
17 ctsim-shared := usr/share/ctsim
19 prefix := debian/$(pkg)
20 prefix-p4 := debian/$(pkg-p4)
21 prefix-help := debian/$(pkg-help)
22 prefix-doc := debian/$(pkg-doc)
24 DESTDIR := `pwd`/$(prefix)
25 DESTDIR-P4 := `pwd`/$(prefix-p4)
26 HELPDIR := `pwd`/$(prefix-help)/$(ctsim-shared)
27 doc-dir := usr/share/doc/$(pkg-doc)
28 pixmap-dir := usr/share/pixmaps
29 desktop-dir := usr/share/applications
31 configure: configure-stamp
34 touch configure.in && touch aclocal.m4 && touch configure
36 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn -with-x
40 build-arch: configure-stamp build-arch-stamp
43 # Add here commands to compile the package.
45 touch build-arch-stamp
47 build-indep: configure-stamp build-indep-stamp
50 # Add here command to compile/build the arch indep package.
51 # It's ok not to do anything here, if you don't need to build
52 # anything for this package.
53 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
54 (cd docs; tar xzf html.tar.gz)
55 touch build-indep-stamp
57 build: build-arch build-indep
62 rm -f build-arch-stamp build-indep-stamp configure-stamp
63 # Add here commands to clean up after the build process.
65 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
66 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
67 # Ensure up-to-date versions of config.sub and config.guess
68 -test -r /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub config.sub
69 -test -r /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess config.guess
79 dh_installdirs -p $(pkg-help) $(ctsim-shared)
81 # Testing for i386 optimized builds
82 echo Host architecture is $(host_arch)
83 ifneq (,$(findstring i386,$(host_arch)))
84 # Building CPU-specific i386 flavors
87 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
91 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
92 dh_installdirs -p $(pkg-p4) $(desktop-dir)
93 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
94 dh_install -p $(pkg-p4) debian/ctsim.desktop $(desktop-dir)
97 # Add here commands to install the package into debian/ctsim.
98 dh_installdirs -p $(pkg) $(pixmap-dir)
99 dh_installdirs -p $(pkg) $(desktop-dir)
100 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
101 dh_install -p $(pkg) debian/ctsim.desktop $(desktop-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 # Pass -i to all debhelper commands in this target to reduce clutter.
111 binary-indep: build install
115 dh_installexamples -i
119 dh_installchangelogs ChangeLog -i
128 # Build architecture-dependent files here.
129 binary-arch: build install
133 dh_installexamples -p $(pkg) tools/sample-ctsim.sh helical/sample-helical.sh
134 ifneq (,$(findstring i386,$(host_arch)))
135 dh_installexamples -p $(pkg-p4) tools/sample-ctsim.sh helical/sample-helical.sh
138 ifeq (,$(findstring i386,$(host_arch)))
139 dh_installchangelogs -p $(pkg) ChangeLog
142 dh_compress -p $(pkg)
143 dh_fixperms -p $(pkg)
144 dh_installmenu -p $(pkg)
145 dh_installdeb -p $(pkg)
146 dh_gencontrol -p $(pkg)
147 dh_shlibdeps -p $(pkg)
149 dh_builddeb -p $(pkg)
151 dh_installchangelogs ChangeLog -a
164 binary: binary-indep binary-arch
166 .PHONY: build clean binary-indep binary-arch binary install configure