[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 |
---|
[95e60d6] | 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 \ |
---|
[124aebc] | 28 | zbuddylist.c muxevents.c popexec.c obarray.c |
---|
[aaf6071] | 29 | OWL_SRC = owl.c |
---|
| 30 | TESTER_SRC = tester.c |
---|
| 31 | |
---|
[3354cea5] | 32 | EXE = barnowl |
---|
| 33 | |
---|
[aaf6071] | 34 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
[7d4fbcd] | 35 | |
---|
[f1e629d] | 36 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
[aaf6071] | 37 | GEN_H = owl_prototypes.h |
---|
| 38 | GEN_O = $(GEN_C:.c=.o) |
---|
| 39 | |
---|
| 40 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
| 41 | |
---|
[0ff8fb57] | 42 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
| 43 | #AUTOGEN=$(GEN_C) |
---|
[7d4fbcd] | 44 | |
---|
[07f715f] | 45 | HEADERS=$(GEN_H) owl.h config.h |
---|
| 46 | |
---|
| 47 | %.o: %.c $(HEADERS) |
---|
| 48 | $(CC) -c $(CFLAGS) $< -o $@ |
---|
[7d4fbcd] | 49 | |
---|
[7f1f1e7] | 50 | $(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
[7ccc780] | 51 | $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 52 | |
---|
[094009a] | 53 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
[7ccc780] | 54 | $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
[7d4fbcd] | 55 | |
---|
| 56 | test: tester |
---|
| 57 | ./tester reg |
---|
| 58 | |
---|
[d09e5a1] | 59 | clean: libfaimclean |
---|
[3354cea5] | 60 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
[7d4fbcd] | 61 | |
---|
[d09e5a1] | 62 | distclean: clean libfaimdistclean |
---|
[42c33a6] | 63 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
[7d4fbcd] | 64 | |
---|
[0ff8fb57] | 65 | proto: owl_prototypes.h |
---|
[7d4fbcd] | 66 | |
---|
[11be665] | 67 | perlglue.c: perlglue.xs Makefile |
---|
[15bd5ef] | 68 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
[7d4fbcd] | 69 | |
---|
| 70 | varstubs.c: variable.c stubgen.pl |
---|
| 71 | perl stubgen.pl > varstubs.c |
---|
| 72 | |
---|
[f1e629d] | 73 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
| 74 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
| 75 | |
---|
[aaf6071] | 76 | # Only move owl_prototypes.h into place if the new one is different |
---|
[0ff8fb57] | 77 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
| 78 | perl codelist.pl > owl_prototypes.h.new |
---|
| 79 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
[8c92848] | 80 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
[0ff8fb57] | 81 | echo mv -f owl_prototypes.h.new $@; \ |
---|
| 82 | mv -f owl_prototypes.h.new $@; } |
---|
| 83 | #owl_prototypes.h: |
---|
[aaf6071] | 84 | |
---|
| 85 | .PHONY: tags clean distclean proto test |
---|
| 86 | |
---|
| 87 | tags: TAGS |
---|
| 88 | |
---|
| 89 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 90 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
| 91 | |
---|
[0ff8fb57] | 92 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
| 93 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
[d09e5a1] | 94 | |
---|
| 95 | libfaim: libfaim/libfaim.a |
---|
| 96 | |
---|
| 97 | libfaim/libfaim.a: |
---|
| 98 | (cd libfaim; $(MAKE)) |
---|
| 99 | |
---|
| 100 | libfaimclean: |
---|
| 101 | (cd libfaim; $(MAKE) clean) |
---|
| 102 | |
---|
| 103 | libfaimdistclean: |
---|
| 104 | (cd libfaim; $(MAKE) distclean) |
---|
[aaf6071] | 105 | |
---|
[3354cea5] | 106 | all: $(EXE) |
---|
[ac70242] | 107 | |
---|
| 108 | install: all installdirs |
---|
[88cbd0a] | 109 | ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/$(EXE) |
---|
| 110 | ${INSTALL_DATA} doc/owl.1 ${DESTDIR}${mandir}/man1/barnowl.1 |
---|
| 111 | tar -C perl -c . | tar -C ${DESTDIR}${datadir} -x |
---|
[ac70242] | 112 | |
---|
| 113 | installdirs: mkinstalldirs |
---|
[88cbd0a] | 114 | ${srcdir}/mkinstalldirs ${DESTDIR}${bindir} ${DESTDIR}${mandir}/man1 ${DESTDIR}${datadir} |
---|