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