aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am99
1 files changed, 10 insertions, 89 deletions
diff --git a/Makefile.am b/Makefile.am
index ccef1999..c896ba2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,16 @@
1# This Makefile.am is in the public domain 1# This Makefile.am is in the public domain
2ACLOCAL_AMFLAGS = -I m4 2ACLOCAL_AMFLAGS = -I m4
3SUBDIRS = contrib m4 src . 3SUBDIRS = contrib m4 src .
4DIST_SUBDIRS = $(SUBDIRS) po 4
5EXTRA_PO_DIST = po/ABOUT-NLS $(top_srcdir)/po/configure.ac po/configure 5if HAVE_PO
6SUBDIRS += po
7endif
8
9if BUILD_DOC
10SUBDIRS += doc
11endif
12
13
6W32COMMON = w32/common/gen_dll_res.ps1 w32/common/microhttpd_dll_res_vc.rc.in w32/common/microhttpd_dll_res_vc.rc \ 14W32COMMON = w32/common/gen_dll_res.ps1 w32/common/microhttpd_dll_res_vc.rc.in w32/common/microhttpd_dll_res_vc.rc \
7 w32/common/MHD_config.h w32/common/vs_dirs.props w32/common/common-build-settings.vcxproj \ 15 w32/common/MHD_config.h w32/common/vs_dirs.props w32/common/common-build-settings.vcxproj \
8 w32/common/libmicrohttpd-build-settings.vcxproj w32/common/libmicrohttpd-files.vcxproj w32/common/libmicrohttpd-filters.vcxproj \ 16 w32/common/libmicrohttpd-build-settings.vcxproj w32/common/libmicrohttpd-files.vcxproj w32/common/libmicrohttpd-filters.vcxproj \
@@ -23,94 +31,7 @@ W32VS2017 = w32/VS2017/libmicrohttpd.vcxproj w32/VS2017/libmicrohttpd.vcxproj.fi
23EXTRA_DIST = \ 31EXTRA_DIST = \
24 acinclude.m4 \ 32 acinclude.m4 \
25 libmicrohttpd.pc.in \ 33 libmicrohttpd.pc.in \
26 $(EXTRA_PO_DIST) \
27 $(W32COMMON) $(W32VS2013) $(W32VS2015) $(W32VS2017) 34 $(W32COMMON) $(W32VS2013) $(W32VS2015) $(W32VS2017)
28DISTCLEANFILES=po/configargs.stamp
29 35
30pkgconfigdir = $(libdir)/pkgconfig 36pkgconfigdir = $(libdir)/pkgconfig
31pkgconfig_DATA = libmicrohttpd.pc 37pkgconfig_DATA = libmicrohttpd.pc
32
33if BUILD_DOC
34SUBDIRS += doc
35endif
36
37.PHONY: po-files update-po-files po-files-pre-distdir renew-po-configure.ac update-POTFILES.in
38
39# Do not override automake rule, only add prerequisite
40distdir@EMPTY_VAR@: po-files-pre-distdir
41
42# Do not override automake rule, only add prerequisite
43distclean-recursive@EMPTY_VAR@: po/Makefile
44
45srcdir_po = $(top_srcdir)/po
46
47# Test target: build main po file
48po-files: $(srcdir_po)/libmicrohttpd.pot
49
50# Test target: force update all po files
51update-po-files: po-files-pre-distdir Makefile
52 @$(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.pot-update
53
54# Update po-related files before make distdir
55po-files-pre-distdir: update-POTFILES.in renew-po-configure.ac
56 @$(MAKE) $(AM_MAKEFLAGS) po/Makefile
57
58# Clean in po directory only if po/Makefile was generated to avoid
59# useless generation of po/Makefile only for 'clean' target
60clean-local:
61 @ if test -f po/Makefile; then \
62 $(MAKE) $(AM_MAKEFLAGS) po/Makefile && \
63 $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) clean || exit 1; \
64 fi;
65
66po/Makefile: $(srcdir_po)/Makefile.in.in $(srcdir_po)/Makevars $(srcdir_po)/POTFILES.in po/config.status
67 @$(am__cd) po && @SHELL@ ./config.status ./Makefile.in po-directories
68
69po/configargs.stamp:
70 @$(MAKE) $(AM_MAKEFLAGS) $(top_builddir)/config.status && \
71 @SHELL@ ./config.status po/configargs.stamp
72
73# Regenerate po/config.status if 'po/configure' was updated or 'configure' parameters was changed
74po/config.status: $(srcdir_po)/configure po/configargs.stamp
75 @$(MKDIR_P) po && $(am__cd) po && echo "cd po && @SHELL@ ./configure @ac_configure_args@" && \
76 @SHELL@ $(abs_top_srcdir)/po/configure @ac_configure_args@ --srcdir=$(abs_top_srcdir)/po \
77 --disable-option-checking --no-create --no-recursion
78
79# Next rules actually create files in source tree, not in build tree, but those files should
80# stay in source tree and should be distributed in tarball, i.e. should not be created during
81# normal builds.
82$(srcdir_po)/libmicrohttpd.pot: po/Makefile
83 @$(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.pot
84
85# This target doesn't depend on po/configure.acT so po/configure.ac (and po/configure) will not be
86# forced to regenerate after each run of main configure.
87# If po/configure.ac is missing - it will be generated.
88$(srcdir_po)/configure.ac:
89 @$(MAKE) $(AM_MAKEFLAGS) renew-po-configure.ac
90
91# Update po/configure.ac only if po/configure.acT (generated by main configure) is different.
92# If po/configure.ac is unchanged then po/configure will not be regenerated
93renew-po-configure.ac:
94 @$(MAKE) $(AM_MAKEFLAGS) po/configure.acT && \
95 if ! test -f $(srcdir_po)/configure.ac || \
96 ! cmp -s po/configure.acT $(srcdir_po)/configure.ac ; then \
97 echo "cp po/configure.acT $(srcdir_po)/configure.ac" && \
98 cp po/configure.acT $(srcdir_po)/configure.ac || exit 1; \
99 fi
100
101$(srcdir_po)/configure: $(srcdir_po)/configure.ac
102 @$(am__cd) $(srcdir_po) && echo "Creating po/configure..." && \
103 echo "@ACLOCAL@" && @ACLOCAL@ && \
104 echo "@AUTOCONF@" && @AUTOCONF@
105
106# Generate po/POTFILES.in if po/POTFILES.in is missing
107$(srcdir_po)/POTFILES.in:
108 @$(MAKE) $(AM_MAKEFLAGS) update-POTFILES.in
109
110update-POTFILES.in:
111 @$(am__cd) $(srcdir_po) && if ! test -e POTFILES.in; then \
112 echo @ECHO_N@ "Creating po/POTFILES.in... @ECHO_C@" && chmod o+w . && \
113 find '../src/include' ! -name 'include' -prune -name '*.h' ! -name 'mhd_options.h' > POTFILES.in && \
114 find '../src/microhttpd' ! -name 'microhttpd' -prune \( -name '*.h' -o -name '*.c' \) ! -name 'test_*' >> POTFILES.in && \
115 echo "@ECHO_T@done." || (rm -f POTFILES.in ; echo "@ECHO_T@failed." && false) \
116 fi