Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (1.42 KB)

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

    
4
srcdir=@srcdir_rel_mf@
5
srcdir_abs := $(shell cd $(srcdir) ; pwd)
6
objdir=@objdir@
7
exedir=@exedir@
8

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

    
19
all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs) $(doc-dirs)
20
clean-dirs:=$(all-dirs) proto sysdep
21

    
22
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
23
CFLAGS=$(CPPFLAGS) @CFLAGS@
24
LDFLAGS=
25
LIBS=@LIBS@
26
CLIENT_LIBS=@CLIENT_LIBS@
27
CC=@CC@
28
M4=@M4@
29
BISON=@BISON@
30
FLEX=@FLEX@
31
RANLIB=@RANLIB@
32
INSTALL=@INSTALL@
33
INSTALL_PROGRAM=@INSTALL_PROGRAM@
34
INSTALL_DATA=@INSTALL_DATA@
35

    
36
prefix=@prefix@
37
exec_prefix=@exec_prefix@
38
bindir=@bindir@
39
sbindir=@sbindir@
40
sysconfdir=@sysconfdir@
41

    
42
ifdef source
43

    
44
objs := $(subst .c,.o,$(source))
45

    
46
ifdef dir-name
47
src-path := $(srcdir)/$(dir-name)/
48
endif
49

    
50
all:
51
	cd $(root-rel) && make
52

    
53
ifdef lib-dest
54

    
55
subdir: $(lib-dest)
56

    
57
$(lib-dest): $(objs)
58
	rm -f $@
59
	ar rcs $@ $^
60
	$(RANLIB) $@
61

    
62
else
63

    
64
subdir: all.o
65

    
66
all.o: $(objs)
67
	$(LD) -r -o $@ $^
68

    
69
endif
70

    
71
%.o: $(src-path)%.c
72
	$(CC) $(CFLAGS) -o $@ -c $<
73

    
74
depend:
75
	$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source)) >depend
76

    
77
ifneq ($(wildcard depend),)
78
include depend
79
endif
80

    
81
endif