baum
annotate Makefile @ 24:69a7cf2f0c06
make dist includes now a stripped executable (should we include the exe at all?)
author | meillo@marmaro.de |
---|---|
date | Wed, 13 Feb 2008 22:04:12 +0100 |
parents | ca56c1b3fb67 |
children | ed3eb4b497e5 |
rev | line source |
---|---|
meillo@20 | 1 # baum by meillo@marmaro.de |
meillo@0 | 2 |
meillo@20 | 3 |
meillo@20 | 4 NAME=baum |
meillo@20 | 5 VERSION = 0.1 |
meillo@20 | 6 NV=${NAME}-${VERSION} |
meillo@20 | 7 |
meillo@20 | 8 DOCS=LICENSE README ChangeLog TODO examples |
meillo@20 | 9 |
meillo@20 | 10 # paths |
meillo@20 | 11 PREFIX = /usr |
meillo@20 | 12 BINDIR = ${PREFIX}/bin |
meillo@20 | 13 MANDIR = ${PREFIX}/share/man |
meillo@0 | 14 |
meillo@0 | 15 # compile env |
meillo@0 | 16 CC = gcc |
meillo@0 | 17 LD = ${CC} |
meillo@0 | 18 DEBUG = -g |
meillo@0 | 19 CFLAGS = -Wall -c ${DEBUG} |
meillo@20 | 20 LDFLAGS = -Wall ${DEBUG} |
meillo@0 | 21 |
meillo@20 | 22 # files |
meillo@20 | 23 SRC=baum.c actions.c |
meillo@20 | 24 OBJ=$(SRC:.c=.o) |
meillo@20 | 25 DEP = baum.h actions.h |
meillo@0 | 26 |
meillo@20 | 27 |
meillo@20 | 28 |
meillo@20 | 29 all: options build |
meillo@0 | 30 |
meillo@0 | 31 options: |
meillo@0 | 32 @echo build options: |
meillo@0 | 33 @echo "CC = ${CC}" |
meillo@0 | 34 @echo "LD = ${LD}" |
meillo@0 | 35 @echo "CFLAGS = ${CFLAGS}" |
meillo@20 | 36 @echo "LDFLAGS = ${LDFLAGS}" |
meillo@0 | 37 @echo |
meillo@0 | 38 |
meillo@20 | 39 build: ${NAME} |
meillo@20 | 40 |
meillo@20 | 41 ${NAME}: $(OBJ) ${DEP} |
meillo@20 | 42 $(CC) $(LDFLAGS) $(OBJ) -o $@ |
meillo@0 | 43 |
meillo@0 | 44 ${OBJ}: ${DEP} |
meillo@0 | 45 |
meillo@20 | 46 car: clean all |
meillo@0 | 47 |
meillo@0 | 48 debug: all |
meillo@20 | 49 gdb ${NAME} |
meillo@0 | 50 |
meillo@20 | 51 strip: ${NAME} |
meillo@20 | 52 @echo stripping ${NAME} |
meillo@20 | 53 @strip ${NAME} |
meillo@0 | 54 |
meillo@24 | 55 dist: build changelog strip |
meillo@20 | 56 @echo "generating tarball" |
meillo@20 | 57 @mkdir -p ${NV} |
meillo@21 | 58 @cp -rf ${NAME} ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV} |
meillo@20 | 59 @tar -czhof ${NV}.tar.gz ${NV} |
meillo@20 | 60 @rm -rf ${NV} |
meillo@20 | 61 |
meillo@20 | 62 deb: dist |
meillo@20 | 63 @mkdir -p Packages |
meillo@20 | 64 @cp ${NV}.tar.gz Packages/ |
meillo@20 | 65 @( \ |
meillo@20 | 66 cd Packages/ ;\ |
meillo@20 | 67 tar -xzf ${NV}.tar.gz ;\ |
meillo@20 | 68 mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\ |
meillo@20 | 69 cd ${NV}/ ;\ |
meillo@20 | 70 cp -r ../../debian/ . ;\ |
meillo@20 | 71 debuild ;\ |
meillo@20 | 72 ) |
meillo@20 | 73 @rm -rf Packages/${NV} |
meillo@20 | 74 |
meillo@20 | 75 changelog: |
meillo@20 | 76 @echo generating changelog from mercurial log |
meillo@20 | 77 @hg log -v --style changelog > ChangeLog |
meillo@20 | 78 |
meillo@24 | 79 install: build strip |
meillo@20 | 80 @echo installing executable file to ${DESTDIR}${BINDIR} |
meillo@20 | 81 @mkdir -p ${DESTDIR}${BINDIR} |
meillo@20 | 82 @cp ${NAME} ${DESTDIR}${BINDIR} |
meillo@20 | 83 @chmod 755 ${DESTDIR}${BINDIR}/${NAME} |
meillo@20 | 84 @echo installing manual page to ${DESTDIR}${MANDIR}/man1 |
meillo@20 | 85 @mkdir -p ${DESTDIR}${MANDIR}/man1 |
meillo@20 | 86 @sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1 |
meillo@20 | 87 @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1 |
meillo@20 | 88 |
meillo@20 | 89 uninstall: |
meillo@20 | 90 @echo removing executable file from ${DESTDIR}${BINDIR} |
meillo@20 | 91 @rm -f ${DESTDIR}${BINDIR}/${NAME} |
meillo@20 | 92 @echo removing manual page from ${DESTDIR}${MANDIR}/man1 |
meillo@20 | 93 @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1 |
meillo@20 | 94 |
meillo@0 | 95 |
meillo@0 | 96 clean: |
meillo@20 | 97 rm -f *.o |
meillo@0 | 98 |
meillo@20 | 99 realclean: clean |
meillo@20 | 100 rm -f ${NAME} |
meillo@20 | 101 |
meillo@20 | 102 distclean: realclean |
meillo@20 | 103 @rm -f ${NAME}-*.tar.gz ChangeLog |
meillo@20 | 104 |
meillo@20 | 105 debclean: distclean |
meillo@20 | 106 @cd Packages/${NV}/ ; debuild clean ; |
meillo@20 | 107 |
meillo@20 | 108 |
meillo@20 | 109 .PHONY: all dist deb changelog clean distclean debclean build install uninstall |