Statistics
| Branch: | Revision:

iof-bird-daemon / tools / Makefile.in @ 99355da1

History | View | Annotate | Download (2.23 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
subdir depend: .dir-stamp
15
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
16
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
17

    
18
$(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
19
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
20

    
21
$(exedir)/birdc: client/all.o lib/birdlib.a
22
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
23

    
24
.dir-stamp:
25
	mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
26
	touch .dir-stamp
27

    
28
.dep-stamp:
29
	$(MAKE) depend
30
	touch .dep-stamp
31

    
32
docs: userdocs progdocs
33

    
34
userdocs progdocs: .dir-stamp
35
	$(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
36

    
37
sysdep/paths.h:
38
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
39
	echo >>sysdep/paths.h "#define PATH_CONFIG_DIR \"$(sysconfdir)\""
40
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
41

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

    
45
install: all
46
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)
47
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
48
	if test -n "@CLIENT@" ; then								\
49
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
50
	fi
51
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
52
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
53
	else											\
54
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
55
	fi
56

    
57
install-docs:
58
	$(INSTALL) -d $(DESTDIR)/$(docdir)
59
	$(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
60

    
61
clean:
62
	find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
63
	rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
64

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