Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1 | sconfigobj := |
| 2 | sconfigobj += lex.yy.o |
| 3 | sconfigobj += sconfig.tab.o |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 4 | sconfigobj += main.o |
| 5 | |
| 6 | SCONFIGFLAGS += -I$(top)/util/sconfig -I$(objutil)/sconfig |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 7 | SCONFIGFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 8 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 9 | $(objutil)/sconfig: |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 10 | mkdir -p $@ |
| 11 | |
Patrick Georgi | d935f03 | 2013-12-05 20:17:36 +0100 | [diff] [blame] | 12 | $(objutil)/sconfig/.generated: $(objutil)/sconfig |
| 13 | touch $@ |
| 14 | |
| 15 | $(objutil)/sconfig/%.o: util/sconfig/%.c | $(objutil)/sconfig/.generated |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 16 | printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
| 17 | $(HOSTCC) $(SCONFIGFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 18 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 19 | $(objutil)/sconfig/%.o: $(objutil)/sconfig/%.c |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 20 | printf " HOSTCC $(subst $(obj)/,,$(@))\n" |
| 21 | $(HOSTCC) $(SCONFIGFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 22 | |
Martin Roth | f411b70 | 2017-04-09 19:12:42 -0600 | [diff] [blame] | 23 | ifeq ($(CONFIG_UTIL_GENPARSER),y) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 24 | $(top)/util/sconfig/lex.yy.c_shipped: $(top)/util/sconfig/sconfig.l |
Stefan Reinauer | 9bf7810 | 2010-08-09 13:28:18 +0000 | [diff] [blame] | 25 | printf " FLEX $(subst $(top)/,,$(@))\n" |
Patrick Georgi | 05245ec | 2010-04-08 12:59:41 +0000 | [diff] [blame] | 26 | flex -L -o $@ $< |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 27 | |
| 28 | # the .c rule also creates .h |
| 29 | $(top)/util/sconfig/sconfig.tab.h_shipped: $(top)/util/sconfig/sconfig.tab.c_shipped |
| 30 | $(top)/util/sconfig/sconfig.tab.c_shipped: $(top)/util/sconfig/sconfig.y |
Stefan Reinauer | 9bf7810 | 2010-08-09 13:28:18 +0000 | [diff] [blame] | 31 | printf " BISON $(subst $(top)/,,$(@))\n" |
Patrick Georgi | 05245ec | 2010-04-08 12:59:41 +0000 | [diff] [blame] | 32 | bison -l --defines=$(top)/util/sconfig/sconfig.tab.h_shipped -o $@ $< |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 33 | |
| 34 | endif |
| 35 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 36 | $(objutil)/sconfig/lex.yy.o: $(objutil)/sconfig/sconfig.tab.h |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 37 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 38 | $(objutil)/sconfig/%: $(top)/util/sconfig/%_shipped |
Patrick Georgi | 109a1de | 2010-04-08 12:00:35 +0000 | [diff] [blame] | 39 | mkdir -p $(dir $@) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 40 | cp $< $@ |
| 41 | |
Patrick Georgi | d935f03 | 2013-12-05 20:17:36 +0100 | [diff] [blame] | 42 | $(objutil)/sconfig/sconfig: $(addprefix $(objutil)/sconfig/,$(sconfigobj)) |
Stefan Reinauer | e705f9c | 2010-04-08 13:16:32 +0000 | [diff] [blame] | 43 | printf " HOSTCC $(subst $(obj)/,,$(@)) (link)\n" |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 44 | $(HOSTCC) $(SCONFIGFLAGS) -o $@ $(addprefix $(objutil)/sconfig/,$(sconfigobj)) |
Patrick Georgi | aeeafc0 | 2014-04-15 20:14:21 +0200 | [diff] [blame] | 45 | |
| 46 | $(addprefix $(objutil)/sconfig/,$(sconfigobj)) : $(objutil)/sconfig/sconfig.tab.h $(objutil)/sconfig/sconfig.tab.c $(objutil)/sconfig/lex.yy.c |