| 1 | ACLOCAL_AMFLAGS = -I m4 |
|---|
| 2 | |
|---|
| 3 | GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null)) |
|---|
| 4 | VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@) |
|---|
| 5 | -include BUILD_VERSION.mk |
|---|
| 6 | |
|---|
| 7 | FORCE: |
|---|
| 8 | BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE) |
|---|
| 9 | echo 'BUILD_VERSION = $(VERSION)' > $@ |
|---|
| 10 | |
|---|
| 11 | bin_PROGRAMS = bin/barnowl |
|---|
| 12 | if ENABLE_ZCRYPT |
|---|
| 13 | bin_PROGRAMS += zcrypt |
|---|
| 14 | endif |
|---|
| 15 | |
|---|
| 16 | zcrypt_SOURCES = zcrypt.c filterproc.c version.c |
|---|
| 17 | |
|---|
| 18 | check_PROGRAMS = bin/tester |
|---|
| 19 | dist_check_DATA = t |
|---|
| 20 | dist_check_SCRIPTS = runtests.sh |
|---|
| 21 | |
|---|
| 22 | noinst_SCRIPTS = barnowl |
|---|
| 23 | check_SCRIPTS = tester |
|---|
| 24 | |
|---|
| 25 | barnowl tester: %: barnowl-wrapper.in bin/% Makefile |
|---|
| 26 | sed \ |
|---|
| 27 | -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \ |
|---|
| 28 | -e 's,[@]abs_builddir[@],$(abs_builddir),g' \ |
|---|
| 29 | $< > $@ |
|---|
| 30 | chmod +x $@ |
|---|
| 31 | |
|---|
| 32 | bin_barnowl_SOURCES = $(BASE_SRCS) \ |
|---|
| 33 | owl.h owl_perl.h \ |
|---|
| 34 | owl.c |
|---|
| 35 | nodist_bin_barnowl_SOURCES = $(GEN_C) $(GEN_H) |
|---|
| 36 | |
|---|
| 37 | dist_man_MANS = doc/barnowl.1 |
|---|
| 38 | dist_doc_DATA = doc/intro.txt doc/advanced.txt |
|---|
| 39 | |
|---|
| 40 | bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a |
|---|
| 41 | |
|---|
| 42 | bin_tester_SOURCES = $(BASE_SRCS) \ |
|---|
| 43 | owl.h owl_perl.h \ |
|---|
| 44 | tester.c |
|---|
| 45 | nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H) |
|---|
| 46 | |
|---|
| 47 | bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a |
|---|
| 48 | |
|---|
| 49 | TESTS=runtests.sh |
|---|
| 50 | |
|---|
| 51 | AM_CPPFLAGS = \ |
|---|
| 52 | -I$(top_srcdir)/libfaim/ \ |
|---|
| 53 | -DDATADIR='"$(pkgdatadir)"' \ |
|---|
| 54 | -DBINDIR='"$(bindir)"' |
|---|
| 55 | |
|---|
| 56 | CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \ |
|---|
| 57 | commands.c global.c text.c fmtext.c editwin.c \ |
|---|
| 58 | util.c logging.c \ |
|---|
| 59 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
|---|
| 60 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
|---|
| 61 | keypress.c keymap.c keybinding.c cmd.c context.c \ |
|---|
| 62 | aim.c buddy.c buddylist.c style.c errqueue.c \ |
|---|
| 63 | zbuddylist.c popexec.c select.c wcwidth.c \ |
|---|
| 64 | mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c |
|---|
| 65 | |
|---|
| 66 | NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c |
|---|
| 67 | |
|---|
| 68 | BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS) |
|---|
| 69 | |
|---|
| 70 | GEN_C = varstubs.c perlglue.c gmarshal_funcs.c version.c version.c.new |
|---|
| 71 | GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h |
|---|
| 72 | |
|---|
| 73 | BUILT_SOURCES = $(GEN_H) |
|---|
| 74 | |
|---|
| 75 | # Only copy file into place if file.new is different |
|---|
| 76 | owl_prototypes.h version.c: %: %.new |
|---|
| 77 | @diff -U0 $@ $< || { \ |
|---|
| 78 | test -f $@ && echo '$@ changed!'; \ |
|---|
| 79 | echo cp -f $< $@; \ |
|---|
| 80 | cp -f $< $@; } |
|---|
| 81 | |
|---|
| 82 | proto: owl_prototypes.h |
|---|
| 83 | |
|---|
| 84 | perlglue.c: perlglue.xs typemap |
|---|
| 85 | $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@ |
|---|
| 86 | |
|---|
| 87 | varstubs.c: stubgen.pl variable.c |
|---|
| 88 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
|---|
| 89 | |
|---|
| 90 | owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS) |
|---|
| 91 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
|---|
| 92 | |
|---|
| 93 | version.c.new: Makefile BUILD_VERSION.mk |
|---|
| 94 | $(AM_V_GEN)echo 'const char *version = "$(VERSION)";' > $@ |
|---|
| 95 | |
|---|
| 96 | gmarshal_funcs.h: marshal_types |
|---|
| 97 | glib-genmarshal --header $< > $@ |
|---|
| 98 | gmarshal_funcs.c: marshal_types |
|---|
| 99 | glib-genmarshal --body $< > $@ |
|---|
| 100 | |
|---|
| 101 | # For emacs flymake-mode |
|---|
| 102 | check-syntax: proto |
|---|
| 103 | $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES) |
|---|
| 104 | |
|---|
| 105 | CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk |
|---|
| 106 | EXTRA_DIST = \ |
|---|
| 107 | autogen.sh \ |
|---|
| 108 | barnowl-wrapper.in \ |
|---|
| 109 | codelist.pl \ |
|---|
| 110 | doc/code.txt \ |
|---|
| 111 | doc/owl-window.txt \ |
|---|
| 112 | doc/releasing-barnowl.txt \ |
|---|
| 113 | examples \ |
|---|
| 114 | marshal_types \ |
|---|
| 115 | perlglue.xs \ |
|---|
| 116 | scripts \ |
|---|
| 117 | stubgen.pl \ |
|---|
| 118 | typemap |
|---|
| 119 | |
|---|
| 120 | SUBDIRS = compat libfaim perl |
|---|