Makefile (1889B)
1 # thinglaunch 2 # See LICENSE file for copyright and license details. 3 4 include config.mk 5 6 SRC = ${NAME}.c 7 8 OBJ = ${SRC:.c=.o} 9 10 all: options ${NAME} 11 12 options: 13 @echo ${NAME} build options: 14 @echo "CFLAGS = ${CFLAGS}" 15 @echo "LDFLAGS = ${LDFLAGS}" 16 @echo "CC = ${CC}" 17 18 config.h: 19 @echo creating $@ from config.def.h 20 @cp config.def.h $@ 21 22 .c.o: 23 @echo CC $< 24 @${CC} -c ${CFLAGS} $< 25 26 ${OBJ}: config.h config.mk 27 28 ${NAME}: ${OBJ} 29 @echo CC -o $@ 30 @${CC} -o $@ ${OBJ} ${LDFLAGS} 31 @ln -s ${NAME} thingaskpass 2>/dev/null || true 32 @ln -s ${NAME} thingsudoaskpass 2>/dev/null || true 33 34 clean: 35 @echo cleaning 36 @rm -f ${NAME} *.o thingaskpass thingsudoaskpass ${OBJ} \ 37 ${NAME}-${VERSION}.tar.gz 38 39 dist: clean 40 @echo creating dist tarball 41 @mkdir -p ${NAME}-${VERSION} 42 @cp -R LICENSE LICENSE.orig ${NAME}.1 Makefile config.mk \ 43 ${SRC} *.h ${NAME}-${VERSION} 44 @tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} 45 @gzip ${NAME}-${VERSION}.tar 46 @rm -rf ${NAME}-${VERSION} 47 48 etc: 49 @echo installing etc files into ${DESTDIR}/etc/${NAME} 50 @mkdir -p ${DESTDIR}/etc/${NAME} 51 @cp -R etc/${NAME}/* ${DESTDIR}/etc/${NAME} 52 53 install: all 54 @echo installing executable file to ${DESTDIR}${PREFIX}/bin 55 @mkdir -p ${DESTDIR}${PREFIX}/bin 56 @cp -f ${NAME} thingaskpass thingsudoaskpass ${DESTDIR}${PREFIX}/bin 57 @chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME} 58 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 59 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 60 @cp -f ${NAME}.1 ${DESTDIR}${MANPREFIX}/man1 61 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 62 63 uninstall: 64 @echo removing executable files from ${DESTDIR}${PREFIX}/bin 65 @rm -f ${DESTDIR}${PREFIX}/bin/${NAME} 66 @rm -f ${DESTDIR}${PREFIX}/bin/thingaskpass 67 @rm -f ${DESTDIR}${PREFIX}/bin/thingsudoaskpass 68 @echo removing manual page from ${DESTDIR}${PREFIX}/man1 69 @rm -f ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 70 71 .PHONY: all options clean dist install uninstall