Statistics
| Branch: | Revision:

iof-bird-daemon / tools / Makefile.in @ acc93efd

History | View | Annotate | Download (2.79 KB)

1 49e7e5ee Martin Mares
# Makefile for the BIRD Internet Routing Daemon
2 9fac310d Martin Mares
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
3 49e7e5ee Martin Mares
4
include Rules
5
6 b1777248 Martin Mares
.PHONY: all daemon client subdir depend clean distclean tags docs userdocs progdocs
7 49e7e5ee Martin Mares
8 f9254d23 Martin Mares
all: sysdep/paths.h .dep-stamp subdir daemon @CLIENT@
9 9fac310d Martin Mares
10
daemon: $(exedir)/bird
11
12
client: $(exedir)/birdc
13 49e7e5ee Martin Mares
14 71a9574a Ondrej Filip
bird-dep := $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
15
16
$(bird-dep): sysdep/paths.h .dep-stamp subdir
17
18
birdc-dep := client/all.o lib/birdlib.a
19
20
$(birdc-dep): sysdep/paths.h .dep-stamp subdir
21
22 f2cfc509 Ondrej Zajicek
depend: sysdep/paths.h .dir-stamp
23
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
24
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
25
26
subdir: sysdep/paths.h .dir-stamp .dep-stamp
27 49e7e5ee Martin Mares
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
28 ed608150 Martin Mares
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
29 49e7e5ee Martin Mares
30 71a9574a Ondrej Filip
$(exedir)/bird: $(bird-dep)
31 7a2105be Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
32 49e7e5ee Martin Mares
33 71a9574a Ondrej Filip
$(exedir)/birdc: $(birdc-dep)
34 7211be1c Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
35 ed608150 Martin Mares
36 71a9574a Ondrej Filip
.dir-stamp: sysdep/paths.h
37 b1777248 Martin Mares
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
38 49e7e5ee Martin Mares
	touch .dir-stamp
39
40
.dep-stamp:
41
	$(MAKE) depend
42
	touch .dep-stamp
43
44 b1777248 Martin Mares
docs: userdocs progdocs
45
46
userdocs progdocs: .dir-stamp
47
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
48
49 f9254d23 Martin Mares
sysdep/paths.h:
50
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
51
	echo >>sysdep/paths.h "#define PATH_CONFIG_DIR \"$(sysconfdir)\""
52 a4ffe273 Martin Mares
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
53 acc93efd Ondrej Zajicek
	if test -n "@iproutedir@" ; then echo >>sysdep/paths.h "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
54 f9254d23 Martin Mares
55 ed9a8236 Martin Mares
tags:
56 ed608150 Martin Mares
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
57 ed9a8236 Martin Mares
58 d8508f70 Martin Mares
install: all
59 e285bd23 Ondrej Zajicek
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)/run
60 99355da1 Ondrej Filip
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
61 d8508f70 Martin Mares
	if test -n "@CLIENT@" ; then								\
62 99355da1 Ondrej Filip
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
63 d8508f70 Martin Mares
	fi
64 99355da1 Ondrej Filip
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
65
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
66 d8508f70 Martin Mares
	else											\
67 26978ec4 Ondrej Filip
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
68 d8508f70 Martin Mares
	fi
69
70 99955b54 Martin Mares
install-docs:
71 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(docdir)
72
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
73 99955b54 Martin Mares
74 49e7e5ee Martin Mares
clean:
75 b1777248 Martin Mares
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
76 581b5990 Ondrej Zajicek
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
77 26978ec4 Ondrej Filip
	rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
78 49e7e5ee Martin Mares
79
distclean: clean
80 f9254d23 Martin Mares
	rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
81 49e7e5ee Martin Mares
	rm -rf .dir-stamp $(clean-dirs)