2 # APR (Apache Portable Runtime) library Makefile.
6 # get substituted into some targets
7 APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
10 # Macros for supporting directories
14 INCLUDES=-I$(INCDIR) -I$(INCDIR1)
17 # Macros for target determination
20 CLEAN_SUBDIRS= . test build
21 INSTALL_SUBDIRS=@INSTALL_SUBDIRS@
23 TARGET_LIB = lib@APR_LIBNAME@.la
26 # Rules for building specific targets, starting with 'all' for
27 # building the entire package.
29 TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.c apr.exp
31 # bring in rules.mk for standard functionality
34 CLEAN_TARGETS = apr.exp exports.c export_vars.c apr-config.out \
36 DISTCLEAN_TARGETS = config.cache config.log config.status \
37 include/apr.h include/arch/unix/apr_private.h \
39 EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in
42 exec_prefix=@exec_prefix@
45 includedir=@includedir@
46 installbuilddir=@installbuilddir@
49 top_srcdir=@apr_srcdir@
50 top_blddir=@apr_builddir@
52 EXPORT_FILES = $(top_srcdir)/include/*.h
55 @if test -f $(TARGET_LIB); then \
56 for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
57 if test -n "`find $$objects -newer $(TARGET_LIB)`"; then \
58 echo Found newer objects. Will relink $(TARGET_LIB). ; \
59 echo $(RM) -f $(TARGET_LIB) ; \
60 $(RM) -f $(TARGET_LIB) ; \
64 # Create apr-config script suitable for the install tree
65 apr-config.out: apr-config
66 sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@
68 # Create apr_rules.mk suitable for the install tree
69 build/apr_rules.out: build/apr_rules.mk
70 sed 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@
72 install: $(TARGET_LIB) apr-config.out build/apr_rules.out
73 if [ ! -d $(DESTDIR)$(includedir) ]; then \
74 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \
76 cp -p $(top_srcdir)/include/*.h $(DESTDIR)$(includedir);
78 if test -n "$(top_blddir)"; then \
79 cp -p $(top_blddir)/include/*.h $(DESTDIR)$(includedir); \
81 if [ ! -d $(DESTDIR)$(libdir) ]; then \
82 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir); \
84 $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(libdir)
85 $(LIBTOOL) --mode=install cp apr.exp $(DESTDIR)$(libdir)
86 if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \
87 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \
89 if [ -f libtool ]; then \
90 $(LIBTOOL) --mode=install cp libtool $(DESTDIR)$(installbuilddir); \
92 if [ -f shlibtool ]; then \
93 $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \
95 for f in mkdir.sh make_exports.awk make_var_export.awk; do \
96 cp $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \
98 cp build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk
99 if [ ! -d $(DESTDIR)$(bindir) ]; then \
100 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \
102 $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/apr-config
103 chmod 755 $(DESTDIR)$(bindir)/apr-config
104 @if [ $(INSTALL_SUBDIRS) != "none" ]; then \
105 for i in $(INSTALL_SUBDIRS); do \
106 ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \
111 @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
112 tmpcmd="$(LINK) @lib_target@ $(ALL_LIBS)"; \
117 @if test -f apr.exp; then \
118 headers="`find include/*.h -newer apr.exp`" ; \
119 if test -n "$$headers"; then \
120 echo Found newer headers. Will rebuild apr.exp. ; \
121 echo $(RM) -f apr.exp exports.c export_vars.h ; \
122 $(RM) -f apr.exp exports.c export_vars.h ; \
127 $(APR_MKEXPORT) $(EXPORT_FILES) > $@
130 $(APR_MKVAREXPORT) $(EXPORT_FILES) > $@
132 apr.exp: exports.c export_vars.c
133 @echo "#! lib@APR_LIBNAME@.so" > $@
134 @echo "* This file was AUTOGENERATED at build time." >> $@
135 @echo "* Please do not edit by hand." >> $@
136 $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
137 $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@
140 doxygen $(top_srcdir)/docs/doxygen.conf
143 (cd test && $(MAKE) check)
148 .PHONY: delete-lib delete-exports
149 .NOTPARALLEL: delete-lib delete-exports