source: Makefile.in @ af193338

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since af193338 was af193338, checked in by Anders Kaseorg <andersk@mit.edu>, 16 years ago
Makefile.in: Replace shell for loops with makefile patterns. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 4.1 KB
Line 
1# $Id$
2
3srcdir = @srcdir@
4VPATH = @srcdir@
5prefix = @prefix@
6exec_prefix = @exec_prefix@
7datarootdir = @datarootdir@
8datadir = @datadir@/barnowl
9bindir = @bindir@
10mandir = @mandir@
11
12CC=@CC@
13LIBS=@LIBS@ -L./libfaim -lfaim
14CFLAGS=@CFLAGS@ -I./libfaim -DDATADIR=\"${datadir}\"
15LDFLAGS=@LDFLAGS@
16XSUBPPDIR=@XSUBPPDIR@
17XSUBPPFLAGS=@XSUBPPFLAGS@
18INSTALL=@INSTALL@
19INSTALL_PROGRAM=@INSTALL_PROGRAM@
20INSTALL_DATA=@INSTALL_DATA@
21ATHSTATIC=@ATHSTATIC@
22
23BASE_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \
24     commands.c global.c text.c fmtext.c editwin.c util.c logging.c \
25     perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
26     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
27     keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
28     aim.c buddy.c buddylist.c style.c errqueue.c \
29     zbuddylist.c popexec.c obarray.c select.c wcwidth.c \
30     glib_compat.c
31OWL_SRC = owl.c
32TESTER_SRC = tester.c
33
34EXE = barnowl
35PERL_MODULES = Jabber IRC WordWrap
36MODULE_DIRS = $(PERL_MODULES:%=perl/modules/%)
37
38BASE_OBJS = $(BASE_SRCS:.c=.o)
39
40GEN_C = varstubs.c perlglue.c perlwrap.c
41GEN_H = owl_prototypes.h
42GEN_O = $(GEN_C:.c=.o)
43
44OBJS = $(BASE_OBJS) $(GEN_O)
45
46AUTOGEN=$(GEN_C) $(GEN_H)
47#AUTOGEN=$(GEN_C)
48
49HEADERS=$(GEN_H) owl.h config.h test.h
50
51all: $(EXE) $(MODULE_DIRS)
52
53$(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim
54        $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS)
55
56tester: $(AUTOGEN) $(OBJS) tester.o libfaim
57        $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS)
58
59%.o: %.c $(HEADERS)
60        $(CC) -c $(CFLAGS) $< -o $@
61
62# zcrypt is old crufty DES code I don't want to touch
63# Disable all warnings when compiling it
64zcrypt.o: zcrypt.c $(HEADERS)
65        $(CC) -c $(CFLAGS) $< -w -o $@
66
67test: tester
68        ./tester reg
69
70clean: libfaimclean modules_clean
71        $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new
72
73distclean: clean libfaimdistclean
74        $(RM) config.cache config.log config.status  Makefile config.h TAGS *~ core
75
76.PHONY: $(MODULE_DIRS) $(MODULE_DIRS:%=clean_%)
77
78modules: $(MODULE_DIRS)
79modules_clean: $(MODULE_DIRS:%=clean_%)
80
81$(MODULE_DIRS): %: %/Makefile
82        ( cd $@ && $(MAKE) $(notdir $@).par )
83
84$(MODULE_DIRS:=/Makefile): %/Makefile: %/Makefile.PL
85        ( cd $(dir $@) && perl -I../../lib Makefile.PL )
86
87$(MODULE_DIRS:%=clean_%): clean_%:
88        (cd $* && (test ! -f Makefile || $(MAKE) clean))
89
90proto: owl_prototypes.h
91
92perlglue.c: perlglue.xs Makefile
93        perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
94
95varstubs.c: variable.c stubgen.pl
96        perl stubgen.pl > varstubs.c
97
98perlwrap.c: perlwrap.pm encapsulate.pl
99        perl encapsulate.pl perlwrap.pm owl_perlwrap_codebuff > perlwrap.c
100
101# Only move owl_prototypes.h into place if the new one is different
102owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS)
103        perl codelist.pl > owl_prototypes.h.new
104        @cmp -s owl_prototypes.h.new $@ || { \
105         test -f $@ && echo 'Interfaces changed!'; \
106         echo mv -f owl_prototypes.h.new $@; \
107              mv -f owl_prototypes.h.new $@; }
108#owl_prototypes.h:
109
110.PHONY: tags clean distclean proto test check-syntax
111
112tags: TAGS
113
114TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H)
115        etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H)
116
117$(BASE_OBJS) varstubs.h: owl.h config.h owl_prototypes.h
118
119libfaim: libfaim/libfaim.a
120
121libfaim/libfaim.a:
122        (cd libfaim && $(MAKE))
123
124libfaimclean:
125        (cd libfaim && $(MAKE) clean)
126
127libfaimdistclean:
128        (cd libfaim && $(MAKE) distclean)
129
130install: all installdirs $(PERL_MODULES:%=module_install_%)
131        ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/$(EXE)
132        ${INSTALL_DATA} doc/barnowl.1 ${DESTDIR}${mandir}/man1/barnowl.1
133        (cd perl/lib && tar --exclude .svn -cf - . ) | (cd ${DESTDIR}${datadir}/lib && tar -xf - )
134
135installdirs: mkinstalldirs
136        ${srcdir}/mkinstalldirs \
137            ${DESTDIR}${bindir} \
138            ${DESTDIR}${mandir}/man1 \
139            ${DESTDIR}${datadir}/lib \
140            ${DESTDIR}${datadir}/modules
141
142.PHONY: $(PERL_MODULES:%=module_install_%)
143
144$(PERL_MODULES:%=module_install_%): module_install_%: installdirs
145        ${INSTALL_DATA} perl/modules/$*/$*.par ${DESTDIR}${datadir}/modules/$*.par
146
147# For emacs flymake-mode
148check-syntax: proto
149        $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
Note: See TracBrowser for help on using the repository browser.