Makefile (886B)
1 # This work is in the public domain. See COPYING file for details. 2 .POSIX: 3 4 include config.mk 5 6 BIN = index.cgi 7 INC = thread.h util.h http.h 8 SRC = main.c thread.c util.c pdjson/pdjson.c 9 DEP = header.html footer.html thread.html style.css music.svg 10 11 all: ${BIN} 12 13 ${BIN}: ${SRC} ${INC} 14 ${CC} ${CFLAGS} -o $@ ${SRC} 15 16 test: ${BIN} 17 REQUEST_URI='/' valgrind --leak-check=full --show-leak-kinds=all ./index.cgi 18 19 clean: 20 rm -f ${BIN} 21 22 install: ${BIN} ${DEP} 23 mkdir -p ${INSTALL_DIR}/threads 24 mkdir -p ${INSTALL_DIR}/tmp 25 chown -R ${HTTPD_USER}:${HTTPD_GROUP} ${INSTALL_DIR}/threads 26 chown -R ${HTTPD_USER}:${HTTPD_GROUP} ${INSTALL_DIR}/tmp 27 cp ${BIN} ${DEP} ${INSTALL_DIR} 28 for f in ${DEP}; do\ 29 sed "s^TITLE^${TITLE}^g" < $$f > ${INSTALL_DIR}/$$f;\ 30 done 31 32 uninstall: 33 rm -f ${INSTALL_DIR}/${BIN} 34 for f in ${DEP}; do rm -f ${INSTALL_DIR}/$$f; done 35 36 .PHONY: all test clean install uninstall