Try to be smart about removing .la files.
[shibboleth/cpp-sp.git] / shib-target / Makefile.am
1 ## $Id$
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
6
7 lib_LTLIBRARIES = libshib-target.la
8
9 if USE_OUR_ONCRPC
10 libshib_target_la_LIBADD = ${top_builddir}/oncrpc/liboncrpc.la
11 AM_CFLAGS = -I${top_srcdir}/oncrpc
12 AM_CXXFLAGS = -I${top_srcdir}/oncrpc
13 endif
14
15 libshib_targetdir = $(includedir)/shib-target
16 libshib_target_HEADERS = shib-target.h shibrpc.h shib-paths.h
17 noinst_HEADERS = internal.h
18
19 libshib_target_la_SOURCES = \
20         shib-ccache.cpp \
21         shib-config.cpp \
22         shib-ini.cpp \
23         shib-mlp.cpp \
24         shib-rm.cpp \
25         shib-rpcerror.cpp \
26         shib-rpchandle.cpp \
27         shib-shire.cpp \
28         shib-sock.cpp \
29         shibrpc-clnt.c \
30         shibrpc-server.cpp \
31         shibrpc-svc.c \
32         shibrpc-xdr.c \
33         XML.cpp \
34         XMLRequestMapper.cpp
35
36 # this is different from the project version
37 # http://sources.redhat.com/autobook/autobook/autobook_91.html
38 libshib_target_la_LDFLAGS = -version-info 4:0:0
39
40
41
42 RPCGEN=rpcgen -M
43 RPCGEN_SRC=shibrpc.x
44
45 very-clean: 
46         $(RM) shibrpc.h shibrpc-xdr.c shibrpc-clnt.c shibrpc-svc.c
47
48 rpcgen:
49         $(MAKE) do_rpcgen RPCGEN_TARGET=shibrpc.h RPCGEN_ARGS=-h
50         $(MAKE) do_rpcgen RPCGEN_TARGET=shibrpc-xdr.c RPCGEN_ARGS=-c
51         $(MAKE) do_rpcgen RPCGEN_TARGET=shibrpc-clnt.c RPCGEN_ARGS=-l
52         $(MAKE) do_rpcgen RPCGEN_TARGET=shibrpc-svc.c RPCGEN_ARGS=-m
53         $(MAKE) do_rpcgen RPCGEN_TARGET=shibrpc-server-stubs.c RPCGEN_ARGS=-Ss
54
55 do_rpcgen:
56         $(RM) $(RPCGEN_TARGET)
57         $(RPCGEN) $(RPCGEN_ARGS) -o $(RPCGEN_TARGET) $(RPCGEN_SRC)
58
59 shib-paths.h: ${srcdir}/shib-paths.h.in Makefile ${top_builddir}/config.status
60         rm -f $@.tmp
61         sed < ${srcdir}/$@.in > $@.tmp \
62             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:'
63         cmp -s $@ $@.tmp || mv $@.tmp $@
64         rm -f $@.tmp
65
66 install-exec-hook:
67         for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
68
69 EXTRA_DIST = shibtarget.dsp shib-paths.h.in
70 BUILT_SOURCES = shib-paths.h