chiark / gitweb /
serialmgrd: Support recent versions of perl
[sympathy.git] / src / Makefile.am
1 #
2 #
3 # Makefile.am:
4 #
5 # Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
6 # All rights reserved.
7 #
8 # $Id: Makefile.am,v 1.24 2008/03/07 13:16:02 james Exp $
9 #
10 # $Log: Makefile.am,v $
11 # Revision 1.24  2008/03/07 13:16:02  james
12 # *** empty log message ***
13 #
14 # Revision 1.23  2008/03/06 16:49:05  james
15 # *** empty log message ***
16 #
17 # Revision 1.22  2008/03/03 06:04:18  james
18 # *** empty log message ***
19 #
20 # Revision 1.21  2008/02/28 22:55:27  staffcvs
21 # *** empty log message ***
22 #
23 # Revision 1.20  2008/02/27 15:04:32  james
24 # *** empty log message ***
25 #
26 # Revision 1.19  2008/02/27 10:47:34  james
27 # *** empty log message ***
28 #
29 # Revision 1.18  2008/02/26 23:23:17  james
30 # *** empty log message ***
31 #
32 # Revision 1.17  2008/02/24 00:42:53  james
33 # *** empty log message ***
34 #
35 # Revision 1.16  2008/02/22 23:39:27  james
36 # *** empty log message ***
37 #
38 # Revision 1.15  2008/02/15 16:48:56  james
39 # *** empty log message ***
40 #
41 # Revision 1.14  2008/02/15 03:32:07  james
42 # *** empty log message ***
43 #
44 # Revision 1.13  2008/02/14 16:21:17  james
45 # *** empty log message ***
46 #
47 # Revision 1.12  2008/02/14 02:46:44  james
48 # *** empty log message ***
49 #
50 # Revision 1.11  2008/02/14 01:55:57  james
51 # *** empty log message ***
52 #
53 # Revision 1.10  2008/02/13 18:05:06  james
54 # *** empty log message ***
55 #
56 # Revision 1.9  2008/02/13 16:57:29  james
57 # *** empty log message ***
58 #
59 # Revision 1.8  2008/02/13 09:12:20  james
60 # *** empty log message ***
61 #
62 # Revision 1.7  2008/02/12 22:36:46  james
63 # *** empty log message ***
64 #
65 # Revision 1.6  2008/02/09 15:47:28  james
66 # *** empty log message ***
67 #
68 # Revision 1.5  2008/02/08 15:06:42  james
69 # *** empty log message ***
70 #
71 # Revision 1.4  2008/02/07 01:04:16  james
72 # *** empty log message ***
73 #
74 # Revision 1.3  2008/02/07 00:39:13  james
75 # *** empty log message ***
76 #
77 # Revision 1.2  2008/02/04 01:32:39  james
78 # *** empty log message ***
79 #
80 # Revision 1.1  2008/02/03 16:20:24  james
81 # *** empty log message ***
82 #
83 #
84 #
85 #
86
87 INCLUDES=
88
89 # NB order here matters.
90 PROJECTHDRS= crt.h utf8.h tty.h ansi.h vt102.h keys.h history.h ring.h slide.h \
91                 log.h ipc.h symsocket.h keydis.h cmd.h lockfile.h rx.h \
92                 context.h vt102_charset.h prototypes.h
93
94 HDRS=project.h  ${PROJECTHDRS}
95
96
97 SRCS=ansi.c crt.c html.c libsympathy.c render.c  version.c vt102.c tty.c \
98         keydis.c history.c ring.c ptty.c terminal.c util.c log.c ipc.c \
99         slide.c symsocket.c  serial.c cmd.c lockfile.c utf8.c vt102_charset.c \
100         rotate.c raw.c
101
102 CPROTO=cproto
103
104 SYMPATHYSRCS=${SRCS}
105
106 noinst_HEADERS= prototypes.h ${HDRS}
107
108 EXTRA_DIST=sympathy.h.tail
109
110 clean-local:
111         -rm -f sympathy.h version.h version-num
112
113 libsympathy_a_SOURCES =  ${SYMPATHYSRCS}
114 libsympathy_la_SOURCES = ${SYMPATHYSRCS}
115
116 libsympathy_a_CFLAGS = ${AM_CFLAGS}
117
118 BUILT_SOURCES = version.h sympathy.h
119
120 lib_LIBRARIES=libsympathy.a
121 lib_LTLIBRARIES=libsympathy.la
122
123 include_HEADERS=sympathy.h
124
125 AM_CFLAGS=-g -Werror
126
127 libsympathy_la_LDFLAGS = \
128         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
129         -release $(LT_RELEASE) \
130         -export-dynamic 
131
132 VFD=${srcdir}/..
133 VF=${shell cat ${VFD}/version-files}
134 VFS=${VF:%=${VFD}/%}
135 VCHK=${shell cat ${VFS} | @MD5SUM@ | @AWK@ '{print $$1 }' }
136 VNUM=${shell @GREP@ ${VCHK} ${VFD}/version-md5sums | @AWK@ '{ print $$2 }'  }
137 VDEF=${shell echo `cat ${VFD}/version-major`.`cat ${VFD}/version-minor`.`cat ${VFD}/version-micro` }
138
139 protos: sympathy.h
140         echo > prototypes.h
141         ${CPROTO} -e -v ${INCLUDES} ${SRCS} > prototypes.tmp
142         mv -f prototypes.tmp prototypes.h
143
144 tidy: ${SRCS} ${HDRS}
145         indent -i2 -ts0 ${SRCS} ${HDRS} 
146         /bin/rm -f *~
147
148 sympathy.h: ${PROJECTHDRS} sympathy.h.head sympathy.h.tail
149         cat sympathy.h.head ${PROJECTHDRS} sympathy.h.tail > $@ || /bin/rm -f $@
150
151 version.h: $(VFD)/version-files $(VFD)/version-major \
152         $(VFD)/version-minor $(VFD)/version-micro \
153         $(VFD)/version-md5sums ${VFS} 
154         if [ .${VNUM} = . ]; then \
155                 echo "#define VERSION \"libsympathy Version ${VDEF} + Edits\"" > version.h; \
156                 echo ${VDEF}-E > version-num; \
157         else \
158                 echo "#define VERSION \"libsympathy Version ${VNUM}\"" > version.h; \
159                 echo ${VNUM} > version-num; \
160         fi
161