source: Makefile.am @ eb5e8fc

Last change on this file since eb5e8fc was eb5e8fc, checked in by Anders Kaseorg <andersk@mit.edu>, 8 years ago
Allow building in a separate build directory Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 3.0 KB
Line 
1ACLOCAL_AMFLAGS = -I m4
2
3GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null))
4GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
5
6bin_PROGRAMS = barnowl.bin
7if ENABLE_ZCRYPT
8bin_PROGRAMS += zcrypt
9endif
10
11zcrypt_SOURCES = zcrypt.c filterproc.c
12
13check_PROGRAMS = tester.bin
14dist_check_DATA = t
15dist_check_SCRIPTS = runtests.sh
16
17barnowl_bin_SOURCES = $(BASE_SRCS) \
18     owl.h owl_perl.h config.h \
19     owl.c \
20     $(GEN_C) $(GEN_H)
21
22dist_man_MANS = doc/barnowl.1
23dist_doc_DATA = doc/intro.txt doc/advanced.txt
24
25barnowl_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
26
27tester_bin_SOURCES = $(BASE_SRCS) \
28     owl.h owl_perl.h config.h \
29     $(GEN_C) $(GEN_H) \
30     tester.c
31
32tester_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
33
34TESTS=runtests.sh
35
36AM_CPPFLAGS = \
37           -I$(top_srcdir)/libfaim/ \
38           -DDATADIR='"$(pkgdatadir)"' \
39           -DBINDIR='"$(bindir)"' \
40           $(GIT_FLAGS)
41
42CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
43     commands.c global.c text.c fmtext.c editwin.c \
44     util.c logging.c \
45     perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
46     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
47     keypress.c keymap.c keybinding.c cmd.c context.c \
48     aim.c buddy.c buddylist.c style.c errqueue.c \
49     zbuddylist.c popexec.c select.c wcwidth.c \
50     mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
51
52NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c
53
54BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
55
56GEN_C = varstubs.c perlglue.c gmarshal_funcs.c
57GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
58
59BUILT_SOURCES = $(GEN_C) $(GEN_H)
60
61# Only copy file into place if file.new is different
62%: %.new
63        @diff -U0 $@ $< || { \
64         test -f $@ && echo '$@ changed!'; \
65         echo cp -f $< $@; \
66              cp -f $< $@; }
67
68proto: owl_prototypes.h
69
70perlglue.c: perlglue.xs typemap
71        $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@
72
73varstubs.c: stubgen.pl variable.c
74        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
75
76owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS)
77        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
78
79gmarshal_funcs.h: marshal_types
80        glib-genmarshal --header $< > $@
81gmarshal_funcs.c: marshal_types
82        glib-genmarshal --body $< > $@
83
84# For emacs flymake-mode
85check-syntax: proto
86        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
87
88do_transform = $(shell echo '$(1)' | sed '$(transform)')
89install-exec-hook:
90        mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \
91              $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
92
93uninstall-local:
94        rm -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
95
96CLEANFILES = $(BUILT_SOURCES)
97EXTRA_DIST = \
98    autogen.sh \
99    barnowl \
100    codelist.pl \
101    doc \
102    examples \
103    marshal_types \
104    perlglue.xs \
105    scripts \
106    stubgen.pl \
107    tester \
108    typemap
109
110SUBDIRS = compat libfaim perl
Note: See TracBrowser for help on using the repository browser.