[1aee7d9] | 1 | # $Id$ |
---|
| 2 | |
---|
[ac70242] | 3 | srcdir = @srcdir@ |
---|
| 4 | VPATH = @srcdir@ |
---|
| 5 | prefix = @prefix@ |
---|
| 6 | exec_prefix = @exec_prefix@ |
---|
[7ce4003] | 7 | datarootdir = @datarootdir@ |
---|
[3354cea5] | 8 | datadir = @datadir@/barnowl |
---|
[ac70242] | 9 | bindir = @bindir@ |
---|
| 10 | mandir = @mandir@ |
---|
[c50f589] | 11 | transform = @program_transform_name@ |
---|
[ac70242] | 12 | |
---|
[7d4fbcd] | 13 | CC=@CC@ |
---|
[d09e5a1] | 14 | LIBS=@LIBS@ -L./libfaim -lfaim |
---|
[7e78e49] | 15 | CFLAGS=@CFLAGS@ -I./libfaim -DDATADIR=\"${datadir}\" |
---|
[7d4fbcd] | 16 | LDFLAGS=@LDFLAGS@ |
---|
[15bd5ef] | 17 | XSUBPPDIR=@XSUBPPDIR@ |
---|
[4ad3480] | 18 | XSUBPPFLAGS=@XSUBPPFLAGS@ |
---|
[aaf6071] | 19 | INSTALL=@INSTALL@ |
---|
| 20 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
---|
| 21 | INSTALL_DATA=@INSTALL_DATA@ |
---|
[7ccc780] | 22 | ATHSTATIC=@ATHSTATIC@ |
---|
[aaf6071] | 23 | |
---|
| 24 | BASE_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \ |
---|
| 25 | commands.c global.c text.c fmtext.c editwin.c util.c logging.c \ |
---|
[f1e629d] | 26 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
[aaf6071] | 27 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
[aa5f725] | 28 | keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ |
---|
[b7bb454] | 29 | aim.c buddy.c buddylist.c style.c errqueue.c \ |
---|
[df7f364] | 30 | zbuddylist.c popexec.c obarray.c select.c wcwidth.c \ |
---|
[5f3168a] | 31 | glib_compat.c |
---|
[aaf6071] | 32 | OWL_SRC = owl.c |
---|
| 33 | TESTER_SRC = tester.c |
---|
| 34 | |
---|
[d5ef539] | 35 | EXE = barnowl.bin |
---|
[1375a6a] | 36 | PERL_MODULES = Jabber IRC WordWrap |
---|
[b547aa4] | 37 | MODULE_DIRS = $(PERL_MODULES:%=perl/modules/%) |
---|
[3354cea5] | 38 | |
---|
[aaf6071] | 39 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
[7d4fbcd] | 40 | |
---|
[fd8dfe7] | 41 | GEN_C = varstubs.c perlglue.c |
---|
[aaf6071] | 42 | GEN_H = owl_prototypes.h |
---|
| 43 | GEN_O = $(GEN_C:.c=.o) |
---|
| 44 | |
---|
| 45 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
| 46 | |
---|
[0ff8fb57] | 47 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
| 48 | #AUTOGEN=$(GEN_C) |
---|
[7d4fbcd] | 49 | |
---|
[5fdab77] | 50 | HEADERS=$(GEN_H) owl.h owl_perl.h config.h test.h |
---|
[07f715f] | 51 | |
---|
[84d48cc] | 52 | all: $(EXE) $(MODULE_DIRS) |
---|
| 53 | |
---|
[7f1f1e7] | 54 | $(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
[7ccc780] | 55 | $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 56 | |
---|
[3381399] | 57 | tester: $(AUTOGEN) $(OBJS) tester.o libfaim |
---|
[7ccc780] | 58 | $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 59 | |
---|
[50558dc] | 60 | %.o: %.c $(HEADERS) |
---|
| 61 | $(CC) -c $(CFLAGS) $< -o $@ |
---|
| 62 | |
---|
| 63 | # zcrypt is old crufty DES code I don't want to touch |
---|
| 64 | # Disable all warnings when compiling it |
---|
| 65 | zcrypt.o: zcrypt.c $(HEADERS) |
---|
| 66 | $(CC) -c $(CFLAGS) $< -w -o $@ |
---|
| 67 | |
---|
[7d4fbcd] | 68 | test: tester |
---|
| 69 | ./tester reg |
---|
| 70 | |
---|
[b547aa4] | 71 | clean: libfaimclean modules_clean |
---|
[3354cea5] | 72 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
[7d4fbcd] | 73 | |
---|
[d09e5a1] | 74 | distclean: clean libfaimdistclean |
---|
[42c33a6] | 75 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
[7d4fbcd] | 76 | |
---|
[af193338] | 77 | .PHONY: $(MODULE_DIRS) $(MODULE_DIRS:%=clean_%) |
---|
[b547aa4] | 78 | |
---|
| 79 | modules: $(MODULE_DIRS) |
---|
[af193338] | 80 | modules_clean: $(MODULE_DIRS:%=clean_%) |
---|
[b547aa4] | 81 | |
---|
| 82 | $(MODULE_DIRS): %: %/Makefile |
---|
[30ac47f] | 83 | ( cd $@ && $(MAKE) $(notdir $@).par ) |
---|
[b547aa4] | 84 | |
---|
| 85 | $(MODULE_DIRS:=/Makefile): %/Makefile: %/Makefile.PL |
---|
| 86 | ( cd $(dir $@) && perl -I../../lib Makefile.PL ) |
---|
| 87 | |
---|
[af193338] | 88 | $(MODULE_DIRS:%=clean_%): clean_%: |
---|
| 89 | (cd $* && (test ! -f Makefile || $(MAKE) clean)) |
---|
| 90 | |
---|
[0ff8fb57] | 91 | proto: owl_prototypes.h |
---|
[7d4fbcd] | 92 | |
---|
[11be665] | 93 | perlglue.c: perlglue.xs Makefile |
---|
[15bd5ef] | 94 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
[7d4fbcd] | 95 | |
---|
| 96 | varstubs.c: variable.c stubgen.pl |
---|
| 97 | perl stubgen.pl > varstubs.c |
---|
| 98 | |
---|
[aaf6071] | 99 | # Only move owl_prototypes.h into place if the new one is different |
---|
[0ff8fb57] | 100 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
| 101 | perl codelist.pl > owl_prototypes.h.new |
---|
| 102 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
[8c92848] | 103 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
[0ff8fb57] | 104 | echo mv -f owl_prototypes.h.new $@; \ |
---|
| 105 | mv -f owl_prototypes.h.new $@; } |
---|
| 106 | #owl_prototypes.h: |
---|
[aaf6071] | 107 | |
---|
[d5ebf3a] | 108 | .PHONY: tags clean distclean proto test check-syntax |
---|
[aaf6071] | 109 | |
---|
| 110 | tags: TAGS |
---|
| 111 | |
---|
| 112 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 113 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 114 | |
---|
[50558dc] | 115 | $(BASE_OBJS) varstubs.h: owl.h config.h owl_prototypes.h |
---|
[d09e5a1] | 116 | |
---|
| 117 | libfaim: libfaim/libfaim.a |
---|
| 118 | |
---|
| 119 | libfaim/libfaim.a: |
---|
[30ac47f] | 120 | (cd libfaim && $(MAKE)) |
---|
[d09e5a1] | 121 | |
---|
| 122 | libfaimclean: |
---|
[30ac47f] | 123 | (cd libfaim && $(MAKE) clean) |
---|
[d09e5a1] | 124 | |
---|
| 125 | libfaimdistclean: |
---|
[30ac47f] | 126 | (cd libfaim && $(MAKE) distclean) |
---|
[aaf6071] | 127 | |
---|
[af193338] | 128 | install: all installdirs $(PERL_MODULES:%=module_install_%) |
---|
[c50f589] | 129 | ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/`echo barnowl|sed '$(transform)'` |
---|
[2c90da9] | 130 | ${INSTALL_DATA} doc/barnowl.1 ${DESTDIR}${mandir}/man1/barnowl.1 |
---|
[8e9acd2] | 131 | (cd perl/lib && tar --exclude .svn -cf - . ) | (cd ${DESTDIR}${datadir}/lib && tar -xf - ) |
---|
[ac70242] | 132 | |
---|
| 133 | installdirs: mkinstalldirs |
---|
[af193338] | 134 | ${srcdir}/mkinstalldirs \ |
---|
| 135 | ${DESTDIR}${bindir} \ |
---|
| 136 | ${DESTDIR}${mandir}/man1 \ |
---|
| 137 | ${DESTDIR}${datadir}/lib \ |
---|
| 138 | ${DESTDIR}${datadir}/modules |
---|
| 139 | |
---|
| 140 | .PHONY: $(PERL_MODULES:%=module_install_%) |
---|
| 141 | |
---|
| 142 | $(PERL_MODULES:%=module_install_%): module_install_%: installdirs |
---|
| 143 | ${INSTALL_DATA} perl/modules/$*/$*.par ${DESTDIR}${datadir}/modules/$*.par |
---|
[d5ebf3a] | 144 | |
---|
| 145 | # For emacs flymake-mode |
---|
| 146 | check-syntax: proto |
---|
| 147 | $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES) |
---|