]> git.armaanb.net Git - stagit.git/blobdiff - Makefile
clean generated tarball too
[stagit.git] / Makefile
index 499b7078513a1df20c6f090f14187ca270730427..eb6e9e8d0b87fa0fdac9343100331c1be9085621 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,53 @@
 include config.mk
 
-NAME = urmoms
-VERSION = 0.1
+NAME = stagit
+VERSION = 0.3.1
 SRC = \
-       urmoms.c
+       stagit.c\
+       stagit-index.c
+COMPATSRC = \
+       reallocarray.c\
+       strlcat.c\
+       strlcpy.c
 BIN = \
-       urmoms
+       stagit\
+       stagit-index
 MAN1 = \
-       urmoms.1
+       stagit.1\
+       stagit-index.1
 DOC = \
        LICENSE\
        README\
        TODO
-HDR = 
+HDR = compat.h
 
-OBJ = ${SRC:.c=.o}
+COMPATOBJ = \
+       reallocarray.o\
+       strlcat.o\
+       strlcpy.o
+
+OBJ = ${SRC:.c=.o} ${COMPATOBJ}
 
 all: $(BIN)
 
+.o:
+       ${CC} ${LDFLAGS} -o $@ ${LIBS}
+
 .c.o:
-       ${CC} -c ${CFLAGS} $<
+       ${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
 
-dist: $(BIN)
-       rm -rf release/${VERSION}
-       mkdir -p release/${VERSION}
+dist:
+       rm -rf ${NAME}-${VERSION}
+       mkdir -p ${NAME}-${VERSION}
        cp -f ${MAN1} ${HDR} ${SCRIPTS} ${SRC} ${COMPATSRC} ${DOC} \
-               Makefile config.mk \
-               logo.png style.css \
-               release/${VERSION}/
+               Makefile config.def.h config.mk \
+               favicon.png logo.png style.css \
+               example.sh \
+               ${NAME}-${VERSION}
        # make tarball
-       rm -f urmoms-${VERSION}.tar.gz
-       (cd release/${VERSION}; \
-       tar -czf ../../urmoms-${VERSION}.tar.gz .)
+       tar -cf - ${NAME}-${VERSION} | \
+               gzip -c > ${NAME}-${VERSION}.tar.gz
+       rm -rf ${NAME}-${VERSION}
 
 ${OBJ}: config.h config.mk ${HDR}
 
@@ -39,11 +55,14 @@ config.h:
        @echo creating $@ from config.def.h
        @cp config.def.h $@
 
-urmoms: urmoms.o
-       ${CC} -o $@ urmoms.o ${LDFLAGS}
+stagit: stagit.o ${COMPATOBJ}
+       ${CC} -o $@ stagit.o ${COMPATOBJ} ${LDFLAGS}
+
+stagit-index: stagit-index.o ${COMPATOBJ}
+       ${CC} -o $@ stagit-index.o ${COMPATOBJ} ${LDFLAGS}
 
 clean:
-       rm -f ${BIN} ${OBJ}
+       rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
 
 install: all
        # installing executable files.
@@ -53,7 +72,9 @@ install: all
        # installing example files.
        mkdir -p ${DESTDIR}${PREFIX}/share/${NAME}
        cp -f style.css\
+               favicon.png\
                logo.png\
+               example.sh\
                README\
                ${DESTDIR}${PREFIX}/share/${NAME}
        # installing manual pages.
@@ -67,7 +88,9 @@ uninstall:
        # removing example files.
        rm -f \
                ${DESTDIR}${PREFIX}/share/${NAME}/style.css\
+               ${DESTDIR}${PREFIX}/share/${NAME}/favicon.png\
                ${DESTDIR}${PREFIX}/share/${NAME}/logo.png\
+               ${DESTDIR}${PREFIX}/share/${NAME}/example.sh\
                ${DESTDIR}${PREFIX}/share/${NAME}/README
        -rmdir ${DESTDIR}${PREFIX}/share/${NAME}
        # removing manual pages.