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