summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 904d3115417619a833ba6fbab6bb1d03b8d05f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# APR (Apache Portable Runtime) library Makefile.
#

#
# Macros for supporting directories
#
INCDIR=./include
INCDIR1=../include
INCLUDES=-I$(INCDIR) -I$(INCDIR1)

#
# Macros for target determination
#
SUBDIRS=@SUBDIRS@
CLEAN_SUBDIRS= . test build
INSTALL_SUBDIRS=@INSTALL_SUBDIRS@

TARGET_LIB = libapr.la

#
# Rules for building specific targets, starting with 'all' for
# building the entire package.
#
TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp

# bring in rules.mk for standard functionality
@INCLUDE_RULES@

CLEAN_TARGETS = 
DISTCLEAN_TARGETS = config.cache config.log config.status \
	include/apr.h include/arch/unix/apr_private.h \
	APRVARS libtool apr.exp
EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \
	exports.c export_vars.h

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@

EXPORT_FILES = $(top_srcdir)/include/*.h

delete-lib:
	@if test -f $(TARGET_LIB); then \
	    for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
	    if test -n "`find $$objects -newer $(TARGET_LIB)`"; then \
		echo Found newer objects. Will relink $(TARGET_LIB). ; \
		echo $(RM) -f $(TARGET_LIB) ; \
		$(RM) -f $(TARGET_LIB) ; \
	    fi \
	fi

install: $(TARGET_LIB)
	if [ ! -d $(includedir) ]; then \
	    $(top_srcdir)/build/mkdir.sh $(includedir); \
	fi; \
	cp $(top_srcdir)/include/*.h $(includedir); \
	if [ ! -d $(libdir) ]; then \
	    $(top_srcdir)/build/mkdir.sh $(libdir); \
	fi; \
	$(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir)
	$(LIBTOOL) --mode=install cp APRVARS $(libdir)
	@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
            for i in $(INSTALL_SUBDIRS); do \
	        ( cd $$i ; $(MAKE) install ); \
	    done \
        fi

$(TARGET_LIB):
	@for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
	    $(LINK) @lib_target@

delete-exports:
	@if test -f apr.exp; then \
	    headers="`find include/*.h -newer apr.exp`" ; \
	    if test -n "$$headers"; then \
		echo Found newer headers. Will rebuild apr.exp. ; \
		echo $(RM) -f apr.exp ; \
		$(RM) -f apr.exp ; \
	    fi \
	fi

exports.c:
	$(AWK) -f $(top_srcdir)/build/make_exports.awk $(EXPORT_FILES) > $@

export_vars.h:
	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@

apr.exp: exports.c export_vars.h
	@echo "#! ." > $@
	@echo "* This file was AUTOGENERATED at build time." >> $@
	@echo "* Please do not edit by hand." >> $@
	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@

dox:
	doxygen $(top_srcdir)/docs/doxygen.conf

test: $(TARGET_LIB)
	(cd test; make clean; make; \
	cd test; \
	for prog in `find . -type f -perm +u+x -name "test*" -print`; do \
	    ./$$prog; \
	    if [ $$? -eq 255 ]; then \
	        echo "$$prog failed"; \
	        break; \
	    fi \
	done )

# DO NOT REMOVE
docs: $(INCDIR)/*.h