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