Makefile: make it simpler to not compile compat objects - tscrape - twitter scraper
(HTM) git clone git://git.codemadness.org/tscrape
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 33e40c9fc70a418c65d6de3cc68c1c3431f4cd47
(DIR) parent f5f136fabf5f8cd7245d963e7e479442200738e7
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 23 Apr 2019 21:06:48 +0200
Makefile: make it simpler to not compile compat objects
on OpenBSD: make COMPATOBJ=
Diffstat:
M Makefile | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
include config.mk
NAME = tscrape
@@ -11,11 +13,12 @@ SCRIPTS = \
tscrape_update
SRC = ${BIN:=.c}
+HDR = \
+ util.h\
+ xml.h
LIBUTIL = libutil.a
LIBUTILSRC = \
- strlcat.c\
- strlcpy.c\
util.c
LIBUTILOBJ = ${LIBUTILSRC:.c=.o}
@@ -24,22 +27,25 @@ LIBXMLSRC = \
xml.c
LIBXMLOBJ = ${LIBXMLSRC:.c=.o}
-LIB = ${LIBUTIL} ${LIBXML}
+COMPATSRC = \
+ strlcat.c\
+ strlcpy.c
+COMPATOBJ =\
+ strlcat.o\
+ strlcpy.o
-MAN1 = tscrape.1
+LIB = ${LIBUTIL} ${LIBXML} ${COMPATOBJ}
+MAN1 = tscrape.1
DOC = \
LICENSE\
README
-HDR = \
- util.h\
- xml.h
all: $(BIN)
${BIN}: ${LIB} ${@:=.o}
-OBJ = ${SRC:.c=.o} ${LIBXMLOBJ} ${LIBUTILOBJ}
+OBJ = ${SRC:.c=.o} ${LIBXMLOBJ} ${LIBUTILOBJ} ${COMPATOBJ}
${OBJ}: config.mk ${HDR}
@@ -61,7 +67,7 @@ dist:
rm -rf "${NAME}-${VERSION}"
mkdir -p "${NAME}-${VERSION}"
cp -f ${MAN1} ${DOC} ${HDR} \
- ${SRC} ${LIBXMLSRC} ${LIBUTILSRC} ${SCRIPTS} \
+ ${SRC} ${LIBXMLSRC} ${LIBUTILSRC} ${COMPATSRC} ${SCRIPTS} \
Makefile config.mk \
tscraperc.example style.css \
"${NAME}-${VERSION}"