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