chiark / gitweb /
*** empty log message ***
[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.7  2008/02/12 22:36:46  james
12 # *** empty log message ***
13 #
14 # Revision 1.6  2008/02/09 15:47:28  james
15 # *** empty log message ***
16 #
17 # Revision 1.5  2008/02/08 15:06:42  james
18 # *** empty log message ***
19 #
20 # Revision 1.4  2008/02/07 01:04:16  james
21 # *** empty log message ***
22 #
23 # Revision 1.3  2008/02/07 00:39:13  james
24 # *** empty log message ***
25 #
26 # Revision 1.2  2008/02/04 01:32:39  james
27 # *** empty log message ***
28 #
29 # Revision 1.1  2008/02/03 16:20:24  james
30 # *** empty log message ***
31 #
32 #
33 #
34 #
35
36 INCLUDES=
37
38 HDRS=ansi.h context.h crt.h history.h keys.h project.h prototypes.h \
39         ring.h sympathy.h tty.h vt102.h
40
41 SRCS=ansi.c crt.c html.c libsympathy.c render.c  version.c vt102.c tty.c \
42         history.c ring.c ptty.c
43
44 CPROTO=cproto
45
46 SYMPATHYSRCS=${SRCS}
47
48 noinst_HEADERS= prototypes.h ${HDRS}
49
50
51 libsympathy_a_SOURCES =  ${SYMPATHYSRCS}
52 libsympathy_la_SOURCES = ${SYMPATHYSRCS}
53
54 libsympathy_a_CFLAGS = ${AM_CFLAGS}
55
56 BUILT_SOURCES = version.h
57
58 lib_LIBRARIES=libsympathy.a
59 lib_LTLIBRARIES=libsympathy.la
60
61 include_HEADERS=sympathy.h
62
63 AM_CFLAGS=-g
64
65 libsympathy_la_LDFLAGS = \
66         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
67         -release $(LT_RELEASE) \
68         -export-dynamic 
69
70 VFD=${srcdir}/..
71 VF=${shell cat ${VFD}/version-files}
72 VFS=${VF:%=${VFD}/%}
73 VCHK=${shell cat ${VFS} | @MD5SUM@ | @AWK@ '{print $$1 }' }
74 VNUM=${shell @GREP@ ${VCHK} ${VFD}/version-md5sums | @AWK@ '{ print $$2 }'  }
75 VDEF=${shell echo `cat ${VFD}/version-major`.`cat ${VFD}/version-minor`.`cat ${VFD}/version-micro` }
76
77 protos:
78         echo > prototypes.h
79         ${CPROTO} -v ${INCLUDES} ${SRCS} > prototypes.tmp
80         mv -f prototypes.tmp prototypes.h
81
82 tidy: ${SRCS} ${HDRS}
83         indent -i2 -ts0 ${SRCS} ${HDRS} 
84
85 version.h: $(VFD)/version-files $(VFD)/version-major \
86         $(VFD)/version-minor $(VFD)/version-micro \
87         $(VFD)/version-md5sums ${VFS} Makefile
88         if [ .${VNUM} = . ]; then \
89                 echo "#define VERSION \"libsympathy Version ${VDEF} + Edits\"" > version.h; \
90                 echo ${VDEF}-E > version-num; \
91         else \
92                 echo "#define VERSION \"libsympathy Version ${VNUM}\"" > version.h; \
93                 echo ${VNUM} > version-num; \
94         fi
95