#!/usr/bin/make -f include /usr/share/dpkg/buildflags.mk STRIP =strip ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) STRIP =: nostrip endif CFLAGS +=-Wall LDFLAGS += CC =gcc ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) CC =diet -v -Os gcc -nostdinc endif DIR =$(shell pwd)/debian/ipsvd build: deb-checkdir build-stamp build-stamp: -gcc -v test -e ipsvd || ln -s ipsvd-1.0.0 ipsvd test -r conf-cc'{orig}' || cp -f ipsvd/src/conf-cc conf-cc'{orig}' echo '$(CC) $(CPPFLAGS) $(CFLAGS)' >ipsvd/src/conf-cc test -r conf-ld'{orig}' || cp -f ipsvd/src/conf-ld conf-ld'{orig}' echo '$(CC) $(LDFLAGS)' >ipsvd/src/conf-ld (cd ipsvd/ && package/compile && package/check) touch build-stamp build-arch build-indep: build clean: deb-checkdir deb-checkuid rm -rf ipsvd/compile ipsvd/command rm -f build-stamp rm -rf '$(DIR)' rm -f debian/files debian/substvars changelog test ! -r conf-cc'{orig}' || mv -f conf-cc'{orig}' ipsvd/src/conf-cc test ! -r conf-ld'{orig}' || mv -f conf-ld'{orig}' ipsvd/src/conf-ld rm -f ipsvd install: deb-checkdir deb-checkuid build-stamp rm -rf '$(DIR)' # programs install -d -m0755 '$(DIR)'/usr/bin for i in tcpsvd udpsvd ipsvd-cdb; do \ install -m0755 ipsvd/command/$$i '$(DIR)'/usr/bin/ || exit 1; \ done $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/* # man pages for i in 5 7 8; do \ install -d -m0755 '$(DIR)'/usr/share/man/man$$i && \ for j in ipsvd/man/*.$$i; do \ install -m0644 $$j '$(DIR)'/usr/share/man/man$$i/ || exit 1; \ done || exit 1; \ done rm -f '$(DIR)'/usr/share/man/man8/ssl*.8 gzip -9n '$(DIR)'/usr/share/man/man?/*.? # changelog rm -f changelog && ln -s ipsvd/package/CHANGES changelog binary-indep: binary-arch: install ipsvd.deb test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/* dpkg-gencontrol -isp -pipsvd -P'$(DIR)' dpkg -b '$(DIR)' .. binary: binary-indep binary-arch .PHONY: build clean install binary-indep binary-arch binary include debian/implicit