1999-01-10 08:18:32 +08:00
|
|
|
# Makefile for the BIRD Internet Routing Daemon
|
2000-01-19 23:07:00 +08:00
|
|
|
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
include Rules
|
|
|
|
|
2000-05-06 01:15:56 +08:00
|
|
|
.PHONY: all daemon client subdir depend clean distclean tags docs userdocs progdocs
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2000-05-08 22:19:47 +08:00
|
|
|
all: sysdep/paths.h .dep-stamp subdir daemon @CLIENT@
|
2000-01-19 23:07:00 +08:00
|
|
|
|
|
|
|
daemon: $(exedir)/bird
|
|
|
|
|
|
|
|
client: $(exedir)/birdc
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2009-08-10 01:43:42 +08:00
|
|
|
bird-dep := $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
|
|
|
|
|
|
|
|
$(bird-dep): sysdep/paths.h .dep-stamp subdir
|
|
|
|
|
|
|
|
birdc-dep := client/all.o lib/birdlib.a
|
|
|
|
|
|
|
|
$(birdc-dep): sysdep/paths.h .dep-stamp subdir
|
|
|
|
|
|
|
|
subdir depend: sysdep/paths.h .dir-stamp
|
1999-01-10 08:18:32 +08:00
|
|
|
set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
|
1999-10-29 17:44:44 +08:00
|
|
|
set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2009-08-10 01:43:42 +08:00
|
|
|
$(exedir)/bird: $(bird-dep)
|
1999-03-04 19:36:26 +08:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2009-08-10 01:43:42 +08:00
|
|
|
$(exedir)/birdc: $(birdc-dep)
|
2000-01-20 21:13:30 +08:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
|
1999-10-29 17:44:44 +08:00
|
|
|
|
2009-08-10 01:43:42 +08:00
|
|
|
.dir-stamp: sysdep/paths.h
|
2000-05-06 01:15:56 +08:00
|
|
|
mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
|
1999-01-10 08:18:32 +08:00
|
|
|
touch .dir-stamp
|
|
|
|
|
|
|
|
.dep-stamp:
|
|
|
|
$(MAKE) depend
|
|
|
|
touch .dep-stamp
|
|
|
|
|
2000-05-06 01:15:56 +08:00
|
|
|
docs: userdocs progdocs
|
|
|
|
|
|
|
|
userdocs progdocs: .dir-stamp
|
|
|
|
$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
|
|
|
|
|
2000-05-08 22:19:47 +08:00
|
|
|
sysdep/paths.h:
|
|
|
|
echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
|
|
|
|
echo >>sysdep/paths.h "#define PATH_CONFIG_DIR \"$(sysconfdir)\""
|
2004-06-01 01:53:02 +08:00
|
|
|
echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
|
2000-05-08 22:19:47 +08:00
|
|
|
|
1999-04-12 03:28:16 +08:00
|
|
|
tags:
|
1999-10-29 17:44:44 +08:00
|
|
|
cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
|
1999-04-12 03:28:16 +08:00
|
|
|
|
2000-05-08 21:54:59 +08:00
|
|
|
install: all
|
2009-06-02 18:01:24 +08:00
|
|
|
$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)
|
|
|
|
$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
|
2000-05-08 21:54:59 +08:00
|
|
|
if test -n "@CLIENT@" ; then \
|
2009-06-02 18:01:24 +08:00
|
|
|
$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ; \
|
2000-05-08 21:54:59 +08:00
|
|
|
fi
|
2009-06-02 18:01:24 +08:00
|
|
|
if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; \
|
2000-05-08 21:54:59 +08:00
|
|
|
else \
|
2009-06-02 17:36:07 +08:00
|
|
|
echo "Not overwriting old bird@SUFFIX@.conf" ; \
|
2000-05-08 21:54:59 +08:00
|
|
|
fi
|
|
|
|
|
2000-06-09 14:31:43 +08:00
|
|
|
install-docs:
|
2009-06-02 18:01:24 +08:00
|
|
|
$(INSTALL) -d $(DESTDIR)/$(docdir)
|
|
|
|
$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
|
2000-06-09 14:31:43 +08:00
|
|
|
|
1999-01-10 08:18:32 +08:00
|
|
|
clean:
|
2000-05-06 01:15:56 +08:00
|
|
|
find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
|
2009-06-02 17:36:07 +08:00
|
|
|
rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
distclean: clean
|
2000-05-08 22:19:47 +08:00
|
|
|
rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
|
1999-01-10 08:18:32 +08:00
|
|
|
rm -rf .dir-stamp $(clean-dirs)
|