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