aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
blob: 17c94d8c2aa510841935efcfe4833dacbf2644fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
#
# Makefile.am:
#
# Copyright (c) 2009 James McKenzie <20@madingley.org>,
# All rights reserved.
#
# $Id$
#
# $Log$
# Revision 1.2  2009/02/08 16:48:21  root
# *** empty log message ***
#
# Revision 1.1  2009/02/08 16:25:32  root
# *** empty log message ***
#
#
#
#

INCLUDES = 

SRCS= libjwg.c version.c cgm.c contour.c ctext.c ftext.c version.c xfig.c
FSRCS=ftext.f
CPROTO=cproto

JWGSRCS=${SRCS} ${FSRCS}

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