xref: /aosp_15_r20/external/cronet/third_party/apache-portable-runtime/src/Makefile (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1
2srcdir=.
3
4top_srcdir=/ssd/chrome/repo/android/src/third_party/apache-portable-runtime
5top_blddir=/ssd/chrome/repo/android/src/third_party/apache-portable-runtime
6
7#
8# APR (Apache Portable Runtime) library Makefile.
9#
10CPP = gcc -E
11
12# get substituted into some targets
13APR_MAJOR_VERSION=1
14
15#
16# Macros for supporting directories
17#
18INCDIR=./include
19OSDIR=$(top_srcdir)/include/arch/unix
20DEFOSDIR=$(INCDIR)/arch/unix
21INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/unix -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private
22
23#
24# Macros for target determination
25#
26CLEAN_SUBDIRS= test
27INSTALL_SUBDIRS=none
28
29TARGET_LIB = libapr-${APR_MAJOR_VERSION}.la
30APR_PCFILE = apr-$(APR_MAJOR_VERSION).pc
31APR_CONFIG = apr-$(APR_MAJOR_VERSION)-config
32INSTALL = /usr/bin/install -c
33INSTALL_DATA = ${INSTALL} -m 644
34
35#
36# Rules for building specific targets, starting with 'all' for
37# building the entire package.
38#
39TARGETS = $(TARGET_LIB) include/private/apr_escape_test_char.h apr.exp apr-config.out build/apr_rules.out
40
41LT_VERSION = -version-info 5:2:5
42
43# bring in rules.mk for standard functionality
44include /ssd/chrome/repo/android/src/third_party/apache-portable-runtime/build/apr_rules.mk
45include /ssd/chrome/repo/android/src/third_party/apache-portable-runtime/build-outputs.mk
46
47CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
48	build/apr_rules.out tools/gen_test_char \
49	tools/gen_test_char.o tools/gen_test_char.lo \
50	include/private/apr_escape_test_char.h
51DISTCLEAN_TARGETS = config.cache config.log config.status \
52	include/apr.h include/arch/unix/apr_private.h \
53	libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \
54	build/pkg/pkginfo
55EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \
56	build-outputs.mk build/ltcf-c.sh build/aclocal.m4 \
57	build/ltconfig build/ltmain.sh \
58	build/argz.m4 build/libtool.m4 build/ltoptions.m4 \
59	build/ltsugar.m4 build/ltversion.m4 build/lt~obsolete.m4
60
61prefix=/usr/local/apr
62exec_prefix=${prefix}
63bindir=${exec_prefix}/bin
64libdir=${exec_prefix}/lib
65includedir=${prefix}/include/apr-${APR_MAJOR_VERSION}
66installbuilddir=${prefix}/build-1
67
68# Create apr-config script suitable for the install tree
69apr-config.out: $(APR_CONFIG)
70	sed 's,^\(location=\).*$$,\1installed,' < $(APR_CONFIG) > $@
71
72# Create apr_rules.mk suitable for the install tree
73build/apr_rules.out: build/apr_rules.mk
74	sed -e 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' -e 's,^\(top_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@
75
76install: $(TARGETS)
77	$(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \
78		     $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir)
79	$(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir)
80	for f in $(top_srcdir)/include/apr_*.h; do \
81	    $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \
82	done
83	$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir)
84	$(INSTALL_DATA) apr.exp $(DESTDIR)$(libdir)/apr.exp
85	$(INSTALL_DATA) apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE)
86	for f in libtool shlibtool; do \
87	    if test -f $${f}; then $(INSTALL) -m 755 $${f} $(DESTDIR)$(installbuilddir); fi; \
88	done
89	$(INSTALL) -m 755 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir)
90	for f in make_exports.awk make_var_export.awk; do \
91	    $(INSTALL_DATA) $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \
92	done
93	$(INSTALL_DATA) build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk
94	$(INSTALL) -m 755 apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG)
95	@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
96            for i in $(INSTALL_SUBDIRS); do \
97	        ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \
98	    done \
99	fi
100
101$(TARGET_LIB): $(OBJECTS)
102	$(LINK) -rpath $(libdir) $(OBJECTS) $(ALL_LIBS)
103
104encoding/apr_escape.lo: include/private/apr_escape_test_char.h
105
106exports.c: $(HEADERS)
107	$(APR_MKEXPORT) $(HEADERS) > $@
108
109export_vars.c: $(HEADERS)
110	$(APR_MKVAREXPORT) $(HEADERS) > $@
111
112apr.exp: exports.c export_vars.c
113	@echo "#! libapr-${APR_MAJOR_VERSION}.so" > $@
114	@echo "* This file was AUTOGENERATED at build time." >> $@
115	@echo "* Please do not edit by hand." >> $@
116	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
117	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@
118
119dox:
120	doxygen $(top_srcdir)/docs/doxygen.conf
121
122gcov:
123	@build/run-gcov.sh
124
125test: check
126check: $(TARGET_LIB)
127	cd test && $(MAKE) all check
128
129etags:
130	etags `find . -name '*.[ch]'`
131
132OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
133tools/gen_test_char.lo: tools/gen_test_char.c
134	$(APR_MKDIR) tools
135	$(LT_COMPILE)
136
137tools/gen_test_char: $(OBJECTS_gen_test_char)
138	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
139
140include/private/apr_escape_test_char.h: tools/gen_test_char
141	$(APR_MKDIR) include/private
142	tools/gen_test_char > $@
143
144LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \
145	    -no-install $(ALL_LDFLAGS) -o $@
146
147# DO NOT REMOVE
148docs: $(INCDIR)/*.h
149