| Date: Sun, 27 Sep 2020 14:25:26 +0200
Makefile: set permissions and modes on installed files
Diffstat:
M Makefile | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- |
| t@@ -2,6 +2,7 @@
NAME = vote
+PREFIX ?= /var/www/cgi-bin
HERE_CFLAGS = ${CFLAGS}
HERE_LDFLAGS = -static ${LDFLAGS}
t@@ -16,12 +17,15 @@ ${NAME}: ${OBJ}
${CC} -o $@ ${OBJ} ${HERE_LDFLAGS}
install: ${NAME}
- mkdir -p /var/www/cgi-bin/${NAME}
- cp -f ${NAME} /var/www/cgi-bin/${NAME}/
+ mkdir -p
+ chmod 775 ${PREFIX}/${NAME}
+ chgrp www ${PREFIX}/${NAME}
+ cp -f ${NAME} ${PREFIX}/${NAME}/
+ chgrp www ${PREFIX}/${NAME}/${NAME}
uninstall:
- rm -f /var/www/cgi-bin/${NAME}/${NAME}
- -rmdir /var/www/cgi-bin/${NAME}
+ rm -f ${PREFIX}/${NAME}/${NAME}
+ -rmdir ${PREFIX}/${NAME}
clean:
rm -f *.o |