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 $@
|
|
|
|
|
2013-12-05 20:17:36 +01:00
|
|
|
$(objutil)/sconfig/.generated: $(objutil)/sconfig
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(objutil)/sconfig/%.o: util/sconfig/%.c | $(objutil)/sconfig/.generated
|
2010-05-05 13:19:50 +02:00
|
|
|
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 $@ $<
|
|
|
|
|
2017-04-10 03:12:42 +02:00
|
|
|
ifeq ($(CONFIG_UTIL_GENPARSER),y)
|
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 $< $@
|
|
|
|
|
2013-12-05 20:17:36 +01:00
|
|
|
$(objutil)/sconfig/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))
|
2014-04-15 20:14:21 +02:00
|
|
|
|
|
|
|
$(addprefix $(objutil)/sconfig/,$(sconfigobj)) : $(objutil)/sconfig/sconfig.tab.h $(objutil)/sconfig/sconfig.tab.c $(objutil)/sconfig/lex.yy.c
|