Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to review the following change.
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 33 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/1
diff --git a/Makefile.inc b/Makefile.inc index a51b73d..727d0d3 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -81,7 +81,7 @@ subdirs-y += src/superio subdirs-y += $(wildcard src/drivers/*) $(wildcard src/drivers/*/*) subdirs-y += src/cpu src/vendorcode -subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen +subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen util/amdfwtool subdirs-y += util/futility util/marvell util/bincfg util/supermicro subdirs-y += $(wildcard src/arch/*) subdirs-y += src/mainboard/$(MAINBOARDDIR) @@ -573,9 +573,6 @@ cp -a $(top)/util/ifdtool/ifdtool $@
AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool -$(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c - @printf " HOSTCC $(subst $(obj)/,,$(@))\n" - $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
@@ -1101,7 +1098,6 @@ endif
$(obj)/coreboot.rom: $(obj)/coreboot.pre $(RAMSTAGE) $(CBFSTOOL) $$(INTERMEDIATE) - @printf " CBFS $(subst $(obj)/,,$(@))\n" # The full ROM may be larger than the CBFS part, so create an empty # file (filled with \377 = 0xff) and copy the CBFS image over it. diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9fd91b..afc2bfa 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -7,10 +7,19 @@ #***************************************************************************** HOSTCC ?= cc
-amdfwtool_exe : amdfwtool.c - $(HOSTCC) amdfwtool.c -o amdfwtool +SRC = amdfwtool.c data_parse.c +OBJ = $(SRC:%.c=%.o) +TARGET = amdfwtool +CFLAGS=-O2 -Wall -Wextra -Wshadow -Wno-sign-compare
-amdfwtool : amdfwtool_exe + +$(TARGET): $(OBJ) + $(CC) $(OBJ) $(LDFLAGS) -o $@ + +%.o: %.c $(HEADER) + $(CC) $(CFLAGS) -c -o $@ $< + +amdfwtool_exe : $(TARGET)
clean: - @rm -f amdfwtool.o amdfwtool amdfwtool.exe + @rm -f $(TARGET) $(OBJ) diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc new file mode 100644 index 0000000..4736999 --- /dev/null +++ b/util/amdfwtool/Makefile.inc @@ -0,0 +1,19 @@ +#***************************************************************************** +# +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +#***************************************************************************** + +amdfwtoolobj = amdfwtool.o # data_parse.o + +AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow -Wno-sign-compare + +$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) + printf " AMDFWTOOL\n" + $(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< + +$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) + printf " AMDFWTOOL\n" + $(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) -o $@
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#2).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 917 insertions(+), 410 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/2
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#4).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 33 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/4
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#5).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 33 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/5
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc@a581 PS7, Line 581: -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) while it's a good thing to remove this, this still might change behavior. did you check if all platforms pass the rom size to amdfwtool? it's probably a good idea to remove the CONFIG_ROM_SIZE thing from amdfwtool and error out if no rom size is passed as parameter to initialize .rom_size in the main function
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#9).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 33 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/9
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc@a581 PS7, Line 581: -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE)
while it's a good thing to remove this, this still might change behavior. […]
Ack. Added -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) to new Makefile.inc
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 9:
(5 comments)
compiling the standalone version fails with this:
felix@felix-VirtualBox:~/coreboot/util/amdfwtool$ make cc -O2 -Wall -Wextra -Wshadow -Wno-sign-compare -c -o amdfwtool.o amdfwtool.c amdfwtool.c: In function ‘main’: amdfwtool.c:1756:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(targetfd, amd_romsig, ctx.current - romsig_offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc amdfwtool.o -o amdfwtool
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/7/Makefile.inc@a581 PS7, Line 581: -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE)
Ack. Added -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) to new Makefile. […]
Ok
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile File util/amdfwtool/Makefile:
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile@10 PS7, Line 10: #data_parse.c remove; that one gets added in the next patch, so no need to have a commented out version here
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 1: #***************************************************************************** : # : # All rights reserved. : # remove
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 6: # : #***************************************************************************** remove
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 9: #data_parse.o remove; that one gets added in the next patch, so no need to have a commented out version here
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 9:
(1 comment)
Patch Set 9:
(5 comments)
compiling the standalone version fails with this:
felix@felix-VirtualBox:~/coreboot/util/amdfwtool$ make cc -O2 -Wall -Wextra -Wshadow -Wno-sign-compare -c -o amdfwtool.o amdfwtool.c amdfwtool.c: In function ‘main’: amdfwtool.c:1756:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(targetfd, amd_romsig, ctx.current - romsig_offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc amdfwtool.o -o amdfwtool
Done. Fixed in set 10
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile File util/amdfwtool/Makefile:
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile@10 PS7, Line 10: #data_parse.c
remove; that one gets added in the next patch, so no need to have a commented out version here
Done. Removed.
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#10).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c 4 files changed, 31 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/10
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 10:
(3 comments)
Patch Set 9:
(5 comments)
compiling the standalone version fails with this:
felix@felix-VirtualBox:~/coreboot/util/amdfwtool$ make cc -O2 -Wall -Wextra -Wshadow -Wno-sign-compare -c -o amdfwtool.o amdfwtool.c amdfwtool.c: In function ‘main’: amdfwtool.c:1756:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(targetfd, amd_romsig, ctx.current - romsig_offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc amdfwtool.o -o amdfwtool
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 1: #***************************************************************************** : # : # All rights reserved. : #
remove
Done
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 6: # : #*****************************************************************************
remove
Done
https://review.coreboot.org/c/coreboot/+/45286/7/util/amdfwtool/Makefile.inc... PS7, Line 9: #data_parse.o
remove; that one gets added in the next patch, so no need to have a commented out version here
Done
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 10: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/10/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
PS10: would be good to move this into a separate patch with the makefile change on top of that one, since this is a different logical change than the makefile change
Jason Glenesk has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 10: Code-Review+1
Hello Jason Glenesk, build bot (Jenkins), Patrick Georgi, Martin Roth, Zheng Bao, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#11).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 27 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/11
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/10/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
PS10:
would be good to move this into a separate patch with the makefile change on top of that one, since […]
Done. A new patch has been uploaded.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 11: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile.in... File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile.in... PS11, Line 8: printf " AMDFWTOOL\n" this gets added here and removed in a follow-up patch, so you could remove that here to have all changes to this in one patch
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 11:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile File util/amdfwtool/Makefile:
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile@17 PS11, Line 17: amdfwtool_exe change to 'all:' or remove?
https://review.coreboot.org/c/coreboot/+/45286/1/util/amdfwtool/Makefile.inc File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/1/util/amdfwtool/Makefile.inc... PS1, Line 11: -Wno-sign-compare Why? I think we'd want to know this.
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile File util/amdfwtool/Makefile:
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile@17 PS11, Line 17: amdfwtool_exe : $(TARGET) Is this doing anything or can it be removed?
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Zheng Bao, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#13).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 25 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/13
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Zheng Bao, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45286
to look at the new patch set (#14).
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 24 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/45286/14
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 14:
(4 comments)
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile File util/amdfwtool/Makefile:
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile@17 PS11, Line 17: amdfwtool_exe
change to 'all:' or remove?
Done
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile@17 PS11, Line 17: amdfwtool_exe : $(TARGET)
Is this doing anything or can it be removed?
Done
https://review.coreboot.org/c/coreboot/+/45286/1/util/amdfwtool/Makefile.inc File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/1/util/amdfwtool/Makefile.inc... PS1, Line 11: -Wno-sign-compare
Why? I think we'd want to know this.
Done. Fix the compiling warning in another patch
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile.in... File util/amdfwtool/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/45286/11/util/amdfwtool/Makefile.in... PS11, Line 8: printf " AMDFWTOOL\n"
this gets added here and removed in a follow-up patch, so you could remove that here to have all cha […]
Done
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 14: Code-Review+2
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
Patch Set 14: Code-Review+2
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45286 )
Change subject: amdfwtool: Clean up the Makefile of amdfwtool ......................................................................
amdfwtool: Clean up the Makefile of amdfwtool
Add Makefile.inc to compliant with other tools. Makefile is kept for building amdfwtool by typing make in the folder.
Change-Id: I3688d93de4459f5f838955892086b4b9bf30a9b8 Signed-off-by: Zheng Bao fishbaozi@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/45286 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin Roth martinroth@google.com Reviewed-by: Felix Held felix-coreboot@felixheld.de --- M Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc 3 files changed, 24 insertions(+), 14 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved Felix Held: Looks good to me, approved
diff --git a/Makefile.inc b/Makefile.inc index a43de5e..bf33f8b 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -81,7 +81,7 @@ subdirs-y += src/superio subdirs-y += $(wildcard src/drivers/*) $(wildcard src/drivers/*/*) subdirs-y += src/cpu src/vendorcode -subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen +subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen util/amdfwtool subdirs-y += util/futility util/marvell util/bincfg util/supermicro subdirs-y += $(wildcard src/arch/*) subdirs-y += src/mainboard/$(MAINBOARDDIR) @@ -576,9 +576,6 @@ cp -a $(top)/util/ifdtool/ifdtool $@
AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool -$(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c - @printf " HOSTCC $(subst $(obj)/,,$(@))\n" - $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
@@ -1108,7 +1105,6 @@ endif
$(obj)/coreboot.rom: $(obj)/coreboot.pre $(RAMSTAGE) $(CBFSTOOL) $$(INTERMEDIATE) - @printf " CBFS $(subst $(obj)/,,$(@))\n" # The full ROM may be larger than the CBFS part, so create an empty # file (filled with \377 = 0xff) and copy the CBFS image over it. diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9fd91b..8f4208c 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -1,16 +1,18 @@ -#***************************************************************************** -# -# All rights reserved. -# # SPDX-License-Identifier: BSD-3-Clause
-#***************************************************************************** HOSTCC ?= cc
-amdfwtool_exe : amdfwtool.c - $(HOSTCC) amdfwtool.c -o amdfwtool +SRC = amdfwtool.c +OBJ = $(SRC:%.c=%.o) +TARGET = amdfwtool +CFLAGS=-O2 -Wall -Wextra -Wshadow
-amdfwtool : amdfwtool_exe + +$(TARGET): $(OBJ) + $(CC) $(OBJ) $(LDFLAGS) -o $@ + +%.o: %.c $(HEADER) + $(CC) $(CFLAGS) -c -o $@ $<
clean: - @rm -f amdfwtool.o amdfwtool amdfwtool.exe + @rm -f $(TARGET) $(OBJ) diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc new file mode 100644 index 0000000..2180fac --- /dev/null +++ b/util/amdfwtool/Makefile.inc @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause + +amdfwtoolobj = amdfwtool.o + +AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow + +$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) + $(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -c -o $@ $< + +$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) + printf " AMDFWTOOL\n" + $(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) -o $@