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