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)
|
2013-04-19 19:59:08 +08:00
|
|
|
client-dirs := client
|
|
|
|
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
|
|
|
|
2013-04-19 19:59:08 +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@
|
2004-08-19 17:15:36 +08:00
|
|
|
LDFLAGS=@LDFLAGS@
|
1999-03-04 19:36:26 +08:00
|
|
|
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)
|
2010-08-04 19:53:52 +08:00
|
|
|
# $(LD) -r -o $@ $^
|
|
|
|
# Changed to $(CC) because $(LD) has problems with crosscompiling
|
2015-07-19 05:15:04 +08:00
|
|
|
@echo LD -r -o $@ $^
|
|
|
|
@$(CC) -nostdlib -r -o $@ $^
|
1999-01-10 08:18:32 +08:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: $(src-path)%.c
|
2015-07-19 05:15:04 +08:00
|
|
|
@echo CC -o $@ -c $<
|
|
|
|
@$(CC) $(CFLAGS) -o $@ -c $<
|
1999-01-10 08:18:32 +08:00
|
|
|
|
2013-04-19 19:59:08 +08:00
|
|
|
ifndef source-dep
|
|
|
|
source-dep := $(source)
|
|
|
|
endif
|
|
|
|
|
1999-01-10 08:18:32 +08:00
|
|
|
depend:
|
2013-04-19 19:59:08 +08:00
|
|
|
$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) >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
|