stagit

Custom stagit fork for git.deurzen.net
git clone git://git.deurzen.net/stagit
Log | Files | Refs | README | LICENSE

Makefile (2267B)


      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 # use system flags.
     15 STAGIT_CFLAGS = ${LIBGIT_INC} ${CFLAGS}
     16 STAGIT_LDFLAGS = ${LIBGIT_LIB} ${LDFLAGS}
     17 STAGIT_CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE
     18 
     19 SRC = \
     20 	stagit.c\
     21 	stagit-index.c
     22 COMPATSRC = \
     23 	reallocarray.c\
     24 	strlcat.c\
     25 	strlcpy.c
     26 BIN = \
     27 	stagit\
     28 	stagit-index
     29 MAN1 = \
     30 	stagit.1\
     31 	stagit-index.1
     32 DOC = \
     33 	LICENSE\
     34 	README
     35 HDR = compat.h
     36 
     37 COMPATOBJ = \
     38 	reallocarray.o\
     39 	strlcat.o\
     40 	strlcpy.o
     41 
     42 OBJ = ${SRC:.c=.o} ${COMPATOBJ}
     43 
     44 all: ${BIN}
     45 
     46 .o:
     47 	${CC} -o $@ ${LDFLAGS}
     48 
     49 .c.o:
     50 	${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}
     51 
     52 dist:
     53 	rm -rf ${NAME}-${VERSION}
     54 	mkdir -p ${NAME}-${VERSION}
     55 	cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \
     56 		Makefile favicon.png logo.png style.css \
     57 		${NAME}-${VERSION}
     58 	# make tarball
     59 	tar -cf - ${NAME}-${VERSION} | \
     60 		gzip -c > ${NAME}-${VERSION}.tar.gz
     61 	rm -rf ${NAME}-${VERSION}
     62 
     63 ${OBJ}: ${HDR}
     64 
     65 stagit: stagit.o ${COMPATOBJ}
     66 	${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
     67 
     68 stagit-index: stagit-index.o ${COMPATOBJ}
     69 	${CC} -o $@ stagit-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
     70 
     71 clean:
     72 	rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
     73 
     74 install: all
     75 	# installing executable files.
     76 	mkdir -p ${DESTDIR}${PREFIX}/bin
     77 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
     78 	for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
     79 	# installing example files.
     80 	mkdir -p ${DESTDIR}${DOCPREFIX}
     81 	cp -f style.css\
     82 		favicon.png\
     83 		logo.png\
     84 		README\
     85 		${DESTDIR}${DOCPREFIX}
     86 	# installing manual pages.
     87 	mkdir -p ${DESTDIR}${MANPREFIX}/man1
     88 	cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
     89 	for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
     90 
     91 uninstall:
     92 	# removing executable files.
     93 	for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
     94 	# removing example files.
     95 	rm -f \
     96 		${DESTDIR}${DOCPREFIX}/style.css\
     97 		${DESTDIR}${DOCPREFIX}/favicon.png\
     98 		${DESTDIR}${DOCPREFIX}/logo.png\
     99 		${DESTDIR}${DOCPREFIX}/README
    100 	-rmdir ${DESTDIR}${DOCPREFIX}
    101 	# removing manual pages.
    102 	for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
    103 
    104 .PHONY: all clean dist install uninstall