#!/usr/bin/make -f # debian/rules file for sgb, Julian Gilbey 11/98, GNU GPL. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 FULL_VERSION = $(shell dpkg-parsechangelog | perl -ne '/^Version: (.*)/ && print $$1') UPSTREAM_VERSION = $(shell echo $(FULL_VERSION) | perl -ne '/^(?:\d+:)?(.*)-/ && print $$1') REVISION = $(shell dpkg-parsechangelog | perl -ne '/^Version: \d+:.*-(.*)$$/ && print $$1') sgbdir=debian/sgb fullsgbdir=$(CURDIR)/$(sgbdir) # We thought this might be a solution for an m86k compiler bug, but # apparently not.... # # Are we using gcc-2.95 or later, which requires -fno-strict-aliasing? # GCC_VERSION := $(shell gcc --version) # OPT_FLAG := $(shell dpkg --compare-versions 2.95 le '$(GCC_VERSION)' && echo -fno-strict-aliasing) # We'll try this instead ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) OPTIMISATION := -O0 else OPTIMISATION := -O2 endif # shouldn't need this any longer # ifeq (m68k,$(shell dpkg --print-architecture)) # OPTIMISATION += -O1 # else # OPTIMISATION += -O2 # endif # We apply the PROTOTYPES to the package patch: patch-stamp patch-stamp: cp PROTOTYPES/*.ch . for i in gb_io gb_graph; do \ mv $${i}.ch $${i}_proto.ch && \ ctie -c $${i}.ch $${i}.w $${i}_proto.ch $${i}_headers.ch; \ done touch patch-stamp build-indep: build-indep-stamp build-indep-stamp: dh_testdir # We don't need to do anything touch build-indep-stamp build-arch: build-arch-stamp build-arch-stamp: patch dh_testdir $(MAKE) -f Makefile.debian CFLAGS='$(OPTIMISATION) -g -Wall -D_REENTRANT -Wall -I.' VERSION=$(UPSTREAM_VERSION) tests rm -f *.o $(MAKE) -f Makefile.debian CFLAGS='$(OPTIMISATION) -g -Wall -fPIC -D_REENTRANT -Wall -I.' VERSION=$(UPSTREAM_VERSION) sotests $(MAKE) -f Makefile.debian demos $(MAKE) -f Makefile.debian doc touch build-arch-stamp build: build-indep build-arch clean: dh_testdir dh_testroot rm -f build-*-stamp $(MAKE) -f Makefile.debian veryclean rm -f patch-stamp rm -f $$(cd PROTOTYPES && echo *.ch) rm -f gb_io_proto.ch gb_graph_proto.ch dh_clean install-indep: build-indep dh_testdir -i dh_testroot -i dh_prep -i dh_installdirs -i install-arch: build-arch dh_testdir -a dh_testroot -a dh_prep -a dh_installdirs -a $(MAKE) -f Makefile.debian install # We make appropriate links for the dynamic library cd $(sgbdir)/usr/lib && mv libgb.so libgb.so.1.$(UPSTREAM_VERSION) && \ ln -s libgb.so.1.$(UPSTREAM_VERSION) libgb.so.1 && \ ln -s libgb.so.1.$(UPSTREAM_VERSION) libgb.so # Build architecture-independent files here. binary-indep: build-indep install-indep dh_testdir -i dh_testroot -i dh_installdocs -i dh_installexamples -i mv debian/sgb-doc/usr/share/doc/sgb-doc/examples/Makefile.doc \ debian/sgb-doc/usr/share/doc/sgb-doc/examples/Makefile ln -s ../sgb-doc/examples debian/sgb-doc/usr/share/doc/sgb/examples ln -s ../sgb-doc/README.Debian \ debian/sgb-doc/usr/share/doc/sgb/README.examples dh_installchangelogs -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build-arch install-arch dh_testdir -a dh_testroot -a dh_installdocs -a dh_installexamples -a dh_installman -a *.1 dh_installchangelogs -a dh_lintian -a dh_strip -a dh_compress -a dh_fixperms -a dh_makeshlibs -a -V 'sgb (>= 1:20010107-2)' dh_installdeb -a dh_shlibdeps -a -l $(fullsgbdir)/usr/lib dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build build-indep build-arch clean binary-indep binary-arch \ binary install-indep install-arch # Local variables: # mode: makefile # End: