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=`./svkversion` |
---|
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 | PERL_MODULES = Jabber |
---|
34 | MODULE_DIRS = $(PERL_MODULES:%=perl/modules/%) |
---|
35 | |
---|
36 | BASE_OBJS = $(BASE_SRCS:.c=.o) |
---|
37 | |
---|
38 | GEN_C = varstubs.c perlglue.c perlwrap.c |
---|
39 | GEN_H = owl_prototypes.h |
---|
40 | GEN_O = $(GEN_C:.c=.o) |
---|
41 | |
---|
42 | OBJS = $(BASE_OBJS) $(GEN_O) |
---|
43 | |
---|
44 | AUTOGEN=$(GEN_C) $(GEN_H) |
---|
45 | #AUTOGEN=$(GEN_C) |
---|
46 | |
---|
47 | HEADERS=$(GEN_H) owl.h config.h |
---|
48 | |
---|
49 | %.o: %.c $(HEADERS) |
---|
50 | $(CC) -c $(CFLAGS) $< -o $@ |
---|
51 | |
---|
52 | $(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim |
---|
53 | $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
54 | |
---|
55 | tester: $(AUTOGEN) $(OBJS) tester.o |
---|
56 | $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) |
---|
57 | |
---|
58 | test: tester |
---|
59 | ./tester reg |
---|
60 | |
---|
61 | clean: libfaimclean modules_clean |
---|
62 | $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new |
---|
63 | |
---|
64 | distclean: clean libfaimdistclean |
---|
65 | $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core |
---|
66 | |
---|
67 | .PHONY: $(MODULE_DIRS) |
---|
68 | |
---|
69 | modules: $(MODULE_DIRS) |
---|
70 | modules_clean: |
---|
71 | for i in $(MODULE_DIRS); do \ |
---|
72 | cd $$i; test ! -f Makefile || make clean; \ |
---|
73 | done |
---|
74 | |
---|
75 | $(MODULE_DIRS): %: %/Makefile |
---|
76 | ( cd $@ && make $(notdir $@).par ) |
---|
77 | |
---|
78 | $(MODULE_DIRS:=/Makefile): %/Makefile: %/Makefile.PL |
---|
79 | ( cd $(dir $@) && perl -I../../lib Makefile.PL ) |
---|
80 | |
---|
81 | proto: owl_prototypes.h |
---|
82 | |
---|
83 | perlglue.c: perlglue.xs Makefile |
---|
84 | perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c |
---|
85 | |
---|
86 | varstubs.c: variable.c stubgen.pl |
---|
87 | perl stubgen.pl > varstubs.c |
---|
88 | |
---|
89 | perlwrap.c: perlwrap.pm encapsulate.pl |
---|
90 | perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c |
---|
91 | |
---|
92 | # Only move owl_prototypes.h into place if the new one is different |
---|
93 | owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) |
---|
94 | perl codelist.pl > owl_prototypes.h.new |
---|
95 | @cmp -s owl_prototypes.h.new $@ || { \ |
---|
96 | test -f $@ && echo 'Interfaces changed!'; \ |
---|
97 | echo mv -f owl_prototypes.h.new $@; \ |
---|
98 | mv -f owl_prototypes.h.new $@; } |
---|
99 | #owl_prototypes.h: |
---|
100 | |
---|
101 | .PHONY: tags clean distclean proto test |
---|
102 | |
---|
103 | tags: TAGS |
---|
104 | |
---|
105 | TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
106 | etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) |
---|
107 | |
---|
108 | $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h |
---|
109 | #$(BASE_OBJS) varstubs.h:: owl.h config.h |
---|
110 | |
---|
111 | libfaim: libfaim/libfaim.a |
---|
112 | |
---|
113 | libfaim/libfaim.a: |
---|
114 | (cd libfaim; $(MAKE)) |
---|
115 | |
---|
116 | libfaimclean: |
---|
117 | (cd libfaim; $(MAKE) clean) |
---|
118 | |
---|
119 | libfaimdistclean: |
---|
120 | (cd libfaim; $(MAKE) distclean) |
---|
121 | |
---|
122 | all: $(EXE) $(MODULE_DIRS) |
---|
123 | |
---|
124 | install: all installdirs |
---|
125 | ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/$(EXE) |
---|
126 | ${INSTALL_DATA} doc/owl.1 ${DESTDIR}${mandir}/man1/barnowl.1 |
---|
127 | ${INSTALL} -d ${DESTDIR}${datadir}/lib |
---|
128 | ${INSTALL} -d ${DESTDIR}${datadir}/modules |
---|
129 | tar -C perl/lib -c . | tar -C ${DESTDIR}${datadir}/lib -x |
---|
130 | for i in $(PERL_MODULES); do \ |
---|
131 | ${INSTALL_DATA} perl/modules/$$i/$$i.par ${DESTDIR}${datadir}/modules/$$i.par; \ |
---|
132 | done |
---|
133 | |
---|
134 | installdirs: mkinstalldirs |
---|
135 | ${srcdir}/mkinstalldirs ${DESTDIR}${bindir} ${DESTDIR}${mandir}/man1 ${DESTDIR}${datadir} |
---|