source: Makefile.in @ ee183be

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