aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..fb8a416
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,76 @@
+#
+#
+# Makefile.am:
+#
+# Copyright (c) 2009 James McKenzie <20@madingley.org>,
+# All rights reserved.
+#
+# $Id$
+#
+# $Log$
+# Revision 1.1 2009/02/08 16:25:32 root
+# *** empty log message ***
+#
+#
+#
+#
+
+INCLUDES =
+
+SRCS= libjwg.c version.c
+CPROTO=cproto
+
+JWGSRCS=${SRCS}
+
+noinst_HEADERS= project.h prototypes.h jwg-tail.h ext_prototypes.h
+
+libjwg_a_SOURCES = ${JWGSRCS}
+libjwg_la_SOURCES = ${JWGSRCS}
+
+libjwg_a_CFLAGS = ${AM_CFLAGS}
+
+BUILT_SOURCES = version.h jwg.h
+
+lib_LIBRARIES=libjwg.a
+lib_LTLIBRARIES=libjwg.la
+
+include_HEADERS=jwg.h
+
+AM_CFLAGS=-g
+
+libjwg_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -release $(LT_RELEASE) \
+ -export-dynamic
+
+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` }
+
+
+jwg.h:jwg-head.h ext_prototypes.h jwg-tail.h
+ cat jwg-head.h ext_prototypes.h jwg-tail.h > jwg.h
+
+protos:
+ echo > prototypes.h
+ echo > ext_prototypes.h
+ cat jwg-head.h ext_prototypes.h jwg-tail.h > jwg.h
+ ${CPROTO} -v -DINT_PROTOS ${INCLUDES} ${SRCS} > prototypes.tmp
+ mv -f prototypes.tmp prototypes.h
+ ${CPROTO} -v -DEXT_PROTOS ${INCLUDES} ${SRCS} > ext_prototypes.h
+ cat jwg-head.h ext_prototypes.h jwg-tail.h > jwg.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 \"libjwg Version ${VDEF} + Edits\"" > version.h; \
+ echo ${VDEF}-E > version-num; \
+ else \
+ echo "#define VERSION \"libjwg Version ${VNUM}\"" > version.h; \
+ echo ${VNUM} > version-num; \
+ fi
+