[eddee7e] | 1 | ACLOCAL_AMFLAGS = -I m4 |
---|
[c45e1eb] | 2 | CFLAGS += $(EXTRA_CFLAGS) |
---|
[8073852] | 3 | |
---|
[89982ec] | 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-%=%)) |
---|
[8df704f] | 6 | |
---|
[37f27bc] | 7 | bin_PROGRAMS = barnowl.bin |
---|
[7d03c8d] | 8 | if ENABLE_ZCRYPT |
---|
| 9 | bin_PROGRAMS += zcrypt |
---|
| 10 | endif |
---|
| 11 | |
---|
| 12 | zcrypt_SOURCES = zcrypt.c filterproc.c |
---|
| 13 | |
---|
[42ad917] | 14 | check_PROGRAMS = tester perl_tester |
---|
[37f27bc] | 15 | |
---|
| 16 | barnowl_bin_SOURCES = $(BASE_SRCS) \ |
---|
[0b65bd7] | 17 | owl.h owl_perl.h config.h \ |
---|
[ae333f0] | 18 | owl.c \ |
---|
[37f27bc] | 19 | $(GEN_C) $(GEN_H) |
---|
| 20 | |
---|
[191d5e7] | 21 | barnowl_bin_LDADD = libfaim/libfaim.a |
---|
[37f27bc] | 22 | |
---|
[0b65bd7] | 23 | tester_SOURCES = $(BASE_SRCS) \ |
---|
[8bce750] | 24 | owl.h owl_perl.h config.h \ |
---|
[0b65bd7] | 25 | $(GEN_C) $(GEN_H) \ |
---|
| 26 | tester.c |
---|
| 27 | |
---|
[191d5e7] | 28 | tester_LDADD = libfaim/libfaim.a |
---|
[d851bbc] | 29 | |
---|
[42ad917] | 30 | perl_tester_SOURCES = $(BASE_SRCS) \ |
---|
| 31 | owl.h owl_perl.h config.h \ |
---|
| 32 | $(GEN_C) $(GEN_H) \ |
---|
| 33 | perl_tester.c |
---|
| 34 | |
---|
[b373d44] | 35 | perl_tester_LDADD = libfaim/libfaim.a |
---|
[42ad917] | 36 | |
---|
[2fa9a1a0] | 37 | TESTS=runtests.sh |
---|
| 38 | |
---|
[37f27bc] | 39 | CPPFLAGS = -I$(top_srcdir)/ \ |
---|
[8df704f] | 40 | -I$(top_srcdir)/libfaim/ \ |
---|
[858c9c4] | 41 | -DDATADIR='"$(pkgdatadir)"' \ |
---|
[5a57386] | 42 | -DBINDIR='"$(bindir)"' \ |
---|
[8df704f] | 43 | $(GIT_FLAGS) |
---|
[37f27bc] | 44 | |
---|
[37f9818] | 45 | CODELIST_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \ |
---|
[37f27bc] | 46 | commands.c global.c text.c fmtext.c editwin.c util.c logging.c \ |
---|
| 47 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
| 48 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
[d564c3d] | 49 | keypress.c keymap.c keybinding.c cmd.c context.c \ |
---|
[37f27bc] | 50 | aim.c buddy.c buddylist.c style.c errqueue.c \ |
---|
[e96b4ce] | 51 | zbuddylist.c popexec.c select.c wcwidth.c \ |
---|
[37f9818] | 52 | glib_compat.c |
---|
| 53 | |
---|
[e96b4ce] | 54 | NORMAL_SRCS = filterproc.c window.c |
---|
[37f9818] | 55 | |
---|
| 56 | BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS) |
---|
[37f27bc] | 57 | |
---|
| 58 | GEN_C = varstubs.c perlglue.c |
---|
| 59 | GEN_H = owl_prototypes.h |
---|
| 60 | |
---|
| 61 | BUILT_SOURCES = $(GEN_C) $(GEN_H) |
---|
| 62 | |
---|
[1ad4a4a] | 63 | # Only copy file into place if file.new is different |
---|
| 64 | %: %.new |
---|
| 65 | @diff -U0 $@ $< || { \ |
---|
| 66 | test -f $@ && echo '$@ changed!'; \ |
---|
| 67 | echo cp -f $< $@; \ |
---|
| 68 | cp -f $< $@; } |
---|
| 69 | |
---|
[37f27bc] | 70 | proto: owl_prototypes.h |
---|
| 71 | |
---|
[39e81f7] | 72 | perlglue.c: perlglue.xs $(TYPEMAP) |
---|
[5b376388] | 73 | $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
[37f27bc] | 74 | |
---|
[df49ff6] | 75 | varstubs.c: stubgen.pl variable.c |
---|
[76f0e19] | 76 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
---|
[37f27bc] | 77 | |
---|
[37f9818] | 78 | owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS) |
---|
[76f0e19] | 79 | $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@ |
---|
[37f27bc] | 80 | |
---|
| 81 | # For emacs flymake-mode |
---|
| 82 | check-syntax: proto |
---|
| 83 | $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES) |
---|
| 84 | |
---|
| 85 | install-data-local: |
---|
| 86 | $(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib |
---|
| 87 | (cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - ) |
---|
| 88 | |
---|
| 89 | do_transform = $(shell echo '$(1)' | sed '$(transform)') |
---|
| 90 | install-exec-hook: |
---|
| 91 | mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \ |
---|
| 92 | $(DESTDIR)$(bindir)/$(call do_transform,barnowl) |
---|
| 93 | |
---|
[10557e6] | 94 | SUBDIRS = libfaim perl |
---|