1999-01-10 08:18:32 +08:00
|
|
|
# Makefile fragments for the BIRD Internet Routing Daemon
|
2000-05-06 01:15:56 +08:00
|
|
|
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
srcdir=@srcdir_rel_mf@
|
2000-05-06 01:15:56 +08:00
|
|
|
srcdir_abs := $(shell cd $(srcdir) ; pwd)
|
1999-01-10 08:18:32 +08:00
|
|
|
objdir=@objdir@
|
|
|
|
exedir=@exedir@
|
|
|
|
|
|
|
|
protocols=@protocols@
|
1999-01-16 00:52:14 +08:00
|
|
|
static-dirs := nest filter $(addprefix proto/,$(protocols))
|
1999-01-10 08:18:32 +08:00
|
|
|
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
|
|
|
|
dynamic-dirs := lib conf
|
|
|
|
dynamic-dir-paths := $(dynamic-dirs)
|
2000-02-15 01:32:50 +08:00
|
|
|
client-dirs := @CLIENT@
|
1999-10-29 17:44:44 +08:00
|
|
|
client-dir-paths := $(client-dirs)
|
2000-05-06 01:15:56 +08:00
|
|
|
doc-dirs := doc
|
|
|
|
doc-dir-paths := $(doc-dirs)
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2000-05-06 01:15:56 +08:00
|
|
|
all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs) $(doc-dirs)
|
1999-01-10 08:18:32 +08:00
|
|
|
clean-dirs:=$(all-dirs) proto sysdep
|
|
|
|
|
1999-05-21 22:28:44 +08:00
|
|
|
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
|
1999-01-10 08:18:32 +08:00
|
|
|
CFLAGS=$(CPPFLAGS) @CFLAGS@
|
1999-03-04 19:36:26 +08:00
|
|
|
LDFLAGS=
|
|
|
|
LIBS=@LIBS@
|
2000-01-20 21:13:30 +08:00
|
|
|
CLIENT_LIBS=@CLIENT_LIBS@
|
1999-01-10 08:18:32 +08:00
|
|
|
CC=@CC@
|
|
|
|
M4=@M4@
|
|
|
|
BISON=@BISON@
|
|
|
|
FLEX=@FLEX@
|
|
|
|
RANLIB=@RANLIB@
|
2000-05-08 21:54:59 +08:00
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA=@INSTALL_DATA@
|
|
|
|
|
|
|
|
prefix=@prefix@
|
|
|
|
exec_prefix=@exec_prefix@
|
|
|
|
bindir=@bindir@
|
|
|
|
sbindir=@sbindir@
|
|
|
|
sysconfdir=@sysconfdir@
|
2000-05-08 22:19:47 +08:00
|
|
|
localstatedir=@localstatedir@
|
2000-06-09 14:31:43 +08:00
|
|
|
docdir=@prefix@/doc
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
ifdef source
|
|
|
|
|
|
|
|
objs := $(subst .c,.o,$(source))
|
|
|
|
|
|
|
|
ifdef dir-name
|
|
|
|
src-path := $(srcdir)/$(dir-name)/
|
|
|
|
endif
|
|
|
|
|
|
|
|
all:
|
|
|
|
cd $(root-rel) && make
|
|
|
|
|
|
|
|
ifdef lib-dest
|
|
|
|
|
|
|
|
subdir: $(lib-dest)
|
|
|
|
|
|
|
|
$(lib-dest): $(objs)
|
|
|
|
rm -f $@
|
|
|
|
ar rcs $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
subdir: all.o
|
|
|
|
|
|
|
|
all.o: $(objs)
|
|
|
|
$(LD) -r -o $@ $^
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: $(src-path)%.c
|
1999-01-13 04:36:18 +08:00
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
depend:
|
1999-04-13 01:21:11 +08:00
|
|
|
$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source)) >depend
|
1999-01-10 08:18:32 +08:00
|
|
|
|
1999-01-13 04:36:18 +08:00
|
|
|
ifneq ($(wildcard depend),)
|
|
|
|
include depend
|
1999-01-10 08:18:32 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|