#!/usr/bin/make -f CC =gcc CFLAGS =-g -O2 -Wall # Avoid embedding build paths for reproducible builds CFLAGS += -ffile-prefix-map=$(CURDIR)=. LDFLAGS = STRIP =strip DIET_ARCHS =alpha amd64 arm hppa i386 ia64 mips mipsel powerpc ppc64 s390 sparc ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH) ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) CC =diet -v -Os gcc CFLAGS =-nostdinc -Wall endif ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) STRIP =: nostrip endif DIR =$(shell pwd)/debian/checkpw build: deb-checkdir build-stamp build-stamp: for i in conf-*; do \ test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \ done echo '$(CC) $(CFLAGS)' >conf-cc echo '$(CC) $(LDFLAGS)' >conf-ld echo /usr >conf-home $(MAKE) touch build-stamp clean: deb-checkdir deb-checkuid rm -f `cat TARGETS` for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done rm -f build-stamp rm -rf '$(DIR)' '$(DIR)'-run rm -f debian/files debian/substvars changelog install: deb-checkdir deb-checkuid build-stamp rm -rf '$(DIR)' install -d -m0755 '$(DIR)'/usr/bin echo '$(DIR)'/usr >conf-home rm -f install instcheck auto_home.o auto_home.c $(MAKE) install instcheck ./install ./instcheck rm -f '$(DIR)'/usr/bin/loginlog rm -f '$(DIR)'/usr/bin/selectcheckpw chmod 0755 '$(DIR)'/usr/bin/* $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/* # man pages install -d -m0755 '$(DIR)'/usr/share/man/man8 install -m0644 debian/checkpw.8 debian/checkapoppw.8 \ '$(DIR)'/usr/share/man/man8/ gzip -9n '$(DIR)'/usr/share/man/man8/*.8 # service directories for i in pop apop; do \ install -d -m0755 '$(DIR)'/usr/share/doc/checkpw/etc/$$i/log && \ install -m0644 debian/$$i/run \ '$(DIR)'/usr/share/doc/checkpw/etc/$$i/run && \ install -m0644 debian/$$i/log/run \ '$(DIR)'/usr/share/doc/checkpw/etc/$$i/log/run || exit 1; \ done # upstream changelog test -r changelog || ln -s CHANGES changelog binary-indep: binary-arch: deb-checkdir deb-checkuid install checkpw.deb test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/* dpkg-gencontrol -isp -pcheckpw -P'$(DIR)' dpkg -b '$(DIR)' .. binary: binary-indep binary-arch .PHONY: build clean install binary-indep binary-arch binary include debian/implicit