[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 |
---|
| 13 | CFLAGS=@CFLAGS@ -I. -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@ |
---|
| 20 | |
---|
| 21 | BASE_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \ |
---|
| 22 | commands.c global.c text.c fmtext.c editwin.c util.c logging.c \ |
---|
[f1e629d] | 23 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
[aaf6071] | 24 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
[aa5f725] | 25 | keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ |
---|
[5a95b69] | 26 | aim.c buddy.c buddylist.c timer.c style.c stylefunc.c errqueue.c \ |
---|
[afbf668] | 27 | zbuddylist.c muxevents.c popexec.c |
---|
[aaf6071] | 28 | OWL_SRC = owl.c |
---|
| 29 | TESTER_SRC = tester.c |
---|
| 30 | |
---|
[3354cea5] | 31 | EXE = barnowl |
---|
| 32 | |
---|
[aaf6071] | 33 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
[7d4fbcd] | 34 | |
---|
[f1e629d] | 35 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
[aaf6071] | 36 | GEN_H = owl_prototypes.h |
---|
| 37 | GEN_O = $(GEN_C:.c=.o) |
---|
| 38 | |
---|
| 39 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
| 40 | |
---|
[0ff8fb57] | 41 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
| 42 | #AUTOGEN=$(GEN_C) |
---|
[7d4fbcd] | 43 | |
---|
| 44 | |
---|
[d09e5a1] | 45 | owl: $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
[3354cea5] | 46 | ./athstatic $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 47 | |
---|
[094009a] | 48 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
| 49 | ./athstatic $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 50 | |
---|
| 51 | test: tester |
---|
| 52 | ./tester reg |
---|
| 53 | |
---|
[d09e5a1] | 54 | clean: libfaimclean |
---|
[3354cea5] | 55 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
[7d4fbcd] | 56 | |
---|
[d09e5a1] | 57 | distclean: clean libfaimdistclean |
---|
[e9b1f60] | 58 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
[7d4fbcd] | 59 | |
---|
[0ff8fb57] | 60 | proto: owl_prototypes.h |
---|
[7d4fbcd] | 61 | |
---|
[11be665] | 62 | perlglue.c: perlglue.xs Makefile |
---|
[15bd5ef] | 63 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
[7d4fbcd] | 64 | |
---|
| 65 | varstubs.c: variable.c stubgen.pl |
---|
| 66 | perl stubgen.pl > varstubs.c |
---|
| 67 | |
---|
[f1e629d] | 68 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
| 69 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
| 70 | |
---|
[aaf6071] | 71 | # Only move owl_prototypes.h into place if the new one is different |
---|
[0ff8fb57] | 72 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
| 73 | perl codelist.pl > owl_prototypes.h.new |
---|
| 74 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
[8c92848] | 75 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
[0ff8fb57] | 76 | echo mv -f owl_prototypes.h.new $@; \ |
---|
| 77 | mv -f owl_prototypes.h.new $@; } |
---|
| 78 | #owl_prototypes.h: |
---|
[aaf6071] | 79 | |
---|
| 80 | .PHONY: tags clean distclean proto test |
---|
| 81 | |
---|
| 82 | tags: TAGS |
---|
| 83 | |
---|
| 84 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 85 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 86 | |
---|
[0ff8fb57] | 87 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
| 88 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
[d09e5a1] | 89 | |
---|
| 90 | libfaim: libfaim/libfaim.a |
---|
| 91 | |
---|
| 92 | libfaim/libfaim.a: |
---|
| 93 | (cd libfaim; $(MAKE)) |
---|
| 94 | |
---|
| 95 | libfaimclean: |
---|
| 96 | (cd libfaim; $(MAKE) clean) |
---|
| 97 | |
---|
| 98 | libfaimdistclean: |
---|
| 99 | (cd libfaim; $(MAKE) distclean) |
---|
[aaf6071] | 100 | |
---|
[3354cea5] | 101 | all: $(EXE) |
---|
[ac70242] | 102 | |
---|
| 103 | install: all installdirs |
---|
[3354cea5] | 104 | ${INSTALL_PROGRAM} $(EXE) ${bindir}/$(EXE) |
---|
| 105 | ${INSTALL_DATA} doc/owl.1 ${mandir}/man1/barnowl.1 |
---|
| 106 | tar -C perl -c . | tar -C ${datadir} -x |
---|
[ac70242] | 107 | |
---|
| 108 | installdirs: mkinstalldirs |
---|
[3354cea5] | 109 | ${srcdir}/mkinstalldirs ${bindir} ${mandir}/man1 ${datadir} |
---|