#! /usr/bin/make -f # Copyright 1994-9 joey@infodrom.north.de (Martin Schulze) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. SHELL=/bin/bash # The name and version of the source # source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g') package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g') version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g') revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g') installbin = install -g root -o root -m 755 installdoc = install -g root -o root -m 644 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS = -g -O2 -Wall else CFLAGS = -O2 -Wall endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) STRIP = strip else STRIP = echo endif build: $(MAKE) CFLAGS="$(CFLAGS)" touch stamp-build clean: debclean rm -f stamp-build $(MAKE) clean find . -name '*~' -exec rm {} \; debclean: # Cleans debian binary directories to allow binary creation rm -rf debian/tmp rm -f debian/{files,substvars} binary-indep: # Nothing to be done here binary-arch: debclean rm -rf debian/tmp test -f stamp-build || $(MAKE) -f debian/rules build $(installbin) -d debian/tmp/DEBIAN chown -R root.root debian/tmp chmod -R g-ws debian/tmp # $(installbin) -d debian/tmp/usr/share/doc/$(package)/examples $(installdoc) debian/copyright debian/tmp/usr/share/doc/$(package) $(installdoc) readme debian/tmp/usr/share/doc/$(package) $(installdoc) cookies.txt debian/tmp/usr/share/doc/$(package) $(installdoc) CHANGES debian/tmp/usr/share/doc/$(package)/changelog $(installdoc) debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian $(installdoc) CREDITS debian/tmp/usr/share/doc/$(package)/credits $(installdoc) cgitest.c debian/tmp/usr/share/doc/$(package)/examples $(installdoc) jumpto.c debian/tmp/usr/share/doc/$(package)/examples gzip -9fn debian/tmp/usr/share/doc/$(package)/changelog{,.Debian} # $(installbin) -d debian/tmp/usr/share/man/man{3,5} for page in *.3; do \ $(installdoc) $${page} debian/tmp/usr/share/man/man3/$${page}; \ done $(installdoc) cgi.5 debian/tmp/usr/share/man/man5/cgi.5 gzip -9fn debian/tmp/usr/share/man/man?/* # $(installbin) -d debian/tmp/usr/include $(installdoc) cgi.h debian/tmp/usr/include $(installbin) -d debian/tmp/usr/lib $(installdoc) libcgi.a debian/tmp/usr/lib strip --strip-debug libcgi.a debian/tmp/usr/lib/libcgi.a # $(installdoc) $(target)/tmp/$(MSHLIB) debian/tmp/usr/lib # ln -sf $(MSHLIB) debian/tmp/usr/tmp/$(MSHLIB0) # ln -sf $(MSHLIB0) debian/tmp/usr/tmp/$(MSHLIB00) # chown root.root debian/tmp/usr/tmp/$(MSHLIB0) debian/tmp/usr/tmp/$(MSHLIB00) # strip --strip-unneeded debian/tmp/usr/tmp/$(MSHLIB0) # # dpkg-shlibdeps debian/tmp/usr/tmp/$(MSHLIB0) dpkg-gencontrol -isp dpkg --build debian/tmp .. binary: binary-indep binary-arch source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false dsc: -test -d debian/tmp && $(MAKE) -f debian/rules clean if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \ then \ ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \ touch /tmp/stamp-$(source)-link; \ fi; \ cd .. && dpkg-source -b $(source)-$(version) if [ -f /tmp/stamp-$(source)-link ]; then \ rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \ fi checkroot: $(checkdir) test root = "`whoami`" dist: binary dsc .PHONY: binary binary-arch binary-indep clean checkroot