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