aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..85bb6b0
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,53 @@
+#
+#
+# Makefile.am:
+#
+# Copyright (c) 2017 James McKenzie <foss@madingley.org>,
+# All rights reserved.
+#
+#
+#
+
+CPROTO=cproto
+AM_CPPFLAGS =
+
+noinst_HEADERS=project.h prototypes.h
+
+bin_PROGRAMS = twa_t
+
+SRCS=twa_t.c twa.c version.c util.c hexdump.c
+twa_t_SOURCES = ${SRCS}
+twa_t_LDADD =
+
+AM_CFLAGS=-g
+
+twa_t_LDFLAGS =
+
+BUILT_SOURCES = version.h
+
+
+VFD=${srcdir}/..
+VF=${shell cat ${VFD}/version-files}
+VFS=${VF:%=${VFD}/%}
+VCHK=${shell cat ${VFS} | @MD5SUM@ | @AWK@ '{print $$1 }' }
+VNUM=${shell @GREP@ ${VCHK} ${VFD}/version-md5sums | @AWK@ '{ print $$2 }' }
+VDEF=${shell echo `cat ${VFD}/version-major`.`cat ${VFD}/version-minor`.`cat ${VFD}/version-micro` }
+
+protos:
+ echo > prototypes.h
+ ${CPROTO} -v ${INCLUDES} ${SRCS} > prototypes.tmp
+ mv -f prototypes.tmp prototypes.h
+
+
+
+version.h: $(VFD)/version-files $(VFD)/version-major \
+ $(VFD)/version-minor $(VFD)/version-micro \
+ $(VFD)/version-md5sums ${VFS} Makefile
+ if [ .${VNUM} = . ]; then \
+ echo "#define VERSION \"twa_t Version ${VDEF} + Edits\"" > version.h; \
+ echo ${VDEF}-E > version-num; \
+ else \
+ echo "#define VERSION \"twa_t Version ${VNUM}\"" > version.h; \
+ echo ${VNUM} > version-num; \
+ fi
+