2010-04-08 13:37:43 +02:00
|
|
|
sconfigobj :=
|
|
|
|
sconfigobj += lex.yy.o
|
|
|
|
sconfigobj += sconfig.tab.o
|
2010-05-05 13:19:50 +02:00
|
|
|
sconfigobj += main.o
|
|
|
|
|
|
|
|
SCONFIGFLAGS += -I$(top)/util/sconfig -I$(objutil)/sconfig
|
2010-04-08 13:37:43 +02:00
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/sconfig:
|
2010-04-08 13:37:43 +02:00
|
|
|
mkdir -p $@
|
|
|
|
|
2010-05-05 13:19:50 +02:00
|
|
|
$(objutil)/sconfig/%.o: util/sconfig/%.c
|
|
|
|
printf " HOSTCC $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(SCONFIGFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/sconfig/%.o: $(objutil)/sconfig/%.c
|
2010-04-08 13:37:43 +02:00
|
|
|
printf " HOSTCC $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(SCONFIGFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2010-08-09 15:28:18 +02:00
|
|
|
ifdef CONFIG_SCONFIG_GENPARSER
|
2010-04-08 13:37:43 +02:00
|
|
|
$(top)/util/sconfig/lex.yy.c_shipped: $(top)/util/sconfig/sconfig.l
|
2010-08-09 15:28:18 +02:00
|
|
|
printf " FLEX $(subst $(top)/,,$(@))\n"
|
2010-04-08 14:59:41 +02:00
|
|
|
flex -L -o $@ $<
|
2010-04-08 13:37:43 +02:00
|
|
|
|
|
|
|
# the .c rule also creates .h
|
|
|
|
$(top)/util/sconfig/sconfig.tab.h_shipped: $(top)/util/sconfig/sconfig.tab.c_shipped
|
|
|
|
$(top)/util/sconfig/sconfig.tab.c_shipped: $(top)/util/sconfig/sconfig.y
|
2010-08-09 15:28:18 +02:00
|
|
|
printf " BISON $(subst $(top)/,,$(@))\n"
|
2010-04-08 14:59:41 +02:00
|
|
|
bison -l --defines=$(top)/util/sconfig/sconfig.tab.h_shipped -o $@ $<
|
2010-04-08 13:37:43 +02:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/sconfig/lex.yy.o: $(objutil)/sconfig/sconfig.tab.h
|
2010-04-08 13:37:43 +02:00
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/sconfig/%: $(top)/util/sconfig/%_shipped
|
2010-04-08 14:00:35 +02:00
|
|
|
mkdir -p $(dir $@)
|
2010-04-08 13:37:43 +02:00
|
|
|
cp $< $@
|
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/sconfig/sconfig: $(objutil)/sconfig $(addprefix $(objutil)/sconfig/,$(sconfigobj))
|
2010-04-08 15:16:32 +02:00
|
|
|
printf " HOSTCC $(subst $(obj)/,,$(@)) (link)\n"
|
2010-04-17 00:48:57 +02:00
|
|
|
$(HOSTCC) $(SCONFIGFLAGS) -o $@ $(addprefix $(objutil)/sconfig/,$(sconfigobj))
|