commit d281e7082c8987bec72e54522c6953546687c884
parent 8a92c9d41937be9b766c020d260f4c8360b819cb
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 Mar 2019 14:18:10 +0100
Makefile: respect system CFLAGS/LDFLAGS, add DOCPREFIX
Diffstat:
2 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/Makefile b/Makefile
@@ -20,10 +20,10 @@ OBJ = ${SRC:.c=.o}
all: ${BIN}
.o:
- ${CC} ${LDFLAGS} -o $@ ${LIBS}
+ ${CC} ${SAAIT_LDFLAGS} -o $@
.c.o:
- ${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
+ ${CC} -c ${SAAIT_CFLAGS} ${SAAIT_CPPFLAGS} -o $@ -c $<
dist:
rm -rf ${NAME}-${VERSION}
@@ -53,15 +53,15 @@ install: all
cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
# installing example files.
- mkdir -p ${DESTDIR}${PREFIX}/share/${NAME}
+ mkdir -p ${DESTDIR}${DOCPREFIX}
cp -f \
README\
print.css\
style.css\
config.cfg\
- ${DESTDIR}${PREFIX}/share/${NAME}
+ ${DESTDIR}${DOCPREFIX}
# pages and templates examples.
- cp -rf pages templates ${DESTDIR}${PREFIX}/share/${NAME}
+ cp -rf pages templates ${DESTDIR}${DOCPREFIX}
# installing manual pages.
mkdir -p ${DESTDIR}${MANPREFIX}/man1
cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
@@ -72,14 +72,14 @@ uninstall:
for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
# removing example files.
rm -f \
- ${DESTDIR}${PREFIX}/share/${NAME}/README\
- ${DESTDIR}${PREFIX}/share/${NAME}/print.css\
- ${DESTDIR}${PREFIX}/share/${NAME}/style.css\
- ${DESTDIR}${PREFIX}/share/${NAME}/config.cfg
+ ${DESTDIR}${DOCPREFIX}/README\
+ ${DESTDIR}${DOCPREFIX}/print.css\
+ ${DESTDIR}${DOCPREFIX}/style.css\
+ ${DESTDIR}${DOCPREFIX}/config.cfg
# pages and templates examples.
- rm -rf ${DESTDIR}${PREFIX}/share/${NAME}/templates \
- ${DESTDIR}${PREFIX}/share/${NAME}/pages
- -rmdir ${DESTDIR}${PREFIX}/share/${NAME}
+ rm -rf ${DESTDIR}${DOCPREFIX}/templates \
+ ${DESTDIR}${DOCPREFIX}/pages
+ -rmdir ${DESTDIR}${DOCPREFIX}
# removing manual pages.
for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
diff --git a/config.mk b/config.mk
@@ -3,24 +3,15 @@
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
+DOCPREFIX = ${PREFIX}/share/doc/saait
# compiler and linker
-#CC = cc
+CC = cc
-# includes and libs
-INCS =
-LIBS =
+SAAIT_CFLAGS = ${CFLAGS}
+SAAIT_LDFLAGS = ${LDFLAGS}
+SAAIT_CPPFLAGS = -D_DEFAULT_SOURCE
# debug
-#CFLAGS = -fstack-protector-all -O0 -g -std=c99 -Wall -Wextra -pedantic ${INCS}
-#LDFLAGS = ${LIBS}
-
-# optimized
-CFLAGS = -O2 -std=c99 ${INCS}
-LDFLAGS = -s ${LIBS}
-
-# optimized static
-#CFLAGS = -static -O2 -std=c99 ${INCS}
-#LDFLAGS = -static -s ${LIBS}
-
-CPPFLAGS = -D_DEFAULT_SOURCE ${INCS}
+#SAAIT_CFLAGS = -fstack-protector-all -O0 -g -std=c99 -Wall -Wextra -pedantic
+#SAAIT_LDFLAGS =