stagit

static git page generator  https://git.ce9e.org
git clone https://git.ce9e.org/stagit.git

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    -1 
    3    -1 NAME = stagit
    4    -1 VERSION = 0.9.3
    5    -1 
    6    -1 # paths
    7     1 PREFIX = /usr/local
    8    -1 MANPREFIX = ${PREFIX}/man
    9    -1 DOCPREFIX = ${PREFIX}/share/doc/${NAME}
   10    -1 
   11    -1 LIBGIT_INC = -I/usr/local/include
   12    -1 LIBGIT_LIB = -L/usr/local/lib -lgit2
   13    -1 
   14    -1 CMARKLIBS = -lcmark
   15    -1 CMARKFLAGS = -DCMARK
   16    -1 
   17    -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    -1 
   22    -1 SRC = \
   23    -1 	stagit.c
   24    -1 COMPATSRC = \
   25    -1 	strlcpy.c
   26    -1 BIN = \
   27    -1 	stagit
   28    -1 MAN1 = \
   29    -1 	stagit.1
   30    -1 DOC = \
   31    -1 	LICENSE\
   32    -1 	README
   33    -1 HDR = compat.h config.h
   34    -1 
   35    -1 COMPATOBJ = \
   36    -1 	strlcpy.o
   37    -1 
   38    -1 %.c: %.c.in ctpl.py
   39    -1 	python ctpl.py $< > $@
   40    -1 
   41    -1 OBJ = ${SRC:.c=.o} ${COMPATOBJ}
   42    -1 
   43    -1 all: ${BIN}
   44    -1 
   45    -1 .o:
   46    -1 	${CC} -o $@ ${LDFLAGS}
   47    -1 
   48    -1 .c.o:
   49    -1 	${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}
   50    -1 
   51    -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 tarball
   59    -1 	tar -cf - ${NAME}-${VERSION} | \
   60    -1 		gzip -c > ${NAME}-${VERSION}.tar.gz
   61    -1 	rm -rf ${NAME}-${VERSION}
   62    -1 
   63    -1 ${OBJ}: ${HDR}
   64    -1 
   65    -1 stagit: stagit.o ${COMPATOBJ}
   66    -1 	${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
   67     2 
   68    -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     7 
   71    -1 install: all
   72    -1 	# installing executable files.
   73    -1 	mkdir -p ${DESTDIR}${PREFIX}/bin
   74    -1 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
   75    -1 	for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
   76    -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}/man1
   87    -1 	cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
   88    -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    10 
   90    -1 uninstall:
   91    -1 	# removing executable files.
   92    -1 	for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
   93    -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}/README
  101    -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    13 
  105    -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 strlcpy
    2    -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    20 
   21    -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    21 
   22    -1 #include "compat.h"
   23    -1 
   24    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).