Statistics
| Branch: | Revision:

iof-bird-daemon / tools / Makefile.in @ 581b5990

History | View | Annotate | Download (2.47 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
subdir depend: sysdep/paths.h .dir-stamp
23 49e7e5ee Martin Mares
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
24 ed608150 Martin Mares
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
25 49e7e5ee Martin Mares
26 71a9574a Ondrej Filip
$(exedir)/bird: $(bird-dep)
27 7a2105be Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
28 49e7e5ee Martin Mares
29 71a9574a Ondrej Filip
$(exedir)/birdc: $(birdc-dep)
30 7211be1c Martin Mares
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
31 ed608150 Martin Mares
32 71a9574a Ondrej Filip
.dir-stamp: sysdep/paths.h
33 b1777248 Martin Mares
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
34 49e7e5ee Martin Mares
	touch .dir-stamp
35
36
.dep-stamp:
37
	$(MAKE) depend
38
	touch .dep-stamp
39
40 b1777248 Martin Mares
docs: userdocs progdocs
41
42
userdocs progdocs: .dir-stamp
43
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
44
45 f9254d23 Martin Mares
sysdep/paths.h:
46
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
47
	echo >>sysdep/paths.h "#define PATH_CONFIG_DIR \"$(sysconfdir)\""
48 a4ffe273 Martin Mares
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
49 f9254d23 Martin Mares
50 ed9a8236 Martin Mares
tags:
51 ed608150 Martin Mares
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
52 ed9a8236 Martin Mares
53 d8508f70 Martin Mares
install: all
54 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)
55
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
56 d8508f70 Martin Mares
	if test -n "@CLIENT@" ; then								\
57 99355da1 Ondrej Filip
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
58 d8508f70 Martin Mares
	fi
59 99355da1 Ondrej Filip
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
60
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
61 d8508f70 Martin Mares
	else											\
62 26978ec4 Ondrej Filip
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
63 d8508f70 Martin Mares
	fi
64
65 99955b54 Martin Mares
install-docs:
66 99355da1 Ondrej Filip
	$(INSTALL) -d $(DESTDIR)/$(docdir)
67
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
68 99955b54 Martin Mares
69 49e7e5ee Martin Mares
clean:
70 b1777248 Martin Mares
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
71 581b5990 Ondrej Zajicek
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
72 26978ec4 Ondrej Filip
	rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
73 49e7e5ee Martin Mares
74
distclean: clean
75 f9254d23 Martin Mares
	rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
76 49e7e5ee Martin Mares
	rm -rf .dir-stamp $(clean-dirs)