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