stagit

git site generator
Contents

Makefile improvements

- remove double -c in .c.o target.
- remove config.mk abstraction.
- change LIBS and INCS to LIBGIT_INC and LIBGIT_LIB.
- use system cflags and ldflags, but allow the same override rules for porters.

Hiltjo Posthuma hiltjo@codemadness.org

commit: 9b4be48 parent: 26fb76e
2 files changed, 20 insertions(+), 37 deletions(-)
MMakefile+20-7
Dconfig.mk+0-30
M · Makefile +20, -7
 1@@ -1,8 +1,21 @@
 2-include config.mk
 3+.POSIX:
 4
 5 NAME = stagit
 6 VERSION = 0.9.2
 7
 8+# paths
 9+PREFIX = /usr/local
10+MANPREFIX =
${PREFIX}/man
11+DOCPREFIX =
${PREFIX}/share/doc/${NAME}
12+
13+LIBGIT_INC =
-I/usr/local/include
14+LIBGIT_LIB =
-L/usr/local/lib -lgit2
15+
16+# use system flags.
17+STAGIT_CFLAGS =
${LIBGIT_INC} ${CFLAGS}
18+STAGIT_LDFLAGS =
${LIBGIT_LIB} ${LDFLAGS}
19+STAGIT_CPPFLAGS =
-D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE
20+
21 SRC = \
22 stagit.c\
23 stagit-index.c
24@@ -31,16 +44,16 @@ OBJ = ${SRC:.c=.o} ${COMPATOBJ}
25 all: ${BIN}
26
27 .o:
28- ${CC} ${LDFLAGS} -o $@ ${LIBS}
29+ ${CC} -o $@
${LDFLAGS}
30
31 .c.o:
32- ${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
33+ ${CC} -o $@ -c
$< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}
34
35 dist:
36 rm -rf
${NAME}-${VERSION}
37 mkdir -p
${NAME}-${VERSION}
38 cp -f ${MAN1}
${HDR} ${SRC} ${COMPATSRC} ${DOC} \
39- Makefile config.mk favicon.png logo.png style.css \
40+ Makefile favicon.png
logo.png style.css \
41 example_create.sh example_post-receive.sh \
42
${NAME}-${VERSION}
43 # make tarball
44@@ -48,13 +61,13 @@ dist:
45 gzip -c > ${NAME}-${VERSION}.tar.gz
46 rm -rf
${NAME}-${VERSION}
47
48-${OBJ}: config.mk ${HDR}
49+${OBJ}: ${HDR}
50
51 stagit: stagit.o
${COMPATOBJ}
52- ${CC} -o $@ stagit.o ${COMPATOBJ} ${LDFLAGS}
53+ ${CC} -o $@ stagit.o
${COMPATOBJ} ${STAGIT_LDFLAGS}
54
55 stagit-index:
stagit-index.o ${COMPATOBJ}
56- ${CC} -o $@ stagit-index.o ${COMPATOBJ} ${LDFLAGS}
57+ ${CC} -o $@
stagit-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
58
59 clean:
60 rm -f ${BIN}
${OBJ} ${NAME}-${VERSION}.tar.gz
D · config.mk +0, -30
 1@@ -1,30 +0,0 @@
 2-# customize below to
fit your system
 3-
 4-# paths
 5-PREFIX = /usr/local
 6-MANPREFIX =
${PREFIX}/man
 7-DOCPREFIX =
${PREFIX}/share/doc/stagit
 8-
 9-# compiler and linker
10-#CC = cc
11-
12-GITINC =
/usr/local/include
13-GITLIB =
/usr/local/lib
14-
15-# includes and libs
16-INCS = -I${GITINC}
17-LIBS = -L${GITLIB}
-lgit2
18-
19-# debug
20-#CFLAGS =
-fstack-protector-all -O0 -g -std=c99 -Wall -Wextra -pedantic ${INCS}
21-#LDFLAGS = ${LIBS}
22-
23-# optimized
24-CFLAGS = -O2 -std=c99
${INCS}
25-LDFLAGS = -s ${LIBS}
26-
27-# optimized static
28-#CFLAGS = -static -O2
-std=c99 ${INCS}
29-#LDFLAGS = -static -s
${LIBS}
30-
31-CPPFLAGS =
-D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS}