Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (2.68 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 f9254d23 Martin Mares
54 ed9a8236 Martin Mares
tags:
55 ed608150 Martin Mares
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
56 ed9a8236 Martin Mares
57 d8508f70 Martin Mares
install: all
58 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)
59
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
60 d8508f70 Martin Mares
	if test -n "@CLIENT@" ; then								\
61 99355da1 Ondrej Filip
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
62 d8508f70 Martin Mares
	fi
63 99355da1 Ondrej Filip
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
64
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
65 d8508f70 Martin Mares
	else											\
66 26978ec4 Ondrej Filip
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
67 d8508f70 Martin Mares
	fi
68
69 99955b54 Martin Mares
install-docs:
70 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(docdir)
71
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
72 99955b54 Martin Mares
73 49e7e5ee Martin Mares
clean:
74 b1777248 Martin Mares
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
75 581b5990 Ondrej Zajicek
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
76 26978ec4 Ondrej Filip
	rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
77 49e7e5ee Martin Mares
78
distclean: clean
79 f9254d23 Martin Mares
	rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
80 49e7e5ee Martin Mares
	rm -rf .dir-stamp $(clean-dirs)