Commit 9bb992cc authored by Maria Matejka's avatar Maria Matejka
Browse files

Merge branch 'master' into HEAD

parents be721bc6 5d511948
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ endif
docgoals := docs userdocs progdocs
testgoals := check test tests tests_run
cleangoals := clean distclean testsclean
.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags cscope
.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags cscope prepare

all: daemon cli

daemon: $(daemon)
@@ -103,35 +104,50 @@ include $(addsuffix /Makefile,$(addprefix $(srcdir)/,$(dirs)))

# Generic rules
# Object file rules
$(objdir)/%.o: $(srcdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.o: $(srcdir)/%.c | prepare
	$(E)echo CC -o $@ -c $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<

$(objdir)/%.o: $(objdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.o: $(objdir)/%.c | prepare
	$(E)echo CC -o $@ -c $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<

# Debug: Preprocessed source rules
$(objdir)/%.E: $(srcdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.E: $(srcdir)/%.c | prepare
	$(E)echo CC -o $@ -E $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -E $<

$(objdir)/%.E: $(objdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.E: $(objdir)/%.c | prepare
	$(E)echo CC -o $@ -E $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -E $<

# Debug: Assembler object rules
$(objdir)/%.S: $(srcdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.S: $(srcdir)/%.c | prepare
	$(E)echo CC -o $@ -S $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -S $<

$(objdir)/%.S: $(objdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
$(objdir)/%.S: $(objdir)/%.c | prepare
	$(E)echo CC -o $@ -S $<
	$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -S $<

# Finally include the computed dependencies:
DEPS = $(shell find $(objdir) -name '*.d')

# ## if there is at least one non-clean goal
ifneq ($(filter-out $(cleangoals),$(MAKECMDGOALS)),)
-include $(DEPS)
endif

# ## if the implicit goal is called
ifeq ($(MAKECMDGOALS),)
-include $(DEPS)
endif

# Rule for pre-generating all generated includables
# before compiling any C file
prepare: $(objdir)/sysdep/paths.h | $(objdir)/.dir-stamp

$(objdir)/.dir-stamp:
$(objdir)/.dir-stamp: Makefile
	$(E)echo MKDIR -p $(addprefix $(objdir)/,$(dirs) doc)
	$(Q)mkdir -p $(addprefix $(objdir)/,$(dirs) doc)
	$(Q)touch $@
@@ -150,7 +166,7 @@ $(objdir)/sysdep/paths.h: Makefile

tests_targets_ok = $(addsuffix .ok,$(tests_targets))

$(tests_targets): %: %.o $(tests_objs)
$(tests_targets): %: %.o $(tests_objs) | prepare
	$(E)echo LD $(LDFLAGS) -o $@ $< "..." $(LIBS)
	$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

@@ -165,16 +181,6 @@ check: tests tests_run
tests: $(tests_targets)
tests_run: $(tests_targets_ok)

# Finally include the computed dependencies

ifneq ($(filter-out $(cleangoals),$(MAKECMDGOALS)),)
-include $(shell find $(objdir) -name "*.d")
endif

ifeq ($(MAKECMDGOALS),)
-include $(shell find $(objdir) -name "*.d")
endif

tags:
	cd $(srcdir) ; etags -lc `find $(dirs) -name *.[chY]`

+0 −2
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@ obj := $(src-o-files)

$(all-client)

$(o)commands.o: $(objdir)/conf/commands.h

$(exedir)/birdc: $(o)birdc.o
$(exedir)/birdc: LIBS += $(CLIENT_LIBS)

+2 −1
Original line number Diff line number Diff line
@@ -25,9 +25,10 @@ $(o)cf-parse.tab.c: $(o)cf-parse.y
$(o)cf-lex.c: $(s)cf-lex.l
	$(FLEX) $(FLEX_DEBUG) -f -s -B -8 -Pcf_ -o$@ $<

$(o)cf-lex.o: $(o)cf-parse.tab.h $(o)keywords.h
$(o)cf-lex.o: CFLAGS+=-Wno-sign-compare -Wno-unused-function

prepare: $(o)keywords.h $(o)commands.h $(o)cf-parse.tab.h

$(addprefix $(o), cf-parse.y keywords.h commands.h cf-parse.tab.h cf-parse.tab.c cf-lex.c): $(objdir)/.dir-stamp

$(call clean,cf-parse.tab.h cf-parse.tab.c cf-parse.y keywords.h commands.h cf-lex.c cf-parse.output)
+1 −1
Original line number Diff line number Diff line
@@ -1045,7 +1045,7 @@ cmd:
   }
 | UNSET '(' rtadot dynamic_attr ')' ';' {
     $$ = f_new_inst_da(FI_EA_SET, $4);
     $$->aux = EAF_TYPE_UNDEF | EAF_TEMP;
     $$->aux = EAF_TYPE_UNDEF;
     $$->a1.p = NULL;
   }
 | break_command print_list ';' { $$ = f_new_inst(FI_PRINT_AND_DIE); $$->a1.p = $2; $$->a2.i = $1; }
+4 −16
Original line number Diff line number Diff line
@@ -196,8 +196,8 @@ struct proto {
   *	   ifa_notify	Notify protocol about interface address changes.
   *	   rt_notify	Notify protocol about routing table updates.
   *	   neigh_notify	Notify protocol about neighbor cache events.
   *	   make_tmp_attrs  Construct ea_list from private attrs stored in rta.
   *	   store_tmp_attrs Store private attrs back to rta. The route MUST NOT be cached.
   *	   make_tmp_attrs  Add attributes to rta from from private attrs stored in rte. The route and rta MUST NOT be cached.
   *	   store_tmp_attrs Store private attrs back to rte and undef added attributes. The route and rta MUST NOT be cached.
   *	   preexport  Called as the first step of the route exporting process.
   *			It can construct a new rte, add private attributes and
   *			decide whether the route shall be exported: 1=yes, -1=no,
@@ -213,8 +213,8 @@ struct proto {
  void (*ifa_notify)(struct proto *, unsigned flags, struct ifa *a);
  void (*rt_notify)(struct proto *, struct channel *, struct network *net, struct rte *new, struct rte *old);
  void (*neigh_notify)(struct neighbor *neigh);
  struct ea_list *(*make_tmp_attrs)(struct rte *rt, struct linpool *pool);
  void (*store_tmp_attrs)(struct rte *rt);
  void (*make_tmp_attrs)(struct rte *rt, struct linpool *pool);
  void (*store_tmp_attrs)(struct rte *rt, struct linpool *pool);
  int (*preexport)(struct proto *, struct rte **rt, struct linpool *pool);
  void (*reload_routes)(struct channel *);
  void (*feed_begin)(struct channel *, int initial);
@@ -299,18 +299,6 @@ proto_get_router_id(struct proto_config *pc)
  return pc->router_id ? pc->router_id : pc->global->router_id;
}

static inline void
rte_make_tmp_attrs(struct rte **rt, struct linpool *pool)
{
  struct ea_list *(*mta)(struct rte *rt, struct linpool *pool);
  mta = (*rt)->attrs->src->proto->make_tmp_attrs;
  if (!mta) return;
  *rt = rte_cow_rta(*rt, pool);
  struct ea_list *ea = mta(*rt, pool);
  ea->next = (*rt)->attrs->eattrs;
  (*rt)->attrs->eattrs = ea;
}


extern pool *proto_pool;
extern list proto_list;
Loading