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