Revision 25697773 Makefile

View differences:

Makefile
2 2
# (c) 1998 Martin Mares <mj@ucw.cz>
3 3

  
4 4
TOPDIR=$(shell pwd)
5
OBJDIR=obj
6

  
5 7
CPPFLAGS=-I$(TOPDIR)/sysdep/linux -I$(TOPDIR)
6 8
OPT=-O2
7 9
DEBUG=-g#gdb
8 10
CFLAGS=$(OPT) $(DEBUG) -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses
9 11

  
10 12
PROTOCOLS=
11
DIRS=nest $(PROTOCOLS) lib sysdep/linux sysdep/unix
12
ARCHS=$(join $(addsuffix /,$(DIRS)),$(subst /,_,$(addsuffix .a,$(DIRS))))
13
LIBDIRS=sysdep/linux sysdep/unix lib
14
STDDIRS=nest $(PROTOCOLS)
15
DIRS=$(STDDIRS) $(OBJDIR)/lib
16
PARTOBJS=$(join $(addsuffix /,$(STDDIRS)),$(subst /,_,$(addsuffix .o,$(STDDIRS))))
17
LIBS=$(OBJDIR)/lib/birdlib.a
13 18

  
14 19
export
15 20

  
16 21
all: .dep all-dirs bird
17 22

  
18 23
all-dirs:
19
	set -e ; for a in $(DIRS) ; do $(MAKE) -C $$a ; done
24
	set -e ; for a in $(DIRS) ; do $(MAKE) -C $$a all ; done
20 25

  
21
bird: $(ARCHS)
26
bird: $(PARTOBJS) $(LIBS)
22 27
	$(CC) $(LDFLAGS) -o $@ $^
23 28

  
24 29
.dep:
25 30
	$(MAKE) dep
26
	touch .dep
27 31

  
28 32
dep:
33
	mkdir -p $(OBJDIR)
34
	tools/mergedirs $(OBJDIR) $(LIBDIRS)
35
#	for a in $(STDDIRS) ; do mkdir -p $(OBJDIR)/$$a ; done
29 36
	set -e ; for a in $(DIRS) ; do $(MAKE) -C $$a dep ; done
37
	touch .dep
30 38

  
31 39
clean:
40
	rm -rf obj
32 41
	rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend -or -name .#*`
33 42
	rm -f bird .dep

Also available in: Unified diff