Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (2.68 KB)

1
# Makefile for the BIRD Internet Routing Daemon
2
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
3

    
4
include Rules
5

    
6
.PHONY: all daemon client subdir depend clean distclean tags docs userdocs progdocs
7

    
8
all: sysdep/paths.h .dep-stamp subdir daemon @CLIENT@
9

    
10
daemon: $(exedir)/bird
11

    
12
client: $(exedir)/birdc
13

    
14
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
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
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
28
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
29

    
30
$(exedir)/bird: $(bird-dep)
31
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
32

    
33
$(exedir)/birdc: $(birdc-dep)
34
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
35

    
36
.dir-stamp: sysdep/paths.h
37
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
38
	touch .dir-stamp
39

    
40
.dep-stamp:
41
	$(MAKE) depend
42
	touch .dep-stamp
43

    
44
docs: userdocs progdocs
45

    
46
userdocs progdocs: .dir-stamp
47
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
48

    
49
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
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
53

    
54
tags:
55
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
56

    
57
install: all
58
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)
59
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
60
	if test -n "@CLIENT@" ; then								\
61
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
62
	fi
63
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
64
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
65
	else											\
66
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
67
	fi
68

    
69
install-docs:
70
	$(INSTALL) -d $(DESTDIR)/$(docdir)
71
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
72

    
73
clean:
74
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
75
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
76
	rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
77

    
78
distclean: clean
79
	rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
80
	rm -rf .dir-stamp $(clean-dirs)