stagit

Personal stagit fork
git clone git://git.alexwennerberg.com/stagit
Log | Files | Refs | README | LICENSE

Makefile (2515B) - raw


      1 .POSIX:
      2 
      3 NAME = stagit
      4 VERSION = 1.1
      5 
      6 # paths
      7 PREFIX = /usr/local
      8 MANPREFIX = ${PREFIX}/man
      9 DOCPREFIX = ${PREFIX}/share/doc/${NAME}
     10 
     11 LIBGIT_INC = -I/usr/local/include
     12 LIBGIT_LIB = -L/usr/local/lib -lgit2
     13 
     14 CMARK_LIB = -L/usr/local/lib -lcmark
     15 
     16 # use system flags.
     17 STAGIT_CFLAGS = ${LIBGIT_INC} ${CFLAGS}
     18 STAGIT_LDFLAGS = ${LIBGIT_LIB} ${CMARK_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 COMPATSRC = \
     25 	reallocarray.c\
     26 	strlcat.c\
     27 	strlcpy.c
     28 BIN = \
     29 	stagit\
     30 	stagit-index
     31 MAN1 = \
     32 	stagit.1\
     33 	stagit-index.1
     34 DOC = \
     35 	LICENSE\
     36 	README.md
     37 HDR = compat.h
     38 
     39 COMPATOBJ = \
     40 	reallocarray.o\
     41 	strlcat.o\
     42 	strlcpy.o
     43 
     44 OBJ = ${SRC:.c=.o} ${COMPATOBJ}
     45 
     46 all: ${BIN}
     47 
     48 .o:
     49 	${CC} -o $@ ${LDFLAGS}
     50 
     51 .c.o:
     52 	${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}
     53 
     54 dist:
     55 	rm -rf ${NAME}-${VERSION}
     56 	mkdir -p ${NAME}-${VERSION}
     57 	cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \
     58 		Makefile favicon.png logo.png style.css \
     59 		example_create.sh example_post-receive.sh \
     60 		${NAME}-${VERSION}
     61 	# make tarball
     62 	tar -cf - ${NAME}-${VERSION} | \
     63 		gzip -c > ${NAME}-${VERSION}.tar.gz
     64 	rm -rf ${NAME}-${VERSION}
     65 
     66 ${OBJ}: ${HDR}
     67 
     68 stagit: stagit.o ${COMPATOBJ}
     69 	${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
     70 
     71 stagit-index: stagit-index.o ${COMPATOBJ}
     72 	${CC} -o $@ stagit-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
     73 
     74 clean:
     75 	rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
     76 
     77 install: all
     78 	# installing executable files.
     79 	mkdir -p ${DESTDIR}${PREFIX}/bin
     80 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
     81 	for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
     82 	# installing example files.
     83 	mkdir -p ${DESTDIR}${DOCPREFIX}
     84 	cp -f style.css\
     85 		favicon.png\
     86 		logo.png\
     87 		example_create.sh\
     88 		example_post-receive.sh\
     89 		README.md\
     90 		${DESTDIR}${DOCPREFIX}
     91 	# installing manual pages.
     92 	mkdir -p ${DESTDIR}${MANPREFIX}/man1
     93 	cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
     94 	for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
     95 
     96 uninstall:
     97 	# removing executable files.
     98 	for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
     99 	# removing example files.
    100 	rm -f \
    101 		${DESTDIR}${DOCPREFIX}/style.css\
    102 		${DESTDIR}${DOCPREFIX}/favicon.png\
    103 		${DESTDIR}${DOCPREFIX}/logo.png\
    104 		${DESTDIR}${DOCPREFIX}/example_create.sh\
    105 		${DESTDIR}${DOCPREFIX}/example_post-receive.sh\
    106 		${DESTDIR}${DOCPREFIX}/README.md
    107 	-rmdir ${DESTDIR}${DOCPREFIX}
    108 	# removing manual pages.
    109 	for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
    110 
    111 .PHONY: all clean dist install uninstall