chiark / gitweb /
a163fd058f7304d27c7d91984d844d481722a5a1
[sympathy.git] / src / Makefile.am
1 #
2 #
3 # Makefile.am:
4 #
5 # Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
6 # All rights reserved.
7 #
8 # $Id$
9 #
10 # $Log$
11 # Revision 1.3  2008/02/07 00:39:13  james
12 # *** empty log message ***
13 #
14 # Revision 1.2  2008/02/04 01:32:39  james
15 # *** empty log message ***
16 #
17 # Revision 1.1  2008/02/03 16:20:24  james
18 # *** empty log message ***
19 #
20 #
21 #
22 #
23
24 INCLUDES = 
25
26 SRCS= ansi.c crt.c html.c libsympathy.c render.c testtty.c version.c vt102.c tty.c
27 CPROTO=cproto
28
29 SYMPATHYSRCS=${SRCS}
30
31 noinst_HEADERS= project.h prototypes.h
32
33
34 libsympathy_a_SOURCES =  ${SYMPATHYSRCS}
35 libsympathy_la_SOURCES = ${SYMPATHYSRCS}
36
37 libsympathy_a_CFLAGS = ${AM_CFLAGS}
38
39 BUILT_SOURCES = version.h
40
41 lib_LIBRARIES=libsympathy.a
42 lib_LTLIBRARIES=libsympathy.la
43
44 include_HEADERS=sympathy.h
45
46 AM_CFLAGS=-g
47
48 libsympathy_la_LDFLAGS = \
49         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
50         -release $(LT_RELEASE) \
51         -export-dynamic 
52
53 VFD=${srcdir}/..
54 VF=${shell cat ${VFD}/version-files}
55 VFS=${VF:%=${VFD}/%}
56 VCHK=${shell cat ${VFS} | @MD5SUM@ | @AWK@ '{print $$1 }' }
57 VNUM=${shell @GREP@ ${VCHK} ${VFD}/version-md5sums | @AWK@ '{ print $$2 }'  }
58 VDEF=${shell echo `cat ${VFD}/version-major`.`cat ${VFD}/version-minor`.`cat ${VFD}/version-micro` }
59
60 protos:
61         echo > prototypes.h
62         ${CPROTO} -v ${INCLUDES} ${SRCS} > prototypes.tmp
63         mv -f prototypes.tmp prototypes.h
64
65 version.h: $(VFD)/version-files $(VFD)/version-major \
66         $(VFD)/version-minor $(VFD)/version-micro \
67         $(VFD)/version-md5sums ${VFS} Makefile
68         if [ .${VNUM} = . ]; then \
69                 echo "#define VERSION \"libsympathy Version ${VDEF} + Edits\"" > version.h; \
70                 echo ${VDEF}-E > version-num; \
71         else \
72                 echo "#define VERSION \"libsympathy Version ${VNUM}\"" > version.h; \
73                 echo ${VNUM} > version-num; \
74         fi
75