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