Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (3.07 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 birdc birdcl subdir depend clean distclean tags docs userdocs progdocs
7

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

    
10
daemon: $(exedir)/bird
11

    
12
birdc: $(exedir)/birdc
13

    
14
birdcl: $(exedir)/birdcl
15

    
16
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
birdc-dep := client/birdc.o client/all.o lib/birdlib.a
21

    
22
$(birdc-dep): sysdep/paths.h .dep-stamp subdir
23

    
24
birdcl-dep := client/birdcl.o client/all.o lib/birdlib.a
25

    
26
$(birdcl-dep): sysdep/paths.h .dep-stamp subdir
27

    
28

    
29
export client := @CLIENT@
30

    
31
depend: sysdep/paths.h .dir-stamp
32
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
33
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
34

    
35
subdir: sysdep/paths.h .dir-stamp .dep-stamp
36
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
37
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
38

    
39
$(exedir)/bird: $(bird-dep)
40
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
41

    
42
$(exedir)/birdc: $(birdc-dep)
43
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
44

    
45
$(exedir)/birdcl: $(birdcl-dep)
46
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
47

    
48
.dir-stamp: sysdep/paths.h
49
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
50
	touch .dir-stamp
51

    
52
.dep-stamp:
53
	$(MAKE) depend
54
	touch .dep-stamp
55

    
56
docs: userdocs progdocs
57

    
58
userdocs progdocs: .dir-stamp
59
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
60

    
61
sysdep/paths.h:
62
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
63
	echo >>sysdep/paths.h "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
64
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
65
	if test -n "@iproutedir@" ; then echo >>sysdep/paths.h "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
66

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

    
70
install: all
71
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
72
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@
73
	$(INSTALL_PROGRAM) -s $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@
74
	if test -n "@CLIENT@" ; then								\
75
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ;	\
76
	fi
77
	if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then						\
78
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;	\
79
	else											\
80
		echo "Not overwriting old bird@SUFFIX@.conf" ;					\
81
	fi
82

    
83
install-docs:
84
	$(INSTALL) -d $(DESTDIR)/$(docdir)
85
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
86

    
87
clean:
88
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
89
	rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
90
	rm -f $(exedir)/bird $(exedir)/birdcl $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
91

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