Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
coreinfo: Use libpayload's new `Makefile.payload`
Change-Id: I388d60e6f3aeb2184966152f0934845d42834de0 Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/coreinfo/.gitignore M payloads/coreinfo/Makefile 2 files changed, 34 insertions(+), 89 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/47634/1
diff --git a/payloads/coreinfo/.gitignore b/payloads/coreinfo/.gitignore index 101045e..868da49 100644 --- a/payloads/coreinfo/.gitignore +++ b/payloads/coreinfo/.gitignore @@ -1,2 +1,2 @@ -lpbuild/ -lp.config* +libpayload/ +.lp.config* diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index cd58f39..0e6bf28 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -1,23 +1,38 @@ ## SPDX-License-Identifier: GPL-2.0-only
src := $(CURDIR) +obj := build + srctree := $(src) srck := $(src)/../../util/kconfig -coreinfo_obj := $(src)/build objk := $(src)/build/util/kconfig
-ifeq ($(filter %clean,$(MAKECMDGOALS)),) -export KERNELVERSION := 0.1.0 -export KCONFIG_AUTOHEADER := $(coreinfo_obj)/config.h -export KCONFIG_AUTOCONFIG := $(coreinfo_obj)/auto.conf -export KCONFIG_DEPENDENCIES := $(coreinfo_obj)/auto.conf.cmd -export KCONFIG_SPLITCONFIG := $(coreinfo_obj)/config -export KCONFIG_TRISTATE := $(coreinfo_obj)/tristate.conf -export KCONFIG_CONFIG := $(CURDIR)/.config -export KCONFIG_NEGATIVES := 1 -export Kconfig := Kconfig +LIBPAYLOAD_DEFCONFIG ?= $(src)/../libpayload/configs/defconfig-tinycurses
-export V := $(V) +PAYLOAD_DEPS := $(obj)/config.h + +OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ + nvram_module.o bootlog_module.o ramdump_module.o \ + multiboot_module.o cbfs_module.o timestamps_module.o coreinfo.o +OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) +TARGET = $(obj)/coreinfo.elf + +ARCH := x86_32 + +all: real-all + +include ../libpayload/Makefile.payload + +ifeq ($(filter %clean,$(MAKECMDGOALS)),) +export KERNELVERSION := 0.1.0 +export KCONFIG_AUTOHEADER := $(obj)/config.h +export KCONFIG_AUTOCONFIG := $(obj)/auto.conf +export KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd +export KCONFIG_SPLITCONFIG := $(obj)/config +export KCONFIG_TRISTATE := $(obj)/tristate.conf +export KCONFIG_CONFIG := $(CURDIR)/.config +export KCONFIG_NEGATIVES := 1 +export Kconfig := Kconfig
CONFIG_SHELL := sh KBUILD_DEFCONFIG := configs/defconfig @@ -25,52 +40,12 @@ HAVE_DOTCONFIG := $(wildcard .config) MAKEFLAGS += -rR --no-print-directory
-# Make is silent per default, but 'make V=1' will show all compiler calls. -ifneq ($(V),1) -.SILENT: -endif - HOSTCC ?= gcc HOSTCXX ?= g++ HOSTCFLAGS := -I$(srck) -I$(objk) HOSTCXXFLAGS := -I$(srck) -I$(objk)
-LIBPAYLOAD_PATH := $(realpath ../libpayload) -LIBPAYLOAD_OBJ := $(coreinfo_obj)/libpayload -HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_OBJ)/lib/libpayload.a) -LIBPAYLOAD_CONFIG ?= configs/defconfig-tinycurses -OBJCOPY ?= objcopy - -INCLUDES = -I$(coreinfo_obj) -include $(LIBPAYLOAD_OBJ)/include/kconfig.h -I$(src)/../../src/commonlib/include -OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ - nvram_module.o bootlog_module.o ramdump_module.o \ - multiboot_module.o cbfs_module.o timestamps_module.o coreinfo.o -OBJS = $(patsubst %,$(coreinfo_obj)/%,$(OBJECTS)) -TARGET = $(coreinfo_obj)/coreinfo.elf - -all: real-all - -# in addition to the dependency below, create the file if it doesn't exist -# to silence warnings about a file that would be generated anyway. -$(if $(wildcard .xcompile),,$(eval $(shell ../../util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile))) -.xcompile: ../../util/xcompile/xcompile - $< $(XGCCPATH) > $@.tmp - \mv -f $@.tmp $@ 2> /dev/null || rm -f $@.tmp $@ - -CONFIG_COMPILER_GCC := y -ARCH-y := x86_32 - -include .xcompile - -CC := $(CC_$(ARCH-y)) -AS := $(AS_$(ARCH-y)) -OBJCOPY := $(OBJCOPY_$(ARCH-y)) - -LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc -LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas - -CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror -CFLAGS += -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES) +CFLAGS += -I$(obj) -I../../src/commonlib/include
ifneq ($(strip $(HAVE_DOTCONFIG)),) include $(src)/.config @@ -80,21 +55,6 @@ CFLAGS += -flto endif
-$(TARGET): $(src)/.config $(coreinfo_obj)/config.h $(OBJS) libpayload - printf " LPCC $(subst $(CURDIR)/,,$(@)) (LINK)\n" - $(LPCC) $(CFLAGS) -o $@ $(OBJS) - $(OBJCOPY) --only-keep-debug $@ $(TARGET).debug - $(OBJCOPY) --strip-debug $@ - $(OBJCOPY) --add-gnu-debuglink=$(TARGET).debug $@ - -$(coreinfo_obj)/%.S.o: $(src)/%.S libpayload - printf " LPAS $(subst $(CURDIR)/,,$(@))\n" - $(LPAS) -o $@ $< - -$(coreinfo_obj)/%.o: $(src)/%.c libpayload - printf " LPCC $(subst $(CURDIR)/,,$(@))\n" - $(LPCC) $(CFLAGS) -c -o $@ $< - else real-all: config endif @@ -103,22 +63,10 @@ $(MAKE) olddefconfig $(MAKE) all
-ifneq ($(strip $(HAVE_LIBPAYLOAD)),) -libpayload: - printf "Found Libpayload $(LIBPAYLOAD_OBJ).\n" -else -LPOPTS=obj="$(CURDIR)/lpbuild" DOTCONFIG="$(CURDIR)/lp.config" -libpayload: - printf "Building libpayload @ $(LIBPAYLOAD_PATH).\n" - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) distclean coreinfo_obj=$(coreinfo_obj)/libptmp - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) defconfig KBUILD_DEFCONFIG=$(LIBPAYLOAD_CONFIG) - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) install DESTDIR=$(coreinfo_obj) -endif - -$(coreinfo_obj)/config.h: +$(obj)/config.h: $(MAKE) oldconfig
-$(shell mkdir -p $(coreinfo_obj) $(objk)/lxdialog $(KCONFIG_SPLITCONFIG)) +$(shell mkdir -p $(objk)/lxdialog $(KCONFIG_SPLITCONFIG))
include $(srck)/Makefile
@@ -126,11 +74,8 @@
else
-clean: - rm -rf build lpbuild .xcompile - distclean: clean - rm -f .config* lp.config* + rm -f .config*
-.PHONY: clean distclean +.PHONY: distclean endif
Attention is currently required from: Nico Huber. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 2: Code-Review+1
Attention is currently required from: Nico Huber. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 3: Code-Review+2
Attention is currently required from: Nico Huber. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
File payloads/coreinfo/Makefile:
https://review.coreboot.org/c/coreboot/+/47634/comment/52960cc6_cdf7409e PS3, Line 24: all isn't this phony?
Attention is currently required from: Angel Pons. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 3:
(1 comment)
File payloads/coreinfo/Makefile:
https://review.coreboot.org/c/coreboot/+/47634/comment/b6861067_1d3fcad1 PS3, Line 24: all
isn't this phony?
Hmm, I only moved this... can fix it here or in advance if you want?
Attention is currently required from: Nico Huber. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 3:
(1 comment)
File payloads/coreinfo/Makefile:
https://review.coreboot.org/c/coreboot/+/47634/comment/64d5e942_07020a54 PS3, Line 24: all
Hmm, I only moved this... […]
I see. I don't mind fixing it here
Attention is currently required from: Nico Huber. Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47634
to look at the new patch set (#4).
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
coreinfo: Use libpayload's new `Makefile.payload`
Change-Id: I388d60e6f3aeb2184966152f0934845d42834de0 Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/coreinfo/.gitignore M payloads/coreinfo/Makefile 2 files changed, 35 insertions(+), 90 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/47634/4
Attention is currently required from: Angel Pons. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 3:
(1 comment)
File payloads/coreinfo/Makefile:
https://review.coreboot.org/c/coreboot/+/47634/comment/590b5ef5_06e7026a PS3, Line 24: all
I see. […]
Done
Attention is currently required from: Nico Huber. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
Patch Set 4: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47634 )
Change subject: coreinfo: Use libpayload's new `Makefile.payload` ......................................................................
coreinfo: Use libpayload's new `Makefile.payload`
Change-Id: I388d60e6f3aeb2184966152f0934845d42834de0 Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/47634 Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M payloads/coreinfo/.gitignore M payloads/coreinfo/Makefile 2 files changed, 35 insertions(+), 90 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/payloads/coreinfo/.gitignore b/payloads/coreinfo/.gitignore index 101045e..868da49 100644 --- a/payloads/coreinfo/.gitignore +++ b/payloads/coreinfo/.gitignore @@ -1,2 +1,2 @@ -lpbuild/ -lp.config* +libpayload/ +.lp.config* diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index 8d2f3c6..57dca13 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -3,23 +3,38 @@ unexport $(COREBOOT_EXPORTS)
src := $(CURDIR) +obj := build + srctree := $(src) srck := $(src)/../../util/kconfig -coreinfo_obj := $(src)/build objk := $(src)/build/util/kconfig
-ifeq ($(filter %clean,$(MAKECMDGOALS)),) -export KERNELVERSION := 0.1.0 -export KCONFIG_AUTOHEADER := $(coreinfo_obj)/config.h -export KCONFIG_AUTOCONFIG := $(coreinfo_obj)/auto.conf -export KCONFIG_DEPENDENCIES := $(coreinfo_obj)/auto.conf.cmd -export KCONFIG_SPLITCONFIG := $(coreinfo_obj)/config -export KCONFIG_TRISTATE := $(coreinfo_obj)/tristate.conf -export KCONFIG_CONFIG := $(CURDIR)/.config -export KCONFIG_NEGATIVES := 1 -export Kconfig := Kconfig +LIBPAYLOAD_DEFCONFIG ?= $(src)/../libpayload/configs/defconfig-tinycurses
-export V := $(V) +PAYLOAD_DEPS := $(obj)/config.h + +OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ + nvram_module.o bootlog_module.o ramdump_module.o \ + multiboot_module.o cbfs_module.o timestamps_module.o coreinfo.o +OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) +TARGET = $(obj)/coreinfo.elf + +ARCH := x86_32 + +all: real-all + +include ../libpayload/Makefile.payload + +ifeq ($(filter %clean,$(MAKECMDGOALS)),) +export KERNELVERSION := 0.1.0 +export KCONFIG_AUTOHEADER := $(obj)/config.h +export KCONFIG_AUTOCONFIG := $(obj)/auto.conf +export KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd +export KCONFIG_SPLITCONFIG := $(obj)/config +export KCONFIG_TRISTATE := $(obj)/tristate.conf +export KCONFIG_CONFIG := $(CURDIR)/.config +export KCONFIG_NEGATIVES := 1 +export Kconfig := Kconfig
CONFIG_SHELL := sh KBUILD_DEFCONFIG := configs/defconfig @@ -27,52 +42,12 @@ HAVE_DOTCONFIG := $(wildcard .config) MAKEFLAGS += -rR --no-print-directory
-# Make is silent per default, but 'make V=1' will show all compiler calls. -ifneq ($(V),1) -.SILENT: -endif - HOSTCC ?= gcc HOSTCXX ?= g++ HOSTCFLAGS := -I$(srck) -I$(objk) HOSTCXXFLAGS := -I$(srck) -I$(objk)
-LIBPAYLOAD_PATH := $(realpath ../libpayload) -LIBPAYLOAD_OBJ := $(coreinfo_obj)/libpayload -HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_OBJ)/lib/libpayload.a) -LIBPAYLOAD_CONFIG ?= configs/defconfig-tinycurses -OBJCOPY ?= objcopy - -INCLUDES = -I$(coreinfo_obj) -include $(LIBPAYLOAD_OBJ)/include/kconfig.h -I$(src)/../../src/commonlib/include -OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \ - nvram_module.o bootlog_module.o ramdump_module.o \ - multiboot_module.o cbfs_module.o timestamps_module.o coreinfo.o -OBJS = $(patsubst %,$(coreinfo_obj)/%,$(OBJECTS)) -TARGET = $(coreinfo_obj)/coreinfo.elf - -all: real-all - -# in addition to the dependency below, create the file if it doesn't exist -# to silence warnings about a file that would be generated anyway. -$(if $(wildcard .xcompile),,$(eval $(shell ../../util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile))) -.xcompile: ../../util/xcompile/xcompile - $< $(XGCCPATH) > $@.tmp - \mv -f $@.tmp $@ 2> /dev/null || rm -f $@.tmp $@ - -CONFIG_COMPILER_GCC := y -ARCH-y := x86_32 - -include .xcompile - -CC := $(CC_$(ARCH-y)) -AS := $(AS_$(ARCH-y)) -OBJCOPY := $(OBJCOPY_$(ARCH-y)) - -LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc -LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas - -CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror -CFLAGS += -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES) +CFLAGS += -I$(obj) -I../../src/commonlib/include
ifneq ($(strip $(HAVE_DOTCONFIG)),) include $(src)/.config @@ -82,21 +57,6 @@ CFLAGS += -flto endif
-$(TARGET): $(src)/.config $(coreinfo_obj)/config.h $(OBJS) libpayload - printf " LPCC $(subst $(CURDIR)/,,$(@)) (LINK)\n" - $(LPCC) $(CFLAGS) -o $@ $(OBJS) - $(OBJCOPY) --only-keep-debug $@ $(TARGET).debug - $(OBJCOPY) --strip-debug $@ - $(OBJCOPY) --add-gnu-debuglink=$(TARGET).debug $@ - -$(coreinfo_obj)/%.S.o: $(src)/%.S libpayload - printf " LPAS $(subst $(CURDIR)/,,$(@))\n" - $(LPAS) -o $@ $< - -$(coreinfo_obj)/%.o: $(src)/%.c libpayload - printf " LPCC $(subst $(CURDIR)/,,$(@))\n" - $(LPCC) $(CFLAGS) -c -o $@ $< - else real-all: config endif @@ -105,34 +65,19 @@ $(MAKE) olddefconfig $(MAKE) all
-ifneq ($(strip $(HAVE_LIBPAYLOAD)),) -libpayload: - printf "Found Libpayload $(LIBPAYLOAD_OBJ).\n" -else -LPOPTS=obj="$(CURDIR)/lpbuild" DOTCONFIG="$(CURDIR)/lp.config" -libpayload: - printf "Building libpayload @ $(LIBPAYLOAD_PATH).\n" - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) distclean coreinfo_obj=$(coreinfo_obj)/libptmp - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) defconfig KBUILD_DEFCONFIG=$(LIBPAYLOAD_CONFIG) - $(MAKE) -C $(LIBPAYLOAD_PATH) $(LPOPTS) install DESTDIR=$(coreinfo_obj) -endif - -$(coreinfo_obj)/config.h: +$(obj)/config.h: $(MAKE) oldconfig
-$(shell mkdir -p $(coreinfo_obj) $(objk)/lxdialog $(KCONFIG_SPLITCONFIG)) +$(shell mkdir -p $(objk)/lxdialog $(KCONFIG_SPLITCONFIG))
include $(srck)/Makefile
-.PHONY: $(PHONY) prepare +.PHONY: $(PHONY) prepare all real-all defaultbuild
else
-clean: - rm -rf build lpbuild .xcompile - distclean: clean - rm -f .config* lp.config* + rm -f .config*
-.PHONY: clean distclean +.PHONY: distclean endif