summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2017-01-07 21:49:10 +0100
committerAaron Marcher <info@nulltime.net>2017-01-07 21:49:10 +0100
commitd1915f0d4d6bae409da7d7cded482650ed2959d8 (patch)
treeeaa542c7044e7fea4c2dc9eeea2ae0274c30265e /Makefile
parent384791177160a45de6943ad7e1aba5a1948306ed (diff)
saner makefile: cleaner, simpler, suckless
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile59
1 files changed, 11 insertions, 48 deletions
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