1999-01-10 00:18:32 +00:00
|
|
|
# Makefile fragments for the BIRD Internet Routing Daemon
|
2000-05-05 17:15:56 +00:00
|
|
|
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
1999-01-10 00:18:32 +00:00
|
|
|
|
|
|
|
srcdir=@srcdir_rel_mf@
|
2000-05-05 17:15:56 +00:00
|
|
|
srcdir_abs := $(shell cd $(srcdir) ; pwd)
|
1999-01-10 00:18:32 +00:00
|
|
|
objdir=@objdir@
|
|
|
|
exedir=@exedir@
|
|
|
|
|
|
|
|
protocols=@protocols@
|
1999-01-15 16:52:14 +00:00
|
|
|
static-dirs := nest filter $(addprefix proto/,$(protocols))
|
1999-01-10 00:18:32 +00:00
|
|
|
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
|
|
|
|
dynamic-dirs := lib conf
|
|
|
|
dynamic-dir-paths := $(dynamic-dirs)
|
2013-04-19 11:59:08 +00:00
|
|
|
client-dirs := client
|
|
|
|
client-dir-paths := $(client-dirs)
|
2000-05-05 17:15:56 +00:00
|
|
|
doc-dirs := doc
|
|
|
|
doc-dir-paths := $(doc-dirs)
|
1999-01-10 00:18:32 +00:00
|
|
|
|
2013-04-19 11:59:08 +00:00
|
|
|
all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs) $(doc-dirs)
|
1999-01-10 00:18:32 +00:00
|
|
|
clean-dirs:=$(all-dirs) proto sysdep
|
|
|
|
|
2015-09-27 22:18:35 +00:00
|
|
|
CPPFLAGS=-I$(root-rel) -I$(srcdir) -I$(srcdir)/rtrlib @CPPFLAGS@
|
1999-01-10 00:18:32 +00:00
|
|
|
CFLAGS=$(CPPFLAGS) @CFLAGS@
|
2004-08-19 09:15:36 +00:00
|
|
|
LDFLAGS=@LDFLAGS@
|
1999-03-04 11:36:26 +00:00
|
|
|
LIBS=@LIBS@
|
2000-01-20 13:13:30 +00:00
|
|
|
CLIENT_LIBS=@CLIENT_LIBS@
|
1999-01-10 00:18:32 +00:00
|
|
|
CC=@CC@
|
|
|
|
M4=@M4@
|
|
|
|
BISON=@BISON@
|
|
|
|
FLEX=@FLEX@
|
|
|
|
RANLIB=@RANLIB@
|
2000-05-08 13:54:59 +00: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 14:19:47 +00:00
|
|
|
localstatedir=@localstatedir@
|
2000-06-09 06:31:43 +00:00
|
|
|
docdir=@prefix@/doc
|
1999-01-10 00:18:32 +00: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 11:53:52 +00:00
|
|
|
# $(LD) -r -o $@ $^
|
|
|
|
# Changed to $(CC) because $(LD) has problems with crosscompiling
|
2015-07-18 21:15:04 +00:00
|
|
|
@echo LD -r -o $@ $^
|
|
|
|
@$(CC) -nostdlib -r -o $@ $^
|
1999-01-10 00:18:32 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: $(src-path)%.c
|
2015-07-18 21:15:04 +00:00
|
|
|
@echo CC -o $@ -c $<
|
|
|
|
@$(CC) $(CFLAGS) -o $@ -c $<
|
1999-01-10 00:18:32 +00:00
|
|
|
|
2013-04-19 11:59:08 +00:00
|
|
|
ifndef source-dep
|
|
|
|
source-dep := $(source)
|
|
|
|
endif
|
|
|
|
|
1999-01-10 00:18:32 +00:00
|
|
|
depend:
|
2013-04-19 11:59:08 +00:00
|
|
|
$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) >depend
|
1999-01-10 00:18:32 +00:00
|
|
|
|
1999-01-12 20:36:18 +00:00
|
|
|
ifneq ($(wildcard depend),)
|
|
|
|
include depend
|
1999-01-10 00:18:32 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|