From d1915f0d4d6bae409da7d7cded482650ed2959d8 Mon Sep 17 00:00:00 2001 From: Aaron Marcher Date: Sat, 7 Jan 2017 21:49:10 +0100 Subject: saner makefile: cleaner, simpler, suckless --- Makefile | 59 +++++++++++------------------------------------------------ 1 file changed, 11 insertions(+), 48 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6cba860..afdbcdf 100644 --- a/Makefile +++ b/Makefile @@ -4,58 +4,21 @@ include config.mk NAME=slstatus -SRC = ${NAME}.c -OBJ = ${SRC:.c=.o} - -all: options ${NAME} - -options: - @echo ${NAME} build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - -.c.o: - @echo CC $< - @${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk - -config.h: - @echo creating $@ from config.def.h - @cp config.def.h $@ - -${NAME}: ${OBJ} - @echo CC -o $@ - @${CC} -o $@ ${OBJ} ${LDFLAGS} +all: ${NAME} clean: - @echo cleaning - @rm -f ${NAME} ${OBJ} ${NAME}.tar.gz - -dist: clean - @echo creating dist tarball - @mkdir -p ${NAME} - @cp -R Makefile config.mk LICENSE \ - ${SRC} ${NAME} - @tar -cf ${NAME}.tar ${NAME} - @gzip ${NAME}.tar - @rm -rf ${NAME} + rm -f ${NAME} install: all - @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @cp -f ${NAME} ${DESTDIR}${PREFIX}/bin - @chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME} - @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 - @mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @cp -f ${NAME}.1 ${DESTDIR}${MANPREFIX}/man1 - @chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 + mkdir -p ${DESTDIR}${PREFIX}/bin + cp -f ${NAME} ${DESTDIR}${PREFIX}/bin + chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME} + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + cp -f ${NAME}.1 ${DESTDIR}${MANPREFIX}/man1 + chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/${NAME} - @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 - @rm -f ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 + rm -f ${DESTDIR}${PREFIX}/bin/${NAME} + rm -f ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 -.PHONY: all options clean dist install uninstall +.PHONY: all clean install uninstall -- cgit v1.2.3