summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e84eefd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+# xml2tsv - simple xml-to-tsv converter
+.POSIX:
+
+include config.mk
+
+SRC = xml.c xml2tsv.c
+INC = config.h xml.h
+OBJ = ${SRC:.c=.o}
+DISTFILES = ${SRC} ${INC} Makefile config.mk
+
+all: options xml2tsv
+
+options:
+ @echo "-+- build options -+-"
+ @echo "PREFIX = ${PREFIX}"
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+ @echo "-+-+-+-+-+-+-+-+-+-+-"
+
+xml2tsv: ${OBJ}
+
+${OBJ}: ${INC}
+
+debug: clean
+ ${MAKE} CFLAGS="${DEBUG}" all
+
+clean:
+ @echo cleaning
+ @rm -f xml2tsv ${OBJ}
+
+install: all
+ @echo installing executable to ${DESTDIR}${BINDIR}
+ @mkdir -p "${DESTDIR}${BINDIR}"
+ @cp -f xml2tsv "${DESTDIR}${BINDIR}"
+ @chmod 755 "${DESTDIR}${BINDIR}/xml2tsv"
+
+uninstall:
+ @echo removing executable file from ${DESTDIR}${BINDIR}
+ @rm -f "${DESTDIR}${BINDIR}/xml2tsv"
+
+dist: clean
+ @echo "making a tarball"
+ @mkdir -p ./xml2tsv-${VERSION}
+ @rm -rf ./xml2tsv-${VERSION}/*
+ @cp -R ${DISTFILES} ./xml2tsv-${VERSION}/
+ @tar -cf xml2tsv-${VERSION}.tar ./xml2tsv-${VERSION}
+ @gzip xml2tsv-${VERSION}.tar
+ @rm -rf xml2tsv-${VERSION}