commit eb12a9783119d42cae028bf642b54214eb62628b
parent a6e8fd2403d272adabe1d8c305e06488dd8675a7
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 Dec 2017 15:05:07 +0100
Makefile/config.mk fixes
- remove unused $INSTALL.
- remove inconsistent $RM, just use rm -f.
- chmod installed files.
- respect $DESTDIR (for packaging).
- fix make clean: ${OBJECTS} -> ${OBJ}.
- add .PHONY for targets.
- config.mk: remove -ansi, pomodoro is not ansi C.
Diffstat:
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
@@ -2,10 +2,6 @@ VERSION = 0.1
include config.mk
-CC?=gcc
-INSTALL?=install
-RM?=rm -f
-
OBJ = pomodoro.o
BIN = pomodoro
@@ -17,14 +13,18 @@ ${BIN}: ${OBJ}
pomodoro.o:
install: all
- mkdir -p ${PREFIX}/bin
- cp -f ${BIN} ${PREFIX}/bin
- mkdir -p ${MANPREFIX}/man1
- cp -f ${BIN}.1 ${MANPREFIX}/man1
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
+ mkdir -p ${DESTDIR}${MANPREFIX}/man1
+ cp -f ${BIN}.1 ${DESTDIR}${MANPREFIX}/man1
+ chmod 644 ${DESTDIR}${MANPREFIX}/man1/${BIN}.1
uninstall:
- rm -f ${PREFIX}/bin/${BIN}
- rm -f ${MANPREFIX}/man1/${BIN}.1
+ rm -f ${DESTDIR}${PREFIX}/bin/${BIN} \
+ ${DESTDIR}${MANPREFIX}/man1/${BIN}.1
clean:
- ${RM} ${OBJECTS} pomodoro pomodoro.core pomodoro.o
+ rm -f ${OBJ} pomodoro pomodoro.core pomodoro.o
+
+.PHONY: all clean install uninstall
diff --git a/config.bsd.mk b/config.bsd.mk
@@ -2,7 +2,7 @@ PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
CFLAGS?=-Os
-CFLAGS+=-ansi -pedantic -Wall -Wextra
+CFLAGS+=-pedantic -Wall -Wextra
CFLAGS+=-Isrc -I/usr/include -I/usr/X11R6/include
CFLAGS+=-DVERSION=\"${VERSION}\"
LDFLAGS+=-L/usr/lib -L/usr/X11R6/lib