1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#!/usr/bin/make -f
CFLAGS =-O2 -Wall -D_GNU_SOURCE
STRIP =strip
CC =gcc
BGLIBS =/usr/lib/bglibs
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS +=-g
endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
STRIP =: nostrip
endif
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
CC =diet -v -Os gcc -nostdinc
BGLIBS =/usr/lib/diet/bglibs
endif
DIR =$(shell pwd)/debian/ucspi-unix
build: deb-checkdir build-stamp
build-stamp:
test -e conf-bin'{orig}' || cp conf-bin conf-bin'{orig}'
echo '/usr/bin' >conf-bin
test -e conf-man'{orig}' || cp conf-man conf-man'{orig}'
echo '/usr/share/man' >conf-man
test -e conf-cc'{orig}' || cp conf-cc conf-cc'{orig}'
echo '$(CC) $(CFLAGS) -I$(BGLIBS)/include' >conf-cc
test -e conf-ld'{orig}' || cp conf-ld conf-ld'{orig}'
echo '$(CC) -L$(BGLIBS)/lib' >conf-ld
$(MAKE)
rm -f installer instcheck instshow insthier.o conf_bin.c conf_man.c
echo '$(DIR)/usr/bin' >conf-bin
echo '$(DIR)/usr/share/man' >conf-man
$(MAKE) installer instcheck instshow
mv -f conf-ld'{orig}' conf-ld
mv -f conf-cc'{orig}' conf-cc
mv -f conf-man'{orig}' conf-man
mv -f conf-bin'{orig}' conf-bin
touch build-stamp
clean: deb-checkdir deb-checkuid
$(MAKE) clean
rm -f build-stamp
rm -rf '$(DIR)'
rm -f debian/files debian/substvars changelog
install: deb-checkdir deb-checkuid build-stamp
rm -rf '$(DIR)'
install -d -m0755 '$(DIR)'/usr/bin
install -d -m0755 '$(DIR)'/usr/share/man
./installer; ./instcheck
$(STRIP) -R .comment -R .note \
'$(DIR)'/usr/bin/unixserver '$(DIR)'/usr/bin/unixclient
install -m0644 debian/unixcat.1 '$(DIR)'/usr/share/man/man1/
gzip -9 '$(DIR)'/usr/share/man/man?/*.?
rm -f changelog && ln -s NEWS changelog
binary-indep:
binary-arch: deb-checkdir deb-checkuid install ucspi-unix.deb
test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/*
dpkg-gencontrol -isp -pucspi-unix -P'$(DIR)'
dpkg -b '$(DIR)' ..
binary: binary-indep binary-arch
.PHONY: build clean install binary-indep binary-arch binary
include debian/implicit
|