summaryrefslogtreecommitdiff
path: root/lib/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Makefile.am')
-rw-r--r--lib/Makefile.am26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index aa32f57..3798a0a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -242,16 +242,24 @@ HEADERS_WITH_EXTERNS = \
# '-export-symbols', but we don't use this option, because it would prevent us
# from building some of the gnulib unit tests.
$(srcdir)/libunistring.sym : $(HEADERS_WITH_EXTERNS)
- for f in $(HEADERS_WITH_EXTERNS); do \
- if test -f $$f; then \
- cat $$f; \
+ if \
+ for f in $(HEADERS_WITH_EXTERNS); do \
+ if test -f $$f; then \
+ cat $$f; \
+ else \
+ cat $(srcdir)/$$f; \
+ fi; \
+ done \
+ | $(srcdir)/declared.sh > $@-t1; \
+ then \
+ LC_ALL=C sort < $@-t1 | LC_ALL=C uniq > $@-t2 && mv $@-t2 $@; \
+ else \
+ if test -f $@; then \
+ echo "Continuing with existing libunistring.sym."; \
else \
- cat $(srcdir)/$$f; \
+ exit 1; \
fi; \
- done \
- | $(srcdir)/declared.sh | LC_ALL=C sort | LC_ALL=C uniq \
- > $@-t
- mv $@-t $@
+ fi
# We distribute it because declared.sh relies on GNU sed.
# The GNU Coding Standards say in
# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
@@ -261,7 +269,7 @@ $(srcdir)/libunistring.sym : $(HEADERS_WITH_EXTERNS)
# So Makefile rules to update them should put the updated files in the
# source directory."
# Therefore we put this file in the source directory, not the build directory.
-MOSTLYCLEANFILES += libunistring.sym-t
+MOSTLYCLEANFILES += libunistring.sym-t1 libunistring.sym-t2
MAINTAINERCLEANFILES += libunistring.sym
EXTRA_DIST += libunistring.sym declared.sh