summaryrefslogtreecommitdiff
path: root/tools/Makefile.in
blob: 337c1b43812adf3a2e4c464c9228a7b3f25112ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Makefile for the BIRD Internet Routing Daemon
# (c) 1999 Martin Mares <mj@ucw.cz>

include Rules

srcdir_abs := $(shell cd $(srcdir) ; pwd)

.PHONY: all subdir depend clean distclean tags

all: .dep-stamp subdir $(exedir)/bird $(exedir)/birdc

subdir depend: .dir-stamp
	set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
	set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done

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

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

.dir-stamp:
	mkdir -p $(static-dirs) $(client-dirs)
	touch .dir-stamp

.dep-stamp:
	$(MAKE) depend
	touch .dep-stamp

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

clean:
	find . -name "*.[oa]" -or -name core -or -name depend | xargs rm -f
	rm -f $(exedir)/bird $(exedir)/birdc .dep-stamp

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