Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/37070 )
Change subject: Add dependency tracking to Makefile ......................................................................
Add dependency tracking to Makefile
Reworking Makefile to show more warnings in the code. Create dependencies and compile files separately.
Change-Id: I03d4c656a0c4529473adadc3db7bfb9141094021 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M .gitignore M Makefile 2 files changed, 33 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/70/37070/1
diff --git a/.gitignore b/.gitignore index f6eb53d..62b9d8e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /makechips /makedpfw /EM100Pro.msi +*.o diff --git a/Makefile b/Makefile index 0518c6f..e56d380 100644 --- a/Makefile +++ b/Makefile @@ -17,36 +17,56 @@
.SILENT:
-CFLAGS?=-O2 -g -CFLAGS+=-Wall -Werror +CFLAGS ?=-O2 -g -fomit-frame-pointer +CFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0) + +CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes +CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra +CFLAGS += -Wno-unused-but-set-variable +# Remove after fixing +CFLAGS +=-Wno-sign-compare -Wno-discarded-qualifiers + +LDFLAGS ?= +LDFLAGS += $(shell $(PKG_CONFIG) --libs libusb-1.0) + CC?=gcc PKG_CONFIG?=pkg-config
SOURCES=em100.c firmware.c fpga.c hexdump.c sdram.c spi.c system.c trace.c usb.c -INCLUDES=em100pro_chips.h em100.h +OBJECTS=$(SOURCES:.c=.o)
-all: em100 +all: dep em100
-em100: $(SOURCES) $(INCLUDES) - printf " CC em100\n" - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(SOURCES) \ - $(shell $(PKG_CONFIG) --cflags --libs libusb-1.0) +em100: $(OBJECTS) + printf " LD em100\n" + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
em100pro_chips.h: makechips.sh printf " CREATE em100pro_chips.sh & firmware images\n" LANG=C ./makechips.sh
-makechips.sh: makedpfw makechips - %: %.c - printf " CC $@\n" + printf " CC+LD $@\n" $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
+%.o: %.c + printf " CC $@\n" + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< + +dep: $(SOURCES) em100pro_chips.h + $(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCES) > .dependencies + +makechips.sh: makedpfw makechips + clean: rm -f em100 makedpfw makechips + rm -f $(OBJECTS) # $(SOURCES:.c=.d) rm -rf configs firmware + rm -f .dependencies
distclean: clean - rm em100pro_chips.h + rm -f em100pro_chips.h + +-include .dependencies
.PHONY: clean distclean
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/em100/+/37070
to look at the new patch set (#3).
Change subject: Add dependency tracking to Makefile ......................................................................
Add dependency tracking to Makefile
Reworking Makefile to show more warnings in the code. Create dependencies and compile files separately.
Change-Id: I03d4c656a0c4529473adadc3db7bfb9141094021 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M .gitignore M Makefile 2 files changed, 34 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/70/37070/3
Hello Furquan Shaikh, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/em100/+/37070
to look at the new patch set (#5).
Change subject: Add dependency tracking to Makefile ......................................................................
Add dependency tracking to Makefile
Reworking Makefile to show more warnings in the code. Create dependencies and compile files separately.
Change-Id: I03d4c656a0c4529473adadc3db7bfb9141094021 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M .gitignore M Makefile 2 files changed, 35 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/70/37070/5
Hello Furquan Shaikh, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/em100/+/37070
to look at the new patch set (#6).
Change subject: Add dependency tracking to Makefile ......................................................................
Add dependency tracking to Makefile
Reworking Makefile to show more warnings in the code. Create dependencies and compile files separately.
Change-Id: I03d4c656a0c4529473adadc3db7bfb9141094021 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M .gitignore M Makefile 2 files changed, 35 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/70/37070/6
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/em100/+/37070 )
Change subject: Add dependency tracking to Makefile ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/em100/+/37070/6/Makefile File Makefile:
https://review.coreboot.org/c/em100/+/37070/6/Makefile@64 PS6, Line 64: #perl -pi -e 's,^xz,xz/xz,g' .dependencies GCC produces a broken dependency file but jenkins thinks this replacement is insecure. Leaving it commented out to be solved in a later attempt, as xz is pretty much static code.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/em100/+/37070 )
Change subject: Add dependency tracking to Makefile ......................................................................
Patch Set 6: Code-Review+2
(1 comment)
https://review.coreboot.org/c/em100/+/37070/6/Makefile File Makefile:
https://review.coreboot.org/c/em100/+/37070/6/Makefile@64 PS6, Line 64: #perl -pi -e 's,^xz,xz/xz,g' .dependencies
GCC produces a broken dependency file but jenkins thinks this replacement is insecure. […]
Ack
Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/37070 )
Change subject: Add dependency tracking to Makefile ......................................................................
Add dependency tracking to Makefile
Reworking Makefile to show more warnings in the code. Create dependencies and compile files separately.
Change-Id: I03d4c656a0c4529473adadc3db7bfb9141094021 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Reviewed-on: https://review.coreboot.org/c/em100/+/37070 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M .gitignore M Makefile 2 files changed, 35 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/.gitignore b/.gitignore index f6eb53d..c89766e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /makechips /makedpfw /EM100Pro.msi +.dependencies +*.o diff --git a/Makefile b/Makefile index 240b479..be7d6ad 100644 --- a/Makefile +++ b/Makefile @@ -23,36 +23,57 @@ endif endif
-CFLAGS?=-O2 -g -CFLAGS+=-Wall -Werror +CFLAGS ?=-O2 -g -fomit-frame-pointer +CFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0) + +CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes +CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra +CFLAGS += -Wno-unused-but-set-variable +# Remove after fixing +CFLAGS +=-Wno-sign-compare -Wno-discarded-qualifiers + +LDFLAGS ?= +LDFLAGS += $(shell $(PKG_CONFIG) --libs libusb-1.0) + CC?=gcc PKG_CONFIG?=pkg-config
SOURCES=em100.c firmware.c fpga.c hexdump.c sdram.c spi.c system.c trace.c usb.c -INCLUDES=em100pro_chips.h em100.h +OBJECTS=$(SOURCES:.c=.o)
-all: em100 +all: dep em100
-em100: $(SOURCES) $(INCLUDES) - printf " CC em100\n" - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(SOURCES) \ - $(shell $(PKG_CONFIG) --cflags --libs libusb-1.0) +em100: $(OBJECTS) + printf " LD em100\n" + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
em100pro_chips.h: makechips.sh printf " CREATE em100pro_chips.sh & firmware images\n" LANG=C ./makechips.sh
-makechips.sh: makedpfw makechips - %: %.c - printf " CC $@\n" + printf " CC+LD $@\n" $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
+%.o: %.c + printf " CC $@\n" + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< + +dep: $(SOURCES) em100pro_chips.h + $(CC) $(CFLAGS) -MM $(SOURCES) > .dependencies + #perl -pi -e 's,^xz,xz/xz,g' .dependencies + +makechips.sh: makedpfw makechips + clean: rm -f em100 makedpfw makechips + rm -f $(OBJECTS) rm -rf configs firmware + rm -f .dependencies
distclean: clean - rm em100pro_chips.h + rm -f em100pro_chips.h + +-include .dependencies
.PHONY: clean distclean