1 | # $Id$ |
---|
2 | |
---|
3 | srcdir = @srcdir@ |
---|
4 | VPATH = @srcdir@ |
---|
5 | prefix = @prefix@ |
---|
6 | exec_prefix = @exec_prefix@ |
---|
7 | datadir = @datadir@/barnowl |
---|
8 | bindir = @bindir@ |
---|
9 | mandir = @mandir@ |
---|
10 | |
---|
11 | CC=@CC@ |
---|
12 | LIBS=@LIBS@ -L./libfaim -lfaim |
---|
13 | CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=`svnversion` |
---|
14 | LDFLAGS=@LDFLAGS@ |
---|
15 | XSUBPPDIR=@XSUBPPDIR@ |
---|
16 | XSUBPPFLAGS=@XSUBPPFLAGS@ |
---|
17 | INSTALL=@INSTALL@ |
---|
18 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
---|
19 | INSTALL_DATA=@INSTALL_DATA@ |
---|
20 | ATHSTATIC=@ATHSTATIC@ |
---|
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 \ |
---|
24 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
25 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
26 | keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ |
---|
27 | aim.c buddy.c buddylist.c timer.c style.c stylefunc.c errqueue.c \ |
---|
28 | zbuddylist.c muxevents.c popexec.c obarray.c |
---|
29 | OWL_SRC = owl.c |
---|
30 | TESTER_SRC = tester.c |
---|
31 | |
---|
32 | EXE = barnowl |
---|
33 | |
---|
34 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
35 | |
---|
36 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
37 | GEN_H = owl_prototypes.h |
---|
38 | GEN_O = $(GEN_C:.c=.o) |
---|
39 | |
---|
40 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
41 | |
---|
42 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
43 | #AUTOGEN=$(GEN_C) |
---|
44 | |
---|
45 | |
---|
46 | $(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
47 | $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
48 | |
---|
49 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
50 | $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
51 | |
---|
52 | test: tester |
---|
53 | ./tester reg |
---|
54 | |
---|
55 | clean: libfaimclean |
---|
56 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
57 | |
---|
58 | distclean: clean libfaimdistclean |
---|
59 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
60 | |
---|
61 | proto: owl_prototypes.h |
---|
62 | |
---|
63 | perlglue.c: perlglue.xs Makefile |
---|
64 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
65 | |
---|
66 | varstubs.c: variable.c stubgen.pl |
---|
67 | perl stubgen.pl > varstubs.c |
---|
68 | |
---|
69 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
70 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
71 | |
---|
72 | # Only move owl_prototypes.h into place if the new one is different |
---|
73 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
74 | perl codelist.pl > owl_prototypes.h.new |
---|
75 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
76 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
77 | echo mv -f owl_prototypes.h.new $@; \ |
---|
78 | mv -f owl_prototypes.h.new $@; } |
---|
79 | #owl_prototypes.h: |
---|
80 | |
---|
81 | .PHONY: tags clean distclean proto test |
---|
82 | |
---|
83 | tags: TAGS |
---|
84 | |
---|
85 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
86 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
87 | |
---|
88 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
89 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
90 | |
---|
91 | libfaim: libfaim/libfaim.a |
---|
92 | |
---|
93 | libfaim/libfaim.a: |
---|
94 | (cd libfaim; $(MAKE)) |
---|
95 | |
---|
96 | libfaimclean: |
---|
97 | (cd libfaim; $(MAKE) clean) |
---|
98 | |
---|
99 | libfaimdistclean: |
---|
100 | (cd libfaim; $(MAKE) distclean) |
---|
101 | |
---|
102 | all: $(EXE) |
---|
103 | |
---|
104 | install: all installdirs |
---|
105 | ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/$(EXE) |
---|
106 | ${INSTALL_DATA} doc/owl.1 ${DESTDIR}${mandir}/man1/barnowl.1 |
---|
107 | tar -C perl -c . | tar -C ${DESTDIR}${datadir} -x |
---|
108 | |
---|
109 | installdirs: mkinstalldirs |
---|
110 | ${srcdir}/mkinstalldirs ${DESTDIR}${bindir} ${DESTDIR}${mandir}/man1 ${DESTDIR}${datadir} |
---|