1999-01-10 08:18:32 +08:00
|
|
|
# Makefile fragments for the BIRD Internet Routing Daemon
|
|
|
|
# (c) 1999 Martin Mares <mj@ucw.cz>
|
|
|
|
|
|
|
|
srcdir=@srcdir_rel_mf@
|
|
|
|
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)
|
|
|
|
dir-makefiles := $(addsuffix /Makefile,$(static-dir-paths) $(dynamic-dir-paths))
|
|
|
|
|
|
|
|
all-dirs:=$(static-dirs) $(dynamic-dirs)
|
|
|
|
clean-dirs:=$(all-dirs) proto sysdep
|
|
|
|
dir-objs:=$(addprefix $(objdir)/,$(all-dirs))
|
|
|
|
|
|
|
|
CPPFLAGS=-I$(root-rel) -I$(srcdir)
|
|
|
|
CFLAGS=$(CPPFLAGS) @CFLAGS@
|
1999-03-04 19:36:26 +08:00
|
|
|
LDFLAGS=
|
|
|
|
LIBS=@LIBS@
|
1999-01-10 08:18:32 +08:00
|
|
|
CC=@CC@
|
|
|
|
M4=@M4@
|
|
|
|
BISON=@BISON@
|
|
|
|
FLEX=@FLEX@
|
|
|
|
RANLIB=@RANLIB@
|
|
|
|
|
|
|
|
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:
|
|
|
|
gcc $(CPPFLAGS) -MM $(addprefix $(src-path),$(source)) >depend
|
|
|
|
|
1999-01-13 04:36:18 +08:00
|
|
|
ifneq ($(wildcard depend),)
|
|
|
|
include depend
|
1999-01-10 08:18:32 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|