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 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)
79 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
82 ifeq ($(host_arch),i386)
85 ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=pentium4
90 ./configure --prefix=$(DESTDIR-ATHLON)/usr --mandir=$(DESTDIR-ATHLON)/usr/share/man --datadir=$(HELPDIR) --with-ctn --with-mcpu=athlon
94 # Add here commands to install the package into debian/ctsim.
95 dh_installdirs -p $(pkg) $(pixmap-dir)
96 dh_installdirs -p $(pkg-p4) $(pixmap-dir)
97 dh_installdirs -p $(pkg-athlon) $(pixmap-dir)
98 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
99 dh_install -p $(pkg-p4) debian/ctsim.xpm $(pixmap-dir)
100 dh_install -p $(pkg-athlon) debian/ctsim.xpm $(pixmap-dir)
101 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
102 dh_install -p $(pkg-doc) docs/html $(doc-dir)
103 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
104 gzip -9 docs/ctsim.pdf
105 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
106 gunzip docs/ctsim.pdf.gz
107 chmod +x helical/*.sh tools/*.sh
109 # Build architecture-independent files here.
110 # Pass -i to all debhelper commands in this target to reduce clutter.
111 binary-indep: build install
114 # dh_installdebconf -i
116 dh_installexamples -i
118 # dh_installlogrotate -i
119 # dh_installemacsen -i
127 dh_installchangelogs ChangeLog -i
137 # Build architecture-dependent files here.
138 binary-arch: build install
141 # dh_installdebconf -a
143 dh_installexamples -a tools/sample-ctsim.sh helical/sample-helical.sh
145 # dh_installlogrotate -a
146 # dh_installemacsen -a
154 dh_installchangelogs ChangeLog -a
167 binary: binary-indep binary-arch
169 .PHONY: build clean binary-indep binary-arch binary install configure