Statistics
| Branch: | Revision:

iof-bird-daemon / tools / Rules.in @ 973304bc

History | View | Annotate | Download (1.14 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
CLIENT_LIBS=@CLIENT_LIBS@
24
CC=@CC@
25
M4=@M4@
26
BISON=@BISON@
27
FLEX=@FLEX@
28
RANLIB=@RANLIB@
29

    
30
ifdef source
31

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

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

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

    
41
ifdef lib-dest
42

    
43
subdir: $(lib-dest)
44

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

    
50
else
51

    
52
subdir: all.o
53

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

    
57
endif
58

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

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

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

    
69
endif