]> git.draconx.ca Git - gob-dx.git/blob - Makefile.am
Modernize build system a bit.
[gob-dx.git] / Makefile.am
1 # Copyright © 2019 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 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
10               -I$(builddir) -I$(srcdir) -DPKGDATADIR=\"$(pkgdatadir)\"
11 AM_CFLAGS = $(GLIB_CFLAGS)
12 AM_YFLAGS = -d -t
13
14 bin_PROGRAMS = gob2
15
16 EXTRA_DIST = COPYING.generated-code examples/GNOME_Foo_SomeInterface.idl \
17              examples/README examples/foo-some-interface.gob \
18              examples/gtk-button-count.gob examples/my-glade-main.c \
19              examples/my-glade.glade examples/my-glade.gob gob2.spec \
20              src/treefuncs.c src/treefuncs.h src/treefuncs.stamp \
21              src/treefuncs.def src/generate_treefuncs.pl
22
23 CLEANFILES =
24 DISTCLEANFILES =
25 MAINTAINERCLEANFILES = src/treefuncs.c src/treefuncs.h src/treefuncs.stamp
26
27 EXTRA_PROGRAMS = parser-rdeps
28 parser_rdeps_SOURCES = src/main.c src/lexer.l
29 $(parser_rdeps_OBJECTS): src/parse.h
30
31 noinst_HEADERS = src/main.h src/treefuncs.h src/out.h src/util.h src/checks.h
32
33 gob2_SOURCES = src/main.c src/main.h src/treefuncs.c src/out.c src/util.c \
34                src/checks.c src/parse.y src/lexer.l
35 gob2_LDADD = $(GLIB_LIBS) @LEXLIB@
36 $(gob2_OBJECTS): src/treefuncs.h
37
38 man_MANS = doc/gob2.1
39 EXTRA_DIST += doc/makehtml.pl
40
41 PERL_ERROR = @:; { \
42           printf '%s: ERROR: perl was not available at configure time.\n' "$@"; \
43           printf '%s: If perl is installed but was not detected by configure,\n' "$@"; \
44           printf '%s: consider setting PERL and re-running configure.\n' "$@"; \
45         } 1>&2; false
46
47 src/treefuncs.stamp: src/generate_treefuncs.pl src/treefuncs.def
48 if !HAVE_PERL
49         $(PERL_ERROR)
50 endif
51         $(AM_V_at) $(MKDIR_P) $(@D)
52         $(AM_V_GEN) (cd $(@D) && \
53           $(PERL) $(abs_srcdir)/src/generate_treefuncs.pl \
54                   $(abs_srcdir)/src/treefuncs.def; )
55         $(AM_V_at) touch $@
56
57 .stamp.c:
58         @test -f $@ || { rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; }
59 .stamp.h:
60         @test -f $@ || { rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; }
61
62 html-local: doc/gob2.html
63 doc/gob2.html: doc/gob2.1
64 if !HAVE_PERL
65         $(PERL_ERROR)
66 endif
67         $(AM_V_GEN) $(PERL) $(top_srcdir)/doc/makehtml.pl <doc/gob2.1 >$@.tmp
68         $(AM_V_at) mv -f $@.tmp $@
69 CLEANFILES += doc/gob2.html
70
71 install-html-local: install-gob2-html
72 install-gob2-html: doc/gob2.html
73         $(MKDIR_P) "$(DESTDIR)$(docdir)"
74         $(INSTALL_DATA) doc/gob2.html "$(DESTDIR)$(docdir)/gob2.html"
75 .PHONY: install-gob2-html
76
77 uninstall-local: uninstall-gob2-html
78 uninstall-gob2-html:
79         test ! -d "$(DESTDIR)$(docdir)" || \
80           cd "$(DESTDIR)$(docdir)" && rm -f gob2.html
81 .PHONY: uninstall-gob2-html
82
83 m4dir = $(datadir)/aclocal
84 dist_m4_DATA = gob2.m4