Rev 4 | Rev 6 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/usr/bin/make -f# debian/rules file for libraries## To build the packages, run `dpkg-buildpackage' or `debuild' from the# parent directory of this file. (You may need to specify the `-rfakeroot'# option if you are using dpkg-buildpackage and are not running as root)## $Id: rules,v 1.8 2003/04/30 07:45:50 timshel Exp $## Copyright (C) 1999, 2000, 2001, 2002 Timshel Knoll <timshel@debian.org># Licensed under the terms of the GNU General Public License## Based originally on Sample debian/rules that uses debhelper, from dh-make,# GNU copyright 1997 to 1999 by Joey Hess.# Uncomment this to turn on verbose mode.#export DH_VERBOSE=1# This is the debhelper compatibility version to use.export DH_COMPAT=4# These are used for cross-compiling and for saving the configure script# from having to guess our platform (since we know it already)DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)CFLAGS += -gifeq (, $(findstring noopt, $(DEB_BUILD_OPTIONS)))CFLAGS += -O2elseCFLAGS += -O0endif# The name of the library - this is the base name of the packages that# will be builtLIBRARY = liboop# This is the soname of the package being built - we have to know this# before the start of the build because changing the control file half# way though the build probably isn't a good idea, and this would also# mean renaming the $(LIBRARY)$(SONAME).{files,docs,...} filesSONAME = 4# A list of variables to substitute when generating files from .in files# If you put an 'x' here, then all @x@'s in .in files will be substituted# with the value of $(x) in the output fileSUBSTS = SONAMEGENFILES = debian/control \debian/$(LIBRARY)$(SONAME).files \debian/$(LIBRARY)$(SONAME).dirs# We can't use these until after the package has been built ... otherwise# they will fail because no .libs/lib*.so.* existsversion = $(shell ls .libs/lib*.so.* | \awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) \print substr($$0,RSTART)}')major = $(shell ls .libs/lib*.so.* | \awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}')# This builds a substitution list for sed based on the SUBSTS variable# and the variables whose names SUBSTS contains ...SUBSTLIST = $(foreach subst, $(SUBSTS),s/@$(subst)@/$($(subst))/g;)# A sane default ruledefault:@echo "Try: debian/rules [configure|build|clean|install|binary|binary-arch|binary-indep]"@echo "Vars:"@echo " SUBSTLIST: $(SUBSTLIST)"@echo " SONAME: $(SONAME)"# Pattern rules:# How to generate files from .in'sdebian/%: debian/%.in debian/rulessed -e '$(SUBSTLIST)' < $< > $@# This puts the $(LIBRARY)* packaging files in their right places# Could I / should I use ln?debian/$(LIBRARY)$(SONAME).%: debian/$(LIBRARY).%cp $< $@# Do the substitution/moving stuffpackaging-files: $(GENFILES)configure: packaging-files configure-stampconfigure-stamp:dh_testdirenv CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usrtouch $@build: configure-stamp build-stampbuild-stamp:dh_testdir$(MAKE)touch $@clean:dh_testdirdh_testrootrm -f build-stamp configure-stamp-$(MAKE) distclean-$(MAKE) -C liboop.org distclean-test -r /usr/share/misc/config.sub && \cp -f /usr/share/misc/config.sub config.sub-test -r /usr/share/misc/config.guess && \cp -f /usr/share/misc/config.guess config.guessdh_cleaninstall-indep:dh_testdirdh_testrootdh_clean -kdh_installdirs -i$(MAKE) -C liboop.org install \DESTDIR=$(CURDIR)/debian/tmp/usr/share/doc/liboop-doc/htmlinstall-arch: builddh_testdirdh_testrootdh_clean -kdh_installdirs -a$(MAKE) install DESTDIR=$(CURDIR)/debian/tmpbinary-indep: install-indepdh_testdirdh_testrootdh_movefiles -idh_installdocs -idh_installman -idh_installinfo -idh_installchangelogs -idh_link -idh_compress -i -Xliboop-doc/htmldh_fixperms -idh_installdeb -idh_gencontrol -idh_md5sums -idh_builddeb -ibinary-arch: install-archdh_testdirdh_testrootdh_movefiles -adh_installdocs -adh_installman -adh_installinfo -adh_installchangelogs -adh_link -adh_strip -adh_compress -a -Xliboop-doc/htmldh_fixperms -adh_makeshlibs -adh_installdeb -a# Don't add the depends for adapter libraries - programs which link# with them will also link with the appropriate librarydh_shlibdeps -a -Xliboop-dh_gencontrol -adh_md5sums -adh_builddeb -abinary: binary-indep binary-arch.PHONY: packaging-files configure build install.PHONY: binary-indep binary-arch binary clean