Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (3.07 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 d2c392d4 Ondrej Zajicek
.PHONY: all daemon birdc birdcl subdir depend clean distclean tags docs userdocs progdocs
7 49e7e5ee Martin Mares
8 8322ecde Tomas Hlavacek
all: sysdep/paths.h .dep-stamp subdir daemon birdcl @CLIENT@
9 9fac310d Martin Mares
10
daemon: $(exedir)/bird
11
12 8322ecde Tomas Hlavacek
birdc: $(exedir)/birdc
13
14
birdcl: $(exedir)/birdcl
15 49e7e5ee Martin Mares
16 71a9574a Ondrej Filip
bird-dep := $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
17
18
$(bird-dep): sysdep/paths.h .dep-stamp subdir
19
20 d2c392d4 Ondrej Zajicek
birdc-dep := client/birdc.o client/all.o lib/birdlib.a
21 71a9574a Ondrej Filip
22
$(birdc-dep): sysdep/paths.h .dep-stamp subdir
23
24 d2c392d4 Ondrej Zajicek
birdcl-dep := client/birdcl.o client/all.o lib/birdlib.a
25 8322ecde Tomas Hlavacek
26
$(birdcl-dep): sysdep/paths.h .dep-stamp subdir
27
28
29 d2c392d4 Ondrej Zajicek
export client := @CLIENT@
30
31 f2cfc509 Ondrej Zajicek
depend: sysdep/paths.h .dir-stamp
32
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
33 d2c392d4 Ondrej Zajicek
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
34 f2cfc509 Ondrej Zajicek
35
subdir: sysdep/paths.h .dir-stamp .dep-stamp
36 49e7e5ee Martin Mares
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
37 d2c392d4 Ondrej Zajicek
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
38 49e7e5ee Martin Mares
39 71a9574a Ondrej Filip
$(exedir)/bird: $(bird-dep)
40 7a2105be Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
41 49e7e5ee Martin Mares
42 71a9574a Ondrej Filip
$(exedir)/birdc: $(birdc-dep)
43 7211be1c Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
44 ed608150 Martin Mares
45 8322ecde Tomas Hlavacek
$(exedir)/birdcl: $(birdcl-dep)
46
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
47
48 71a9574a Ondrej Filip
.dir-stamp: sysdep/paths.h
49 d2c392d4 Ondrej Zajicek
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
50 49e7e5ee Martin Mares
	touch .dir-stamp
51
52
.dep-stamp:
53
	$(MAKE) depend
54
	touch .dep-stamp
55
56 b1777248 Martin Mares
docs: userdocs progdocs
57
58
userdocs progdocs: .dir-stamp
59
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
60
61 f9254d23 Martin Mares
sysdep/paths.h:
62
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
63 ab188fb7 Ondrej Zajicek
	echo >>sysdep/paths.h "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
64
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
65 acc93efd Ondrej Zajicek
	if test -n "@iproutedir@" ; then echo >>sysdep/paths.h "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
66 f9254d23 Martin Mares
67 ed9a8236 Martin Mares
tags:
68 ed608150 Martin Mares
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
69 ed9a8236 Martin Mares
70 d8508f70 Martin Mares
install: all
71 ab188fb7 Ondrej Zajicek
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
72
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@
73 8322ecde Tomas Hlavacek
	$(INSTALL_PROGRAM) -s $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@
74 d8508f70 Martin Mares
	if test -n "@CLIENT@" ; then								\
75 ab188fb7 Ondrej Zajicek
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ;	\
76 d8508f70 Martin Mares
	fi
77 ab188fb7 Ondrej Zajicek
	if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then						\
78
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;	\
79 d8508f70 Martin Mares
	else											\
80 ab188fb7 Ondrej Zajicek
		echo "Not overwriting old bird@SUFFIX@.conf" ;					\
81 d8508f70 Martin Mares
	fi
82
83 99955b54 Martin Mares
install-docs:
84 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(docdir)
85
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
86 99955b54 Martin Mares
87 49e7e5ee Martin Mares
clean:
88 b1777248 Martin Mares
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
89 581b5990 Ondrej Zajicek
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
90 8322ecde Tomas Hlavacek
	rm -f $(exedir)/bird $(exedir)/birdcl $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
91 49e7e5ee Martin Mares
92
distclean: clean
93 f9254d23 Martin Mares
	rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
94 49e7e5ee Martin Mares
	rm -rf .dir-stamp $(clean-dirs)