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 71 72 73 74 75
|
#! /usr/bin/make -f
#
CC = gcc
CFLAGS = -O2 -g -Wall
LDFLAGS =
SHELL = /bin/sh
srcdir = .
INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL) -m 755 -o root -g root
INSTALL_DATA = $(INSTALL) -m 644 -o root -g root
INSTALL_DIR = $(INSTALL) -d -m 755 -o root -g root
config:
$(checkdir)
touch stamp-config
build:
$(checkdir)
test -f stamp-config || make -f debian/rules config
$(CC) $(CFLAGS) -o mimedecode mimedecode.c
touch stamp-build
clean:
$(checkdir)
test -f stamp-config || make -f debian/rules config
-rm mimedecode *.o
-rm -f stamp-config stamp-build
-rm -rf debian/tmp* debian/files debian/substvars
binary-indep: checkroot
$(checkdir)
binary-arch: checkroot
$(checkdir)
-rm -rf debian/tmp*
test -f stamp-build || make -f debian/rules build
#
#
# debian/tmp
$(INSTALL_DIR) debian/tmp
$(INSTALL_DIR) debian/tmp/DEBIAN
# binaries
$(INSTALL_DIR) debian/tmp/usr/bin
$(INSTALL_PROGRAM) -s mimedecode debian/tmp/usr/bin
# documentation
$(INSTALL_DIR) debian/tmp/usr/doc/mimedecode
$(INSTALL_DIR) debian/tmp/usr/man/man1
$(INSTALL_DATA) debian/copyright debian/tmp/usr/doc/mimedecode
$(INSTALL_DATA) debian/changelog \
debian/tmp/usr/doc/mimedecode/changelog.Debian
$(INSTALL_DATA) debian/mimedecode.1 debian/tmp/usr/man/man1/mimedecode.1
gzip -9 debian/tmp/usr/man/man1/mimedecode.1
gzip -9 debian/tmp/usr/doc/mimedecode/changelog.Debian
#
$(INSTALL_DATA) debian/README \
debian/tmp/usr/doc/mimedecode/README.debian
#
dpkg-shlibdeps mimedecode
dpkg-gencontrol -isp -pmimedecode -Pdebian/tmp
dpkg --build debian/tmp ..
define checkdir
test -f mimedecode.c -a -f debian/rules
endef
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: config build clean binary binary-arch binary-indep
|