1 | ACLOCAL_AMFLAGS = -I m4 |
---|
2 | CFLAGS += $(EXTRA_CFLAGS) |
---|
3 | |
---|
4 | GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null)) |
---|
5 | GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%)) |
---|
6 | |
---|
7 | bin_PROGRAMS = barnowl.bin |
---|
8 | if ENABLE_ZCRYPT |
---|
9 | bin_PROGRAMS += zcrypt |
---|
10 | endif |
---|
11 | |
---|
12 | zcrypt_SOURCES = zcrypt.c filterproc.c |
---|
13 | |
---|
14 | check_PROGRAMS = tester perl_tester |
---|
15 | |
---|
16 | barnowl_bin_SOURCES = $(BASE_SRCS) \ |
---|
17 | owl.h owl_perl.h config.h \ |
---|
18 | owl.c \ |
---|
19 | $(GEN_C) $(GEN_H) |
---|
20 | |
---|
21 | barnowl_bin_LDADD = libfaim/libfaim.a |
---|
22 | |
---|
23 | tester_SOURCES = $(BASE_SRCS) \ |
---|
24 | owl.h owl_perl.h config.h \ |
---|
25 | $(GEN_C) $(GEN_H) \ |
---|
26 | tester.c |
---|
27 | |
---|
28 | tester_LDADD = libfaim/libfaim.a |
---|
29 | |
---|
30 | perl_tester_SOURCES = $(BASE_SRCS) \ |
---|
31 | owl.h owl_perl.h config.h \ |
---|
32 | $(GEN_C) $(GEN_H) \ |
---|
33 | perl_tester.c |
---|
34 | |
---|
35 | perl_tester_LDADD = libfaim/libfaim.a |
---|
36 | |
---|
37 | TESTS=runtests.sh |
---|
38 | |
---|
39 | CPPFLAGS = -I$(top_srcdir)/ \ |
---|
40 | -I$(top_srcdir)/libfaim/ \ |
---|
41 | -DDATADIR='"$(pkgdatadir)"' \ |
---|
42 | -DBINDIR='"$(bindir)"' \ |
---|
43 | $(GIT_FLAGS) |
---|
44 | |
---|
45 | CODELIST_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \ |
---|
46 | commands.c global.c text.c fmtext.c editwin.c util.c logging.c \ |
---|
47 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
48 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
49 | keypress.c keymap.c keybinding.c cmd.c context.c \ |
---|
50 | aim.c buddy.c buddylist.c style.c errqueue.c \ |
---|
51 | zbuddylist.c popexec.c select.c wcwidth.c \ |
---|
52 | glib_compat.c mainpanel.c msgwin.c sepbar.c |
---|
53 | |
---|
54 | NORMAL_SRCS = filterproc.c window.c |
---|
55 | |
---|
56 | BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS) |
---|
57 | |
---|
58 | GEN_C = varstubs.c perlglue.c globalnotifier.c |
---|
59 | GEN_H = owl_prototypes.h |
---|
60 | |
---|
61 | BUILT_SOURCES = $(GEN_C) $(GEN_H) |
---|
62 | |
---|
63 | # Only copy file into place if file.new is different |
---|
64 | %: %.new |
---|
65 | @diff -U0 $@ $< || { \ |
---|
66 | test -f $@ && echo '$@ changed!'; \ |
---|
67 | echo cp -f $< $@; \ |
---|
68 | cp -f $< $@; } |
---|
69 | |
---|
70 | proto: owl_prototypes.h |
---|
71 | |
---|
72 | perlglue.c: perlglue.xs $(TYPEMAP) |
---|
73 | $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
74 | |
---|
75 | varstubs.c: stubgen.pl variable.c |
---|
76 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
---|
77 | |
---|
78 | globalnotifier.c: globalnotifiergen.pl variable.c |
---|
79 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
---|
80 | |
---|
81 | owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS) |
---|
82 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
---|
83 | |
---|
84 | # For emacs flymake-mode |
---|
85 | check-syntax: proto |
---|
86 | $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES) |
---|
87 | |
---|
88 | install-data-local: |
---|
89 | $(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib |
---|
90 | (cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - ) |
---|
91 | |
---|
92 | do_transform = $(shell echo '$(1)' | sed '$(transform)') |
---|
93 | install-exec-hook: |
---|
94 | mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \ |
---|
95 | $(DESTDIR)$(bindir)/$(call do_transform,barnowl) |
---|
96 | |
---|
97 | SUBDIRS = libfaim perl |
---|