Mercurial > baum
annotate Makefile @ 62:80df58d240b2 default tip
merge
author | meillo@marmaro.de |
---|---|
date | Thu, 13 Nov 2008 13:19:42 +0100 |
parents | f5f06d6f62b3 |
children |
rev | line source |
---|---|
20 | 1 # baum by meillo@marmaro.de |
2 | |
3 | |
4 NAME=baum | |
28
ed3eb4b497e5
version in Makefile is extracted from sources now
meillo@marmaro.de
parents:
24
diff
changeset
|
5 # extracts VERSION from the sources |
ed3eb4b497e5
version in Makefile is extracted from sources now
meillo@marmaro.de
parents:
24
diff
changeset
|
6 VERSION=$(shell cat *.c | sed -n '/define VERSION/ s/.*"\([^"]*\)".*/\1/p' ) |
20 | 7 NV=${NAME}-${VERSION} |
0 | 8 |
20 | 9 DOCS=LICENSE README ChangeLog TODO examples |
10 | |
11 # paths | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
12 PREFIX = /usr/local |
20 | 13 BINDIR = ${PREFIX}/bin |
14 MANDIR = ${PREFIX}/share/man | |
0 | 15 |
16 # compile env | |
17 CC = gcc | |
18 LD = ${CC} | |
19 DEBUG = -g | |
20 CFLAGS = -Wall -c ${DEBUG} | |
20 | 21 LDFLAGS = -Wall ${DEBUG} |
0 | 22 |
20 | 23 # files |
24 SRC=baum.c actions.c | |
25 OBJ=$(SRC:.c=.o) | |
47
c31b5bb6d493
merged header files into only one (removed actions.h)
meillo@marmaro.de
parents:
45
diff
changeset
|
26 DEP = baum.h |
0 | 27 |
20 | 28 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
29 .PHONY: all |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
30 all: options $(NAME) |
20 | 31 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
32 .PHONY: options |
0 | 33 options: |
34 @echo build options: | |
35 @echo "CC = ${CC}" | |
36 @echo "LD = ${LD}" | |
37 @echo "CFLAGS = ${CFLAGS}" | |
20 | 38 @echo "LDFLAGS = ${LDFLAGS}" |
0 | 39 @echo |
40 | |
20 | 41 |
42 ${NAME}: $(OBJ) ${DEP} | |
43 $(CC) $(LDFLAGS) $(OBJ) -o $@ | |
0 | 44 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
45 |
0 | 46 ${OBJ}: ${DEP} |
47 | |
48 | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
49 .PHONY: strip |
20 | 50 strip: ${NAME} |
51 @echo stripping ${NAME} | |
52 @strip ${NAME} | |
53 | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
54 |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
55 .PHONY: dist |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
56 dist: all changelog |
20 | 57 @echo "generating tarball" |
58 @mkdir -p ${NV} | |
29
88a51653db83
removed binary from dist tarball; new debian package
meillo@marmaro.de
parents:
28
diff
changeset
|
59 @cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV} |
45
0b82169d4129
using fakeroot for creating the tarball; removed executable bit from some files
meillo@marmaro.de
parents:
29
diff
changeset
|
60 @fakeroot tar -czhof ${NV}.tar.gz ${NV} |
20 | 61 @rm -rf ${NV} |
0 | 62 |
20 | 63 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
64 .PHONY: changelog |
20 | 65 changelog: |
66 @echo generating changelog from mercurial log | |
67 @hg log -v --style changelog > ChangeLog | |
0 | 68 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
69 |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
70 .PHONY: install |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
71 install: all strip |
20 | 72 @echo installing executable file to ${DESTDIR}${BINDIR} |
73 @mkdir -p ${DESTDIR}${BINDIR} | |
74 @cp ${NAME} ${DESTDIR}${BINDIR} | |
75 @chmod 755 ${DESTDIR}${BINDIR}/${NAME} | |
76 @echo installing manual page to ${DESTDIR}${MANDIR}/man1 | |
77 @mkdir -p ${DESTDIR}${MANDIR}/man1 | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
78 @cp ${NAME}.1 ${DESTDIR}${MANDIR}/man1 |
20 | 79 @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1 |
80 | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
81 |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
82 .PHONY: uninstall |
20 | 83 uninstall: |
84 @echo removing executable file from ${DESTDIR}${BINDIR} | |
85 @rm -f ${DESTDIR}${BINDIR}/${NAME} | |
86 @echo removing manual page from ${DESTDIR}${MANDIR}/man1 | |
87 @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1 | |
88 | |
0 | 89 |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
90 .PHONY: clean |
0 | 91 clean: |
20 | 92 rm -f *.o |
93 | |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
94 |
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
95 .PHONY: realclean |
20 | 96 realclean: clean |
58
f5f06d6f62b3
made Makefile much simpler (installs now to /usr/local)
meillo@marmaro.de
parents:
47
diff
changeset
|
97 rm -f ${NAME} ChangeLog |