source: Makefile.am @ 574b952

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