[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v3 2/8] build: Test parameter O= to be an absolute path
Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx> On Fri, Mar 27, 2020 at 4:38 PM Simon Kuenzer <simon.kuenzer@xxxxxxxxx> wrote: > > Stops building with an error message when O= (build output directory) > is not an absolute path. The build system does not support relative paths. > > Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> > --- > Makefile | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/Makefile b/Makefile > index 2ae8a948..13fed332 100644 > --- a/Makefile > +++ b/Makefile > @@ -119,16 +119,20 @@ override CONFIG_UK_APP := $(A) > override APP_DIR := $(A) > override APP_BASE := $(A) > > -# BUILD_DIR > +# parameter O: BUILD_DIR ### > # Use O variable if set on the command line, otherwise use $(A)/build; > ifneq ("$(origin O)", "command line") > -BUILD_DIR := $(shell mkdir -p $(CONFIG_UK_APP)/build && cd > $(CONFIG_UK_APP)/build >/dev/null && pwd) > -$(if $(BUILD_DIR),, $(error could not create directory "$(A)/build")) > +_O := $(APP_BASE)/build > else > -BUILD_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd) > -$(if $(BUILD_DIR),, $(error could not create directory "$(O)")) > +ifeq ("$(filter /%,$(O))", "") > +$(error Path to output directory (O) is not absolute) > endif > -override BUILD_DIR := $(realpath $(patsubst %/,%,$(patsubst > %.,%,$(BUILD_DIR)))) > +_O := $(realpath $(dir $(O)))/$(notdir $(O)) > +endif > +BUILD_DIR := $(shell mkdir -p $(_O) && cd $(_O) >/dev/null && pwd) > +$(if $(BUILD_DIR),, $(error could not create directory "$(_O)")) > +BUILD_DIR := $(realpath $(patsubst %/,%,$(patsubst %.,%,$(BUILD_DIR)))) > +override O := $(BUILD_DIR) > > # EPLAT_DIR (list of external platform libraries) > # Retrieved from P variable from the command line (paths separated by colon) > -- > 2.20.1 > > > _______________________________________________ > Minios-devel mailing list > Minios-devel@xxxxxxxxxxxxxxxxxxxx > https://lists.xenproject.org/mailman/listinfo/minios-devel _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |