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