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}\" |
---|
14 | LDFLAGS=@LDFLAGS@ |
---|
15 | XSUBPPDIR=@XSUBPPDIR@ |
---|
16 | XSUBPPFLAGS=@XSUBPPFLAGS@ |
---|
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 \ |
---|
23 | perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ |
---|
24 | regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ |
---|
25 | keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ |
---|
26 | aim.c buddy.c buddylist.c timer.c style.c stylefunc.c errqueue.c \ |
---|
27 | zbuddylist.c muxevents.c popexec.c |
---|
28 | OWL_SRC = owl.c |
---|
29 | TESTER_SRC = tester.c |
---|
30 | |
---|
31 | EXE = barnowl |
---|
32 | |
---|
33 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
34 | |
---|
35 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
36 | GEN_H = owl_prototypes.h |
---|
37 | GEN_O = $(GEN_C:.c=.o) |
---|
38 | |
---|
39 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
40 | |
---|
41 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
42 | #AUTOGEN=$(GEN_C) |
---|
43 | |
---|
44 | |
---|
45 | owl: $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
46 | ./athstatic $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
47 | |
---|
48 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
49 | ./athstatic $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
50 | |
---|
51 | test: tester |
---|
52 | ./tester reg |
---|
53 | |
---|
54 | clean: libfaimclean |
---|
55 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
56 | |
---|
57 | distclean: clean libfaimdistclean |
---|
58 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
59 | |
---|
60 | proto: owl_prototypes.h |
---|
61 | |
---|
62 | perlglue.c: perlglue.xs Makefile |
---|
63 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
64 | |
---|
65 | varstubs.c: variable.c stubgen.pl |
---|
66 | perl stubgen.pl > varstubs.c |
---|
67 | |
---|
68 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
69 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
70 | |
---|
71 | # Only move owl_prototypes.h into place if the new one is different |
---|
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 $@ || { \ |
---|
75 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
76 | echo mv -f owl_prototypes.h.new $@; \ |
---|
77 | mv -f owl_prototypes.h.new $@; } |
---|
78 | #owl_prototypes.h: |
---|
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 | |
---|
87 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
88 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
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) |
---|
100 | |
---|
101 | all: $(EXE) |
---|
102 | |
---|
103 | install: all installdirs |
---|
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 |
---|
107 | |
---|
108 | installdirs: mkinstalldirs |
---|
109 | ${srcdir}/mkinstalldirs ${bindir} ${mandir}/man1 ${datadir} |
---|