- commit
- f21c2ad3aee266eb27bd7b1b428f7c7f40320b2b
- parent
- cd7e5bb9837892ba3896625d55347f37e95d6838
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-03-27 05:34
simplify Makefile
Diffstat
M | Makefile | 110 | ++++++------------------------------------------------------- |
D | src/compat.h | 2 | -- |
M | src/stagit.c.in | 2 | +- |
M | src/strlcpy.c | 2 | -- |
4 files changed, 11 insertions, 105 deletions
diff --git a/Makefile b/Makefile
@@ -1,105 +1,15 @@1 -1 .POSIX:2 -13 -1 NAME = stagit4 -1 VERSION = 0.9.35 -16 -1 # paths7 1 PREFIX = /usr/local8 -1 MANPREFIX = ${PREFIX}/man9 -1 DOCPREFIX = ${PREFIX}/share/doc/${NAME}10 -111 -1 LIBGIT_INC = -I/usr/local/include12 -1 LIBGIT_LIB = -L/usr/local/lib -lgit213 -114 -1 CMARKLIBS = -lcmark15 -1 CMARKFLAGS = -DCMARK16 -117 -1 # use system flags.18 -1 STAGIT_CFLAGS = ${LIBGIT_INC} ${CFLAGS}19 -1 STAGIT_LDFLAGS = ${LIBGIT_LIB} ${CMARKLIBS} ${LDFLAGS}20 -1 STAGIT_CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${CMARKFLAGS}21 -122 -1 SRC = \23 -1 stagit.c24 -1 COMPATSRC = \25 -1 strlcpy.c26 -1 BIN = \27 -1 stagit28 -1 MAN1 = \29 -1 stagit.130 -1 DOC = \31 -1 LICENSE\32 -1 README33 -1 HDR = compat.h config.h34 -135 -1 COMPATOBJ = \36 -1 strlcpy.o37 -138 -1 %.c: %.c.in ctpl.py39 -1 python ctpl.py $< > $@40 -141 -1 OBJ = ${SRC:.c=.o} ${COMPATOBJ}42 -143 -1 all: ${BIN}44 -145 -1 .o:46 -1 ${CC} -o $@ ${LDFLAGS}47 -148 -1 .c.o:49 -1 ${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}50 -151 -1 dist:52 -1 rm -rf ${NAME}-${VERSION}53 -1 mkdir -p ${NAME}-${VERSION}54 -1 cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \55 -1 Makefile favicon.png logo.png style.css \56 -1 example_create.sh example_post-receive.sh \57 -1 ${NAME}-${VERSION}58 -1 # make tarball59 -1 tar -cf - ${NAME}-${VERSION} | \60 -1 gzip -c > ${NAME}-${VERSION}.tar.gz61 -1 rm -rf ${NAME}-${VERSION}62 -163 -1 ${OBJ}: ${HDR}64 -165 -1 stagit: stagit.o ${COMPATOBJ}66 -1 ${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS}67 268 -1 clean:69 -1 rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz stagit.c-1 3 INCS = -I/usr/local/include -1 4 CPPFLAGS = -D_XOPEN_SOURCE=700 -DCMARK -1 5 CFLAGS = -std=c99 -pedantic -Wall ${INCS} ${CPPFLAGS} -1 6 LDFLAGS = -L/usr/local/lib -lgit2 -lcmark 70 771 -1 install: all72 -1 # installing executable files.73 -1 mkdir -p ${DESTDIR}${PREFIX}/bin74 -1 cp -f ${BIN} ${DESTDIR}${PREFIX}/bin75 -1 for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done76 -1 # installing example files.77 -1 mkdir -p ${DESTDIR}${DOCPREFIX}78 -1 cp -f style.css\79 -1 favicon.png\80 -1 logo.png\81 -1 example_create.sh\82 -1 example_post-receive.sh\83 -1 README\84 -1 ${DESTDIR}${DOCPREFIX}85 -1 # installing manual pages.86 -1 mkdir -p ${DESTDIR}${MANPREFIX}/man187 -1 cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man188 -1 for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done-1 8 stagit: src/stagit.o -1 9 ${CC} -o $@ $< ${LDFLAGS} 89 1090 -1 uninstall:91 -1 # removing executable files.92 -1 for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done93 -1 # removing example files.94 -1 rm -f \95 -1 ${DESTDIR}${DOCPREFIX}/style.css\96 -1 ${DESTDIR}${DOCPREFIX}/favicon.png\97 -1 ${DESTDIR}${DOCPREFIX}/logo.png\98 -1 ${DESTDIR}${DOCPREFIX}/example_create.sh\99 -1 ${DESTDIR}${DOCPREFIX}/example_post-receive.sh\100 -1 ${DESTDIR}${DOCPREFIX}/README101 -1 -rmdir ${DESTDIR}${DOCPREFIX}102 -1 # removing manual pages.103 -1 for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done-1 11 src/stagit.o: src/stagit.c src/strlcpy.c src/config.h -1 12 ${CC} -o $@ -c $< ${CFLAGS} 104 13105 -1 .PHONY: all clean dist install uninstall-1 14 %.c: %.c.in src/ctpl.py -1 15 python3 src/ctpl.py $< > $@
diff --git a/src/compat.h b/src/compat.h
@@ -1,2 +0,0 @@1 -1 #undef strlcpy2 -1 size_t strlcpy(char *, const char *, size_t);
diff --git a/src/stagit.c.in b/src/stagit.c.in
@@ -18,8 +18,8 @@ 18 18 #include <cmark.h> 19 19 #endif 20 2021 -1 #include "compat.h"22 21 #include "config.h" -1 22 #include "strlcpy.c" 23 23 24 24 #define T(S) (fputs((S), fp)) 25 25
diff --git a/src/strlcpy.c b/src/strlcpy.c
@@ -19,8 +19,6 @@ 19 19 #include <sys/types.h> 20 20 #include <string.h> 21 2122 -1 #include "compat.h"23 -124 22 /* 25 23 * Copy string src to buffer dst of size dsize. At most dsize-1 26 24 * chars will be copied. Always NUL terminates (unless dsize == 0).