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.1  2008/02/03 16:20:24  james
12 # *** empty log message ***
13 #
14 #
15 #
16 #
17
18 INCLUDES = 
19
20 SRCS= libsympathy.c version.c
21 CPROTO=cproto
22
23 SYMPATHYSRCS=${SRCS}
24
25 noinst_HEADERS= project.h prototypes.h
26
27
28 libsympathy_a_SOURCES =  ${SYMPATHYSRCS}
29 libsympathy_la_SOURCES = ${SYMPATHYSRCS}
30
31 libsympathy_a_CFLAGS = ${AM_CFLAGS}
32
33 BUILT_SOURCES = version.h
34
35 lib_LIBRARIES=libsympathy.a
36 lib_LTLIBRARIES=libsympathy.la
37
38 include_HEADERS=sympathy.h
39
40 AM_CFLAGS=-g
41
42 libsympathy_la_LDFLAGS = \
43         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
44         -release $(LT_RELEASE) \
45         -export-dynamic 
46
47 VFD=${srcdir}/..
48 VF=${shell cat ${VFD}/version-files}
49 VFS=${VF:%=${VFD}/%}
50 VCHK=${shell cat ${VFS} | @MD5SUM@ | @AWK@ '{print $$1 }' }
51 VNUM=${shell @GREP@ ${VCHK} ${VFD}/version-md5sums | @AWK@ '{ print $$2 }'  }
52 VDEF=${shell echo `cat ${VFD}/version-major`.`cat ${VFD}/version-minor`.`cat ${VFD}/version-micro` }
53
54 protos:
55         echo > prototypes.h
56         ${CPROTO} -v ${INCLUDES} ${SRCS} > prototypes.tmp
57         mv -f prototypes.tmp prototypes.h
58
59 version.h: $(VFD)/version-files $(VFD)/version-major \
60         $(VFD)/version-minor $(VFD)/version-micro \
61         $(VFD)/version-md5sums ${VFS} Makefile
62         if [ .${VNUM} = . ]; then \
63                 echo "#define VERSION \"libsympathy Version ${VDEF} + Edits\"" > version.h; \
64                 echo ${VDEF}-E > version-num; \
65         else \
66                 echo "#define VERSION \"libsympathy Version ${VNUM}\"" > version.h; \
67                 echo ${VNUM} > version-num; \
68         fi
69