source: Makefile.am @ 7ff3907

release-1.10
Last change on this file since 7ff3907 was ca1fb26a, checked in by Anders Kaseorg <andersk@mit.edu>, 11 years ago
Be smarter about rebuilding on version number changes Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 3.4 KB
Line 
1ACLOCAL_AMFLAGS = -I m4
2
3GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null))
4VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@)
5-include BUILD_VERSION.mk
6
7FORCE:
8BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE)
9        echo 'BUILD_VERSION = $(VERSION)' > $@
10
11bin_PROGRAMS = bin/barnowl
12if ENABLE_ZCRYPT
13bin_PROGRAMS += zcrypt
14endif
15
16zcrypt_SOURCES = zcrypt.c filterproc.c version.c
17
18check_PROGRAMS = bin/tester
19dist_check_DATA = t
20dist_check_SCRIPTS = runtests.sh
21
22noinst_SCRIPTS = barnowl
23check_SCRIPTS = tester
24
25barnowl tester: %: barnowl-wrapper.in bin/% Makefile
26        sed \
27            -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \
28            -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
29            $< > $@
30        chmod +x $@
31
32bin_barnowl_SOURCES = $(BASE_SRCS) \
33     owl.h owl_perl.h \
34     owl.c
35nodist_bin_barnowl_SOURCES = $(GEN_C) $(GEN_H)
36
37dist_man_MANS = doc/barnowl.1
38dist_doc_DATA = doc/intro.txt doc/advanced.txt
39
40bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a
41
42bin_tester_SOURCES = $(BASE_SRCS) \
43     owl.h owl_perl.h \
44     tester.c
45nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H)
46
47bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a
48
49TESTS=runtests.sh
50
51AM_CPPFLAGS = \
52           -I$(top_srcdir)/libfaim/ \
53           -DDATADIR='"$(pkgdatadir)"' \
54           -DBINDIR='"$(bindir)"'
55
56CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
57     commands.c global.c text.c fmtext.c editwin.c \
58     util.c logging.c \
59     perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
60     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
61     keypress.c keymap.c keybinding.c cmd.c context.c \
62     aim.c buddy.c buddylist.c style.c errqueue.c \
63     zbuddylist.c popexec.c select.c wcwidth.c \
64     mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
65
66NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c
67
68BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
69
70GEN_C = varstubs.c perlglue.c gmarshal_funcs.c version.c version.c.new
71GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
72
73BUILT_SOURCES = $(GEN_H)
74
75# Only copy file into place if file.new is different
76owl_prototypes.h version.c: %: %.new
77        @diff -U0 $@ $< || { \
78         test -f $@ && echo '$@ changed!'; \
79         echo cp -f $< $@; \
80              cp -f $< $@; }
81
82proto: owl_prototypes.h
83
84perlglue.c: perlglue.xs typemap
85        $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@
86
87varstubs.c: stubgen.pl variable.c
88        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
89
90owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS)
91        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
92
93version.c.new: Makefile BUILD_VERSION.mk
94        $(AM_V_GEN)echo 'const char *version = "$(VERSION)";' > $@
95
96gmarshal_funcs.h: marshal_types
97        glib-genmarshal --header $< > $@
98gmarshal_funcs.c: marshal_types
99        glib-genmarshal --body $< > $@
100
101# For emacs flymake-mode
102check-syntax: proto
103        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
104
105CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk
106EXTRA_DIST = \
107    autogen.sh \
108    barnowl-wrapper.in \
109    codelist.pl \
110    doc/code.txt \
111    doc/owl-window.txt \
112    doc/releasing-barnowl.txt \
113    examples \
114    marshal_types \
115    perlglue.xs \
116    scripts \
117    stubgen.pl \
118    typemap
119
120SUBDIRS = compat libfaim perl
Note: See TracBrowser for help on using the repository browser.