Statistics
| Branch: | Revision:

iof-bird-daemon / tools / Rules.in @ ed608150

History | View | Annotate | Download (1.11 KB)

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

    
4
srcdir=@srcdir_rel_mf@
5
objdir=@objdir@
6
exedir=@exedir@
7

    
8
protocols=@protocols@
9
static-dirs := nest filter $(addprefix proto/,$(protocols))
10
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
11
dynamic-dirs := lib conf
12
dynamic-dir-paths := $(dynamic-dirs)
13
client-dirs := client
14
client-dir-paths := $(client-dirs)
15

    
16
all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs)
17
clean-dirs:=$(all-dirs) proto sysdep
18

    
19
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
20
CFLAGS=$(CPPFLAGS) @CFLAGS@
21
LDFLAGS=
22
LIBS=@LIBS@
23
CC=@CC@
24
M4=@M4@
25
BISON=@BISON@
26
FLEX=@FLEX@
27
RANLIB=@RANLIB@
28

    
29
ifdef source
30

    
31
objs := $(subst .c,.o,$(source))
32

    
33
ifdef dir-name
34
src-path := $(srcdir)/$(dir-name)/
35
endif
36

    
37
all:
38
	cd $(root-rel) && make
39

    
40
ifdef lib-dest
41

    
42
subdir: $(lib-dest)
43

    
44
$(lib-dest): $(objs)
45
	rm -f $@
46
	ar rcs $@ $^
47
	$(RANLIB) $@
48

    
49
else
50

    
51
subdir: all.o
52

    
53
all.o: $(objs)
54
	$(LD) -r -o $@ $^
55

    
56
endif
57

    
58
%.o: $(src-path)%.c
59
	$(CC) $(CFLAGS) -o $@ -c $<
60

    
61
depend:
62
	$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source)) >depend
63

    
64
ifneq ($(wildcard depend),)
65
include depend
66
endif
67

    
68
endif