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