bday
view Makefile @ 8:19c1ad697022
beautifing :-)
author | meillo@marmaro.de |
---|---|
date | Tue, 18 Dec 2007 14:56:05 +0100 |
parents | 5af6bf2cb271 |
children | 9bd926eb89fa |
line source
1 # bday by meillo@marmaro.de
4 NAME=bday
5 VERSION = 0.1
6 NV=${NAME}-${VERSION}
8 DOCS=COPYRIGHT ChangeLog TODO
10 # paths
11 PREFIX = /usr
12 BINDIR = ${PREFIX}/bin
13 MANDIR = ${PREFIX}/share/man
15 SRC=bday.c
16 OBJ=$(SRC:.c=.o)
18 CFLAGS=-O2 -Wall
20 all: build
22 build: ${NAME}
24 ${NAME}: $(OBJ)
25 $(CC) $(LDFLAGS) $(OBJ) -o $@
27 car: clean all
29 dist: build changelog
30 @mkdir -p ${NV}
31 @cp -f ${NAME} ${NAME}.1 Makefile ${DOCS} ${NV}
32 @tar -czhof ${NV}.tar.gz ${NV}
33 @rm -rf ${NV}
35 deb: dist
36 @mkdir -p Packages
37 @cp ${NV}.tar.gz Packages/
38 @( \
39 cd Packages/ ;\
40 tar -xzf ${NV}.tar.gz ;\
41 mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\
42 cd ${NV}/ ;\
43 cp -r ../../debian/ . ;\
44 debuild ;\
45 )
47 changelog:
48 @echo generating changelog from mercurial log
49 @hg log -v --style changelog > ChangeLog
51 install:
52 @echo installing executable file to ${DESTDIR}${BINDIR}
53 @mkdir -p ${DESTDIR}${BINDIR}
54 @cp ${NAME} ${DESTDIR}${BINDIR}
55 @chmod 755 ${DESTDIR}${BINDIR}/${NAME}
56 @echo installing manual page to ${DESTDIR}${MANDIR}/man1
57 @mkdir -p ${DESTDIR}${MANDIR}/man1
58 @sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1
59 @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1
61 uninstall:
62 @echo removing executable file from ${DESTDIR}${BINDIR}
63 @rm -f ${DESTDIR}${BINDIR}/${NAME}
64 @echo removing manual page from ${DESTDIR}${MANDIR}/man1
65 @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1
68 clean:
69 rm -f *.o
71 realclean: clean
72 rm -f ${NAME}
74 distclean: realclean
75 @rm -f ${NAME}-*.tar.gz ChangeLog
77 debclean: distclean
78 @cd Packages/${NV}/ ; debuild clean ;
81 .PHONY: all dist deb changelog clean distclean debclean build install uninstall