mb/ibm/sbp1: Update PCIe SBDF in comment
[coreboot2.git] / util / bincfg / Makefile.mk
blob0f5f442fd1a12796d867ee679ae005a55de5681d
1 ## SPDX-License-Identifier: GPL-2.0-only
2 bincfg_obj := bincfg.lex.o bincfg.tab.o
4 BINCFG_FLAGS += -I$(top)/util/bincfg -I$(objutil)/bincfg
6 $(objutil)/bincfg:
7 mkdir -p $@
9 $(objutil)/bincfg/.generated: $(objutil)/bincfg
10 touch $@
12 $(objutil)/bincfg/%.o: util/bincfg/%.c | $(objutil)/bincfg/.generated
13 printf " HOSTCC $(subst $(obj)/,,$(@))\n"
14 $(HOSTCC) $(BINCFG_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
16 $(objutil)/bincfg/%.o: $(objutil)/bincfg/%.c
17 printf " HOSTCC $(subst $(obj)/,,$(@))\n"
18 $(HOSTCC) $(BINCFG_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
20 ifeq ($(CONFIG_UTIL_GENPARSER),y)
21 $(top)/util/bincfg/bincfg.lex.c_shipped: $(top)/util/bincfg/bincfg.l
22 printf " FLEX $(subst $(top)/,,$(@))\n"
23 flex -L -o $@ $<
25 # the .c rule also creates .h
26 $(top)/util/bincfg/bincfg.tab.h_shipped: $(top)/util/bincfg/bincfg.tab.c_shipped
27 $(top)/util/bincfg/bincfg.tab.c_shipped: $(top)/util/bincfg/bincfg.y
28 printf " BISON $(subst $(top)/,,$(@))\n"
29 bison -l --defines=$(top)/util/bincfg/bincfg.tab.h_shipped -o $@ $<
30 endif
32 $(objutil)/bincfg/bincfg.lex.o: $(objutil)/bincfg/bincfg.tab.h
34 $(objutil)/bincfg/%: $(top)/util/bincfg/%_shipped
35 mkdir -p $(dir $@)
36 cp $< $@
38 $(objutil)/bincfg/bincfg: $(addprefix $(objutil)/bincfg/,$(bincfg_obj))
39 printf " HOSTCC $(subst $(obj)/,,$(@)) (link)\n"
40 $(HOSTCC) $(BINCFG_FLAGS) -o $@ $(addprefix $(objutil)/bincfg/,$(bincfg_obj))
42 $(addprefix $(objutil)/bincfg/,$(bincfg_obj)) : $(objutil)/bincfg/bincfg.tab.h $(objutil)/bincfg/bincfg.tab.c $(objutil)/bincfg/bincfg.lex.c