suckless-quark/Makefile
Hiltjo Posthuma c00949d37d quark.1: add manpage
quark.c: alphabeticly sort options, like in the manpage.
Makefile: add manpage rule to Makefile and fix make dist.
2014-08-20 20:42:58 +02:00

57 lines
1.4 KiB
Makefile

# quark - simple httpd get daemon
include config.mk
SRC = quark.c
OBJ = ${SRC:.c=.o}
all: options quark
options:
@echo quark build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
.c.o:
@echo CC $<
@${CC} -c ${CFLAGS} $<
${OBJ}: config.mk config.h
config.h:
@echo creating $@ from config.def.h
@cp config.def.h $@
quark: ${OBJ}
@echo CC -o $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
@echo cleaning
@rm -f quark ${OBJ} quark-${VERSION}.tar.gz
dist: clean
@echo creating dist tarball
@mkdir -p quark-${VERSION}
@cp -R LICENSE Makefile README config.mk quark.1 arg.h config.def.h ${SRC} quark-${VERSION}
@tar -cf quark-${VERSION}.tar quark-${VERSION}
@gzip quark-${VERSION}.tar
@rm -rf quark-${VERSION}
install: all
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f quark ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/quark
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < quark.1 > ${DESTDIR}${MANPREFIX}/man1/quark.1
uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/quark
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/quark.1
.PHONY: all options clean dist install uninstall