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