6 CFLAGS
=-O2
-Wall
-Wextra
-Wshadow
${WERROR}
7 CFLAGS
+=-Wno-unused-function
12 $(TARGET
): $(TARGET
).
lex.o
$(TARGET
).tab.o
13 $(CC
) $^
$(CFLAGS
) $(LDFLAGS
) -o
$@
15 $(TARGET
).
lex.c
: $(TARGET
).l
$(TARGET
).tab.h
16 $(LEX
) -o
$(patsubst $(TARGET
).l
,$(TARGET
).
lex.c
,$<) $<
18 $(TARGET
).tab.c
$(TARGET
).tab.h
: $(TARGET
).y
21 # Use this target to generate GbE for X200
22 gen-gbe-ich9m
: $(TARGET
)
23 $(abspath
$(TARGET
)) gbe-ich9m.spec gbe-ich9m.set gbe1.bin
24 # duplicate binary as per spec
25 cat gbe1.bin gbe1.bin
> flashregion_3_gbe.bin
28 # Use this target to generate GbE for X220/x230
29 gen-gbe-82579LM
: $(TARGET
)
30 $(abspath
$(TARGET
)) gbe-82579LM.spec gbe-82579LM.set gbe1.bin
31 # duplicate binary as per spec
32 cat gbe1.bin gbe1.bin
> flashregion_3_gbe.bin
35 # Use this target to generate IFD for X200
36 gen-ifd-x200
: $(TARGET
)
37 $(abspath
$(TARGET
)) ifd-x200.spec ifd-x200.set flashregion_0_fd.bin
40 rm -f
*.
lex.c
*.tab.c
*.tab.h
*.o bincfg flashregion_0_fd.bin flashregion_3_gbe.bin
45 @echo
"${TARGET}: Compiler/Decompiler for data blobs with specs"
46 @echo
"Targets: all, clean, distclean, help"
47 @echo
" gen-gbe-ich9m - generate GbE for X200"
48 @echo
" gen-gbe-82579LM - generate GbE for X220/x230"
49 @echo
" gen-ifd-x200 - generate IFD for X200"
50 @echo
"To disable warnings as errors, run make as:"
51 @echo
" make all WERROR=\"\""
53 .PHONY
: all clean distclean help
54 .PHONY
: gen-gbe-ich9m gen-ifd-x200 gen-gbe-82579LM