]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
Start implementing proper error handling.
[cdecl99.git] / Makefile.am
index dcc43c60703dd5029d19851f44ebfc20120bdd23..f387ee348d3cbbe204294f2d1688cfa130dbdde2 100644 (file)
@@ -5,14 +5,15 @@
 # There is NO WARRANTY, to the extent permitted by law.
 
 ACLOCAL_AMFLAGS = -I m4
+AUTOMAKE_OPTIONS = nostdinc
 
 # For Gnulib
-BUILT_SOURCES =
 MOSTLYCLEANFILES =
 noinst_LTLIBRARIES =
 
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
        -I$(top_builddir)/lib -I$(top_srcdir)/lib \
+       -I$(top_builddir) -I$(top_srcdir) \
        -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
        -DLOCALEDIR=\"$(localedir)\"
 
@@ -28,19 +29,23 @@ EXTRA_DIST = m4/gnulib-cache.m4 src/types.lst src/typenames.sed \
 dist_man_MANS = doc/man/cdecl99.1 doc/man/libcdecl.3
 
 include_HEADERS = src/cdecl.h
-noinst_HEADERS = src/typemap.h src/output.h src/scan.h src/parse.h src/i18n.h
+noinst_HEADERS = src/typemap.h src/output.h src/scan.h src/parse.h src/i18n.h \
+       src/error.h
 
 noinst_DATA = $(MOFILES)
 
 lib_LTLIBRARIES = libcdecl.la
-libcdecl_la_LDFLAGS = -export-symbols-regex '^cdecl_[[:lower:]]'
+libcdecl_la_LDFLAGS = -no-undefined \
+       -export-symbols-regex '^cdecl_[[:lower:]]'
 libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.c src/typemap.c \
-       src/output.c src/explain.c src/declare.c src/i18n.c
-libcdecl_la_LIBADD = $(LTLIBINTL) $(LTLIBTHREAD)
+       src/output.c src/explain.c src/declare.c src/i18n.c src/error.c
+libcdecl_la_LIBADD = libgnu.la $(LTLIBINTL) $(LTLIBTHREAD)
+$(libcdecl_la_OBJECTS): $(gnulib_headers)
 
 bin_PROGRAMS = cdecl99
 cdecl99_SOURCES = src/cdecl99.c
-cdecl99_LDADD = libcdecl.la libgnu.la
+cdecl99_LDADD = libcdecl.la libgnu.la $(LTLIBINTL) $(LTLIBREADLINE)
+$(cdecl99_OBJECTS): $(gnulib_headers)
 
 src/parse.lo: src/scan.h
 src/scan.lo: src/parse.h
@@ -64,7 +69,8 @@ MAINTAINERCLEANFILES += po/$(PACKAGE).pot $(ALL_MOFILES)
 XGETTEXT_OPTS = -D $(builddir) -D $(srcdir) --from-code=utf-8 \
        --add-comments=TRANSLATORS: --foreign-user \
        --package-name=$(PACKAGE) --package-version=$(PACKAGE_VERSION) \
-       --msgid-bugs-address=$(PACKAGE_BUGREPORT)
+       --msgid-bugs-address=$(PACKAGE_BUGREPORT) \
+       --keyword=_ --keyword=N_
 
 po/$(PACKAGE).pot: $(SOURCES)
        $(AM_V_at)$(MKDIR_P) $(@D)
@@ -74,7 +80,7 @@ po/$(PACKAGE).pot: $(SOURCES)
        $(AM_V_at)$(MKDIR_P) $(@D)
        $(AM_V_GEN)$(MSGFMT) -c -o $@ $<
 
-install-data-hook: install-mo
+install-data-local: install-mo
 install-mo: $(MOFILES)
        for mo in $?; do \
                lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
@@ -85,13 +91,45 @@ install-mo: $(MOFILES)
                $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo" || exit $$?; \
                set +x; \
        done
-.PHONY: install-mo
+
+installdirs-local: installdirs-mo
+installdirs-mo:
+       for mo in $(MOFILES); do \
+               lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
+               test x"$$lang" = x"" && exit 1; \
+               inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
+               set -x; \
+               $(MKDIR_P) "$$inst" || exit $$?; \
+               set +x; \
+       done
+
+uninstall-local: uninstall-mo
+uninstall-mo:
+       for mo in $(ALL_MOFILES); do \
+               lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
+               test x"$$lang" = x"" && exit 1; \
+               inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
+               set -x; \
+               cd "$$inst" && rm -f '$(PACKAGE).mo'; \
+               set +x; \
+       done
+
+.PHONY: install-mo installdirs-mo uninstall-mo
 
 # These are required to prevent the builtin lex/yacc rules from
 # superseding ours...
 src/scan.c src/scan.h: src/scan.stamp
 src/parse.c src/parse.h: src/parse.stamp
 
+# The flex/bison rules refrain from updating unchanged headers for the
+# convenience of developers, but the headers must be distributed with
+# up-to-date timestamps, otherwise make will try to update them in a fresh
+# VPATH build.
+dist-hook: update-headers
+update-headers:
+       touch -c '$(distdir)/src/scan.h'
+       touch -c '$(distdir)/src/parse.h'
+
 # Supporting rules for bison/flex.
 
 BISON_V   = $(BISON_V_$(V))
@@ -138,3 +176,4 @@ FLEX_V_0 = @echo "  FLEX  " $<;
        fi
 
 include $(top_srcdir)/lib/gnulib.mk
+include $(top_srcdir)/glconfig.mk