make: use POSIX only commands

Tue, 17 Sep 2019 22:01:13 +0200

author
David Demelier <markand@malikania.fr>
date
Tue, 17 Sep 2019 22:01:13 +0200
changeset 8
23faf720d186
parent 7
45a06b02a61f
child 9
bd47bd0c977a

make: use POSIX only commands

Makefile file | annotate | diff | comparison | revisions
--- a/Makefile	Tue Sep 17 21:34:11 2019 +0200
+++ b/Makefile	Tue Sep 17 22:01:13 2019 +0200
@@ -17,7 +17,7 @@
 #
 
 CC=             gcc
-CFLAGS=         -Wall -Wextra -ansi -pedantic -std=c99 -DNDEBUG ${EXTRA_CFLAGS}
+CFLAGS=         -Wall -Wextra -pedantic -std=c99 -DNDEBUG ${EXTRA_CFLAGS}
 LDFLAGS=        ${EXTRA_LDFLAGS}
 LDLIBS=         ${EXTRA_LDLIBS}
 
@@ -43,14 +43,17 @@
 	rm -f ${OBJS} ${PROG}
 
 install: ${PROG}
-	install -dm0755 ${DESTDIR}${MANDIR}/man1
-	install -m0644 ${MAN1} ${DESTDIR}${MANDIR}/man1
+	mkdir -p ${DESTDIR}${BINDIR}
+	mkdir -p ${DESTDIR}${MANDIR}/man1
+	cp ${PROG} ${DESTDIR}${BINDIR}/${PROG}
+	cp ${MAN1} ${DESTDIR}${MANDIR}/man1
 
-install-udev:
-	install -Dm0755 ${PROG} ${DESTDIR}${BINDIR}/${PROG}
-	install -Dm0755 50-brightness.rules ${DESTDIR}${LIBDIR}/udev.d/rules.d/50-brightness.rules
+install-udev: install
+	chmod 755 ${DESTDIR}${BINDIR}/${PROG}
+	mkdir -p ${DESTDIR}${LIBDIR}/udev/rules.d
+	cp 50-brightness.rules ${DESTDIR}${LIBDIR}/udev/rules.d
 
-install-setuid: backlight
-	install -Dm4755 ${PROG} ${DESTDIR}${BINDIR}/${PROG}
+install-setuid: install
+	chmod 4755 ${DESTDIR}${BINDIR}/${PROG}
 
 .PHONY: all clean install install-udev install-setuid

mercurial