Introduction
Introduction Statistics Contact Development Disclaimer Help
Makefile - json2tsv - JSON to TSV converter
git clone git://git.codemadness.org/json2tsv
Log
Files
Refs
README
LICENSE
---
Makefile (2148B)
---
1 .POSIX:
2
3 NAME = json2tsv
4 VERSION = 1.2
5
6 # paths
7 PREFIX = /usr/local
8 MANPREFIX = ${PREFIX}/man
9 DOCPREFIX = ${PREFIX}/share/doc/${NAME}
10
11 RANLIB = ranlib
12
13 # use system flags.
14 JSON2TSV_CFLAGS = ${CFLAGS}
15 JSON2TSV_LDFLAGS = ${LDFLAGS}
16 JSON2TSV_CPPFLAGS = -D_DEFAULT_SOURCE
17
18 # uncomment for conservative locked I/O.
19 #JSON2TSV_CPPFLAGS = -D_DEFAULT_SOURCE -DGETNEXT=getchar
20
21 BIN = ${NAME}
22 SCRIPTS = jaq
23 SRC = ${BIN:=.c}
24 HDR = json.h
25 MAN1 = ${BIN:=.1}\
26 ${SCRIPTS:=.1}
27 DOC = \
28 LICENSE\
29 README
30
31 LIBJSON = libjson.a
32 LIBJSONSRC = json.c
33 LIBJSONOBJ = ${LIBJSONSRC:.c=.o}
34
35 LIB = ${LIBJSON}
36
37 all: ${BIN}
38
39 ${BIN}: ${LIB} ${@:=.o}
40
41 OBJ = ${SRC:.c=.o} ${LIBJSONOBJ}
42
43 ${OBJ}: ${HDR}
44
45 .o:
46 ${CC} ${JSON2TSV_LDFLAGS} -o $@ $< ${LIB}
47
48 .c.o:
49 ${CC} ${JSON2TSV_CFLAGS} ${JSON2TSV_CPPFLAGS} -o $@ -c $<
50
51 ${LIBJSON}: ${LIBJSONOBJ}
52 ${AR} -rc $@ $?
53 ${RANLIB} $@
54
55 dist:
56 rm -rf "${NAME}-${VERSION}"
57 mkdir -p "${NAME}-${VERSION}"
58 cp -f ${MAN1} ${DOC} ${HDR} ${SCRIPTS} \
59 ${SRC} ${LIBJSONSRC} Makefile "${NAME}-${VERSION}"
60 # make tarball
61 tar cf - "${NAME}-${VERSION}" | gzip -c > "${NAME}-${VERSION}.ta…
62 rm -rf "${NAME}-${VERSION}"
63
64 clean:
65 rm -f ${BIN} ${OBJ} ${LIB}
66
67 install: all
68 # installing executable files and scripts.
69 mkdir -p "${DESTDIR}${PREFIX}/bin"
70 cp -f ${BIN} ${SCRIPTS} "${DESTDIR}${PREFIX}/bin"
71 for f in ${BIN} ${SCRIPTS}; do chmod 755 "${DESTDIR}${PREFIX}/bi…
72 # installing example files.
73 mkdir -p "${DESTDIR}${DOCPREFIX}"
74 cp -f ${DOC} "${DESTDIR}${DOCPREFIX}"
75 for d in ${DOC}; do chmod 644 "${DESTDIR}${DOCPREFIX}/$$d"; done
76 # installing manual pages for general commands: section 1.
77 mkdir -p "${DESTDIR}${MANPREFIX}/man1"
78 cp -f ${MAN1} "${DESTDIR}${MANPREFIX}/man1"
79 for m in ${MAN1}; do chmod 644 "${DESTDIR}${MANPREFIX}/man1/$$m"…
80
81 uninstall:
82 # removing executable files and scripts.
83 for f in ${BIN} ${SCRIPTS}; do rm -f "${DESTDIR}${PREFIX}/bin/$$…
84 # removing example files.
85 for d in ${DOC}; do rm -f "${DESTDIR}${DOCPREFIX}/$$d"; done
86 -rmdir "${DESTDIR}${DOCPREFIX}"
87 # removing manual pages.
88 for m in ${MAN1}; do rm -f "${DESTDIR}${MANPREFIX}/man1/$$m"; do…
89
90 .PHONY: all clean dist install uninstall
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.