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