1 ## SPDX-License-Identifier: GPL-2.0-only
4 sconfigobj
+= sconfig.tab.o
7 SCONFIGFLAGS
+= -I
$(top
)/util
/sconfig
-I
$(objutil
)/sconfig
8 SCONFIGFLAGS
+= -I
$(top
)/src
/commonlib
/include -I
$(top
)/src
/commonlib
/bsd
/include
13 $(objutil
)/sconfig
/.generated
: $(objutil
)/sconfig
16 $(objutil
)/sconfig
/%.o
: util
/sconfig
/%.c |
$(objutil
)/sconfig
/.generated
17 printf
" HOSTCC $(subst $(obj)/,,$(@))\n"
18 $(HOSTCC
) $(SCONFIGFLAGS
) $(HOSTCFLAGS
) -c
-o
$@
$<
20 $(objutil
)/sconfig
/%.o
: $(objutil
)/sconfig
/%.c
21 printf
" HOSTCC $(subst $(obj)/,,$(@))\n"
22 $(HOSTCC
) $(SCONFIGFLAGS
) $(HOSTCFLAGS
) -c
-o
$@
$<
24 ifeq ($(CONFIG_UTIL_GENPARSER
),y
)
25 $(top
)/util
/sconfig
/lex.yy.c_shipped
: $(top
)/util
/sconfig
/sconfig.l
26 printf
" FLEX $(subst $(top)/,,$(@))\n"
29 # the .c rule also creates .h
30 $(top
)/util
/sconfig
/sconfig.tab.h_shipped
: $(top
)/util
/sconfig
/sconfig.tab.c_shipped
31 $(top
)/util
/sconfig
/sconfig.tab.c_shipped
: $(top
)/util
/sconfig
/sconfig.y
32 printf
" BISON $(subst $(top)/,,$(@))\n"
33 bison
-l
--defines
=$(top
)/util
/sconfig
/sconfig.tab.h_shipped
-o
$@
$<
37 $(objutil
)/sconfig
/lex.yy.o
: $(objutil
)/sconfig
/sconfig.tab.h
39 $(objutil
)/sconfig
/%: $(top
)/util
/sconfig
/%_shipped
43 $(objutil
)/sconfig
/sconfig
: $(addprefix $(objutil
)/sconfig
/,$(sconfigobj
))
44 printf
" HOSTCC $(subst $(obj)/,,$(@)) (link)\n"
45 $(HOSTCC
) $(SCONFIGFLAGS
) -o
$@
$(addprefix $(objutil
)/sconfig
/,$(sconfigobj
))
47 $(addprefix $(objutil
)/sconfig
/,$(sconfigobj
)) : $(objutil
)/sconfig
/sconfig.tab.h
$(objutil
)/sconfig
/sconfig.tab.c
$(objutil
)/sconfig
/lex.yy.c