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