1 | # $Id$ |
---|
2 | |
---|
3 | srcdir = @srcdir@ |
---|
4 | VPATH = @srcdir@ |
---|
5 | prefix = @prefix@ |
---|
6 | exec_prefix = @exec_prefix@ |
---|
7 | datadir = @datadir@ |
---|
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 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
32 | |
---|
33 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
34 | GEN_H = owl_prototypes.h |
---|
35 | GEN_O = $(GEN_C:.c=.o) |
---|
36 | |
---|
37 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
38 | |
---|
39 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
40 | #AUTOGEN=$(GEN_C) |
---|
41 | |
---|
42 | |
---|
43 | owl: $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
44 | ./athstatic $(CC) -o owl owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
45 | |
---|
46 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
47 | ./athstatic $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
48 | |
---|
49 | test: tester |
---|
50 | ./tester reg |
---|
51 | |
---|
52 | clean: libfaimclean |
---|
53 | $(RM) owl tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
54 | |
---|
55 | distclean: clean libfaimdistclean |
---|
56 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
57 | |
---|
58 | proto: owl_prototypes.h |
---|
59 | |
---|
60 | perlglue.c: perlglue.xs |
---|
61 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
62 | |
---|
63 | varstubs.c: variable.c stubgen.pl |
---|
64 | perl stubgen.pl > varstubs.c |
---|
65 | |
---|
66 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
67 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
68 | |
---|
69 | # Only move owl_prototypes.h into place if the new one is different |
---|
70 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
71 | perl codelist.pl > owl_prototypes.h.new |
---|
72 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
73 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
74 | echo mv -f owl_prototypes.h.new $@; \ |
---|
75 | mv -f owl_prototypes.h.new $@; } |
---|
76 | #owl_prototypes.h: |
---|
77 | |
---|
78 | .PHONY: tags clean distclean proto test |
---|
79 | |
---|
80 | tags: TAGS |
---|
81 | |
---|
82 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
83 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
84 | |
---|
85 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
86 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
87 | |
---|
88 | libfaim: libfaim/libfaim.a |
---|
89 | |
---|
90 | libfaim/libfaim.a: |
---|
91 | (cd libfaim; $(MAKE)) |
---|
92 | |
---|
93 | libfaimclean: |
---|
94 | (cd libfaim; $(MAKE) clean) |
---|
95 | |
---|
96 | libfaimdistclean: |
---|
97 | (cd libfaim; $(MAKE) distclean) |
---|
98 | |
---|
99 | all: owl |
---|
100 | |
---|
101 | install: all installdirs |
---|
102 | ${INSTALL_PROGRAM} owl ${bindir}/owl |
---|
103 | ${INSTALL_DATA} doc/owl.1 ${mandir}/man1/owl.1 |
---|
104 | tar -C perl -c . | tar -C ${datadir}/owl -x |
---|
105 | |
---|
106 | installdirs: mkinstalldirs |
---|
107 | ${srcdir}/mkinstalldirs ${bindir} ${mandir}/man1 ${datadir}/owl |
---|