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