# # # Makefile.am: # # Copyright (c) 2017 James McKenzie , # All rights reserved. # # # CPROTO=cproto AM_CPPFLAGS = noinst_HEADERS=project.h prototypes.h sbin_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