simplify Makefile - json2tsv - JSON to TSV converter
(HTM) git clone git://git.codemadness.org/json2tsv
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 92e137666be73a2c21a71f0357d15810b56ff20a
(DIR) parent 03778ef6d7fa4f56b2b402280d31b4802ca6c2d5
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 4 Oct 2019 20:44:11 +0200
simplify Makefile
Diffstat:
M Makefile | 25 ++++++++++---------------
D config.mk | 16 ----------------
2 files changed, 10 insertions(+), 31 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
@@ -1,16 +1,16 @@
.POSIX:
-include config.mk
-
NAME = json2tsv
VERSION = 0.1
-BIN = json2tsv
+# paths
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/man
+DOCPREFIX = ${PREFIX}/share/doc/${NAME}
+BIN = ${NAME}
SRC = ${BIN:=.c}
-
MAN1 = ${BIN:=.1}
-
DOC = \
LICENSE\
README
@@ -21,22 +21,18 @@ ${BIN}: ${@:=.o}
OBJ = ${SRC:.c=.o}
-${OBJ}: config.mk
-
.o:
- ${CC} ${JSON2TSV_LDFLAGS} -o $@ $<
+ ${CC} ${LDFLAGS} -o $@ $<
.c.o:
- ${CC} ${JSON2TSV_CFLAGS} ${JSON2TSV_CPPFLAGS} -o $@ -c $<
+ ${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
dist:
rm -rf "${NAME}-${VERSION}"
mkdir -p "${NAME}-${VERSION}"
- cp -f ${MAN1} ${DOC} ${SRC} Makefile config.mk \
- "${NAME}-${VERSION}"
+ cp -f ${MAN1} ${DOC} ${SRC} Makefile "${NAME}-${VERSION}"
# make tarball
- tar -cf - "${NAME}-${VERSION}" | \
- gzip -c > "${NAME}-${VERSION}.tar.gz"
+ tar -cf - "${NAME}-${VERSION}" | gzip -c > "${NAME}-${VERSION}.tar.gz"
rm -rf "${NAME}-${VERSION}"
clean:
@@ -59,8 +55,7 @@ uninstall:
# removing executable files.
for f in ${BIN}; do rm -f "${DESTDIR}${PREFIX}/bin/$$f"; done
# removing example files.
- rm -f \
- "${DESTDIR}${DOCPREFIX}/README"
+ rm -f "${DESTDIR}${DOCPREFIX}/README"
-rmdir "${DESTDIR}${DOCPREFIX}"
# removing manual pages.
for m in ${MAN1}; do rm -f "${DESTDIR}${MANPREFIX}/man1/$$m"; done
(DIR) diff --git a/config.mk b/config.mk
@@ -1,16 +0,0 @@
-# customize below to fit your system
-
-# paths
-PREFIX = /usr/local
-MANPREFIX = ${PREFIX}/man
-DOCPREFIX = ${PREFIX}/share/doc/json2tsv
-
-# compiler and linker
-CC = cc
-AR = ar
-RANLIB = ranlib
-
-# use system flags.
-JSON2TSV_CFLAGS = ${CFLAGS}
-JSON2TSV_LDFLAGS = ${LDFLAGS}
-JSON2TSV_CPPFLAGS =