]> git.draconx.ca Git - gob-dx.git/blob - Makefile.am
Update NEWS to describe new features.
[gob-dx.git] / Makefile.am
1 # Copyright © 2019-2020 Nick Bowler
2 #
3 # Based on original work Copyright © 1999-2013 Jiri (George) Lebl.
4 #
5 # License GPLv2+: GNU General Public License version 2 or any later version.
6 # This is free software: you are free to change and redistribute it.
7 # There is NO WARRANTY, to the extent permitted by law.
8
9 ACLOCAL_AMFLAGS = -I m4 -I common/m4
10
11 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
12               -I$(builddir) -I$(srcdir) -DPKGDATADIR=\"$(pkgdatadir)\"
13 AM_CFLAGS = $(LIBGLIB_CFLAGS)
14 AM_YFLAGS = -d -t
15
16 bin_PROGRAMS = gob2
17
18 EXTRA_DIST = COPYING.GPL3 COPYING.generated-code \
19              examples/GNOME_Foo_SomeInterface.idl examples/README \
20              examples/foo-some-interface.gob examples/gtk-button-count.gob \
21              examples/my-glade-main.c examples/my-glade.glade \
22              examples/my-glade.gob gob2.spec src/generate_treefuncs.pl \
23              src/treefuncs.def src/treefuncs.stamp t/str.gob t/test.gob
24
25 CLEANFILES =
26 DISTCLEANFILES =
27 MAINTAINERCLEANFILES = src/treefuncs.c src/treefuncs.h src/treefuncs.stamp
28
29 EXTRA_PROGRAMS = parser-rdeps
30 parser_rdeps_SOURCES = src/main.c src/lexer.l
31 $(parser_rdeps_OBJECTS): src/parse.h
32
33 noinst_HEADERS = src/main.h src/treefuncs.h src/out.h src/util.h src/checks.h
34
35 gob2_SOURCES = src/main.c src/main.h src/treefuncs.c src/out.c src/util.c \
36                src/checks.c src/parse.y src/lexer.l
37 gob2_LDADD = $(LIBGLIB_LIBS) @LEXLIB@
38 $(gob2_OBJECTS): src/treefuncs.h
39
40 man_MANS = doc/gob2.1
41 EXTRA_DIST += doc/makehtml.pl
42
43 PERL_ERROR = @:; { \
44           printf '%s: ERROR: perl was not available at configure time.\n' "$@"; \
45           printf '%s: If perl is installed but was not detected by configure,\n' "$@"; \
46           printf '%s: consider setting PERL and re-running configure.\n' "$@"; \
47         } 1>&2; false
48
49 src/treefuncs.stamp: src/generate_treefuncs.pl src/treefuncs.def
50 if !HAVE_PERL
51         $(PERL_ERROR)
52 endif
53         $(AM_V_at) $(MKDIR_P) $(@D)
54         $(AM_V_GEN) (cd $(@D) && \
55           $(PERL) $(abs_srcdir)/src/generate_treefuncs.pl \
56                   $(abs_srcdir)/src/treefuncs.def; )
57         $(AM_V_at) touch $@
58
59 .stamp.c:
60         @test -f $@ || { rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; }
61 .stamp.h:
62         @test -f $@ || { rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; }
63
64 html-local: doc/gob2.html
65 doc/gob2.html: doc/gob2.1
66 if !HAVE_PERL
67         $(PERL_ERROR)
68 endif
69         $(AM_V_GEN) $(PERL) $(top_srcdir)/doc/makehtml.pl <doc/gob2.1 >$@.tmp
70         $(AM_V_at) mv -f $@.tmp $@
71 CLEANFILES += doc/gob2.html
72
73 install-html-local: install-gob2-html
74 install-gob2-html: doc/gob2.html
75         $(MKDIR_P) "$(DESTDIR)$(docdir)"
76         $(INSTALL_DATA) doc/gob2.html "$(DESTDIR)$(docdir)/gob2.html"
77 .PHONY: install-gob2-html
78
79 uninstall-local: uninstall-gob2-html
80 uninstall-gob2-html:
81         test ! -d "$(DESTDIR)$(docdir)" || \
82           cd "$(DESTDIR)$(docdir)" && rm -f gob2.html
83 .PHONY: uninstall-gob2-html
84
85 m4dir = $(datadir)/aclocal
86 m4_DATA = gob2.m4
87
88 gob2.m4: $(top_srcdir)/common/m4/gob2.m4
89         $(AM_V_GEN) $(SED) 's/DX_PROG_GOB2/GOB2_CHECK/g' \
90           $(top_srcdir)/common/m4/gob2.m4 >$@.tmp
91         $(AM_V_at) mv -f $@.tmp $@
92 DISTCLEANFILES += gob2.m4
93 EXTRA_DIST += common/m4/gob2.m4
94
95 git_changelog_start = 2cd951c678998b2b0230c8eb25717ecf0f1dd2db
96 dist-hook: generate-changelog
97 generate-changelog:
98         -: "$${GIT_DIR=$(top_srcdir)/.git}"; \
99           test -d "$$GIT_DIR" || exit 0; { \
100             $(PERL) -x $(top_srcdir)/build-aux/gitlog-to-changelog -- \
101               $(git_changelog_start).. && \
102             echo && \
103             git show $(git_changelog_start):ChangeLog; \
104           } >$(distdir)/ChangeLog.gen && \
105           mv -f $(distdir)/ChangeLog.gen $(distdir)/ChangeLog
106         rm -f $(distdir)/ChangeLog.gen
107 .PHONY: generate-changelog
108
109 GENERIC_V   = $(GENERIC_V_@AM_V@)
110 GENERIC_V_  = $(GENERIC_V_@AM_DEFAULT_V@)
111 GENERIC_V_0 = @printf '%2.0s%$(DX_ALIGN_V)s %s\n'
112
113 TEST_DISTRIBUTION = false
114 TEST_DISTRIBUTION_OR_ERROR = if $(TEST_DISTRIBUTION); \
115   then echo 'Proceeding anyway...'; \
116   else echo 'Run $(MAKE) TEST_DISTRIBUTION=true to ignore this failure.'; \
117        false; \
118   fi
119
120 distcheck-hook:
121         $(GENERIC_V) : 'CHECK   ' ChangeLog; \
122           $(AWK) '/^Stub/ { print FILENAME ":" NR ":", $$0; exit 1 }' \
123             $(distdir)/ChangeLog || { \
124               echo 'ERROR: *** Packaged ChangeLog was not properly generated from git log.'; \
125               echo '       *** The source version was used instead, but this appears to'; \
126               echo '       *** be the stub from a git checkout.  The "git" and "perl"'; \
127               echo '       *** programs are required for ChangeLog generation to work.'; \
128               $(TEST_DISTRIBUTION_OR_ERROR); } >&2
129         $(GENERIC_V) : 'CHECK   ' NEWS; \
130           $(AWK) -F: 'NR == 1 && $$1 != "$(PACKAGE_VERSION)" \
131             { print FILENAME ":" NR ":", $$0; exit 1}' \
132             $(distdir)/NEWS || { \
133               echo 'ERROR: *** First line of NEWS should match the package version'; \
134               echo '       *** $(PACKAGE_VERSION), but that does not appear to be the case.'; \
135               echo '       *** Remember to update NEWS before preparing a release.'; \
136               $(TEST_DISTRIBUTION_OR_ERROR); } >&2
137
138 include $(top_srcdir)/common/snippet/autotest.mk