mb/dell: Add Latitude E5520 (Sandy Bridge)
[coreboot.git] / util / bincfg / Makefile
blobdbcbc7711cf0e4303052ea32afbe28d1446bd562
1 ## SPDX-License-Identifier: GPL-2.0-only
2 CC = gcc
3 YACC = bison
4 LEX = flex
5 TARGET=bincfg
6 WERROR=-Werror
7 CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
8 CFLAGS+=-Wno-unused-function
9 LDFLAGS= -lfl
11 all: $(TARGET)
13 $(TARGET): $(TARGET).lex.o $(TARGET).tab.o
14 $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@
16 $(TARGET).lex.c: $(TARGET).l $(TARGET).tab.h
17 $(LEX) -o $(patsubst $(TARGET).l,$(TARGET).lex.c,$<) $<
19 $(TARGET).tab.c $(TARGET).tab.h: $(TARGET).y
20 $(YACC) -d $<
22 # Use this target to generate GbE for X200
23 gen-gbe-ich9m: $(TARGET)
24 $(abspath $(TARGET)) gbe-ich9m.spec gbe-ich9m.set gbe1.bin
25 # duplicate binary as per spec
26 cat gbe1.bin gbe1.bin > flashregion_3_gbe.bin
27 rm -f gbe1.bin
29 # Use this target to generate GbE for X220/x230
30 gen-gbe-82579LM: $(TARGET)
31 $(abspath $(TARGET)) gbe-82579LM.spec gbe-82579LM.set gbe1.bin
32 # duplicate binary as per spec
33 cat gbe1.bin gbe1.bin > flashregion_3_gbe.bin
34 rm -f gbe1.bin
36 # Use this target to generate IFD for X200
37 gen-ifd-x200: $(TARGET)
38 $(abspath $(TARGET)) ifd-x200.spec ifd-x200.set flashregion_0_fd.bin
40 clean:
41 rm -f *.lex.c *.tab.c *.tab.h *.o bincfg flashregion_0_fd.bin flashregion_3_gbe.bin
43 distclean: clean
45 help:
46 @echo "${TARGET}: Compiler/Decompiler for data blobs with specs"
47 @echo "Targets: all, clean, distclean, help"
48 @echo " gen-gbe-ich9m - generate GbE for X200"
49 @echo " gen-gbe-82579LM - generate GbE for X220/x230"
50 @echo " gen-ifd-x200 - generate IFD for X200"
51 @echo "To disable warnings as errors, run make as:"
52 @echo " make all WERROR=\"\""
54 .PHONY: all clean distclean help
55 .PHONY: gen-gbe-ich9m gen-ifd-x200 gen-gbe-82579LM