Skip to content

Commit 82cf2da

Browse files
committed
Fix bootstrap
1 parent f8d9da9 commit 82cf2da

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

build-aux/bootstrap.mk

+8-5
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ PROJECT := $(shell sed -n '/^project/{s/^project. *\([a-zA-Z0-9]\+\).*/\1/p; q}
1111
VERSION := $(shell sed -n '/^project/{s/^.\+VERSION \+//; s/[^\.0-9]\+//; p; q}'\
1212
CMakeLists.txt)
1313

14-
HOSTNAME := $(shell A=$${HOSTNAME%%.*} && echo ${A,,})
14+
HOSTNAME := $(shell A=$$(hostname) && A=$${A%%.*} && echo $${A,,})
1515

1616
# Options file is either: .cmake-args.$(HOSTNAME) or .cmake-args
1717
OPT_FILE_BASE := .cmake-args
18-
OPT_FILE := $(OPT_FILE_BASE).$(shell hostname)
18+
OPT_FILE := $(OPT_FILE_BASE).$(HOSTNAME)
1919
ifeq ($(wildcard $(OPT_FILE)),)
2020
OPT_FILE := .cmake-args
2121
ifeq ($(wildcard $(OPT_FILE)),)
2222
OPT_FILE := /dev/null
2323
NOT_FOUND := 1
2424
endif
2525
endif
26-
ifeq (,/dev/null)
26+
ifeq ($(NOT_FOUND),1)
2727
$(warning Configuration file $(OPT_FILE_BASE) not found!)
2828
endif
2929

@@ -33,7 +33,7 @@ endif
3333
all:
3434
@echo
3535
@echo "Run: make bootstrap [toolchain=gcc|clang|intel] [verbose=true] \\"
36-
@echo " [generator=ninja|make] [build=Debug|Release]"
36+
@echo " [generator=ninja|make] [build=Debug|Release|RelWithDebInfo]"
3737
@echo
3838
@echo "To customize cmake variables, create a file with VAR=VALUE pairs:"
3939
@echo " '.cmake-args.$(HOSTNAME)' or '.cmake-args'"
@@ -90,6 +90,8 @@ info:
9090
@echo "BLD_DIR: $(BLD_DIR)"
9191
@echo "DIR: $(DIR)"
9292
@echo "build: $(BUILD)"
93+
@echo "toolchain: $(toolchain)"
94+
@echo "PREFIX: $(PREFIX)"
9395
@echo "prefix: $(prefix)"
9496
@echo "generator: $(generator)"
9597
@echo "toolchain: $(toolchain)"
@@ -125,6 +127,7 @@ bootstrap: | $(DIR)
125127
@echo -e "Build directory..: \e[0;36m$(DIR)\e[0m"
126128
@echo -e "Install directory: \e[0;36m$(prefix)\e[0m"
127129
@echo -e "Build type.......: \e[1;32m$(BUILD)\e[0m"
130+
@echo -e "Toolchain........: \e[1;32m$(toolchain)\e[0m"
128131
@echo -e "Command-line vars: $(variables)"
129132
@echo -e "\n-- \e[1;37mUsing $(generator) generator\e[0m\n"
130133
@mkdir -p .build
@@ -135,7 +138,7 @@ bootstrap: | $(DIR)
135138
@[ ! -d build ] && ln -s $(DIR) build || true
136139
@ln -s $(prefix) inst
137140
@echo "make bootstrap $(MAKEOVERRIDES)" > $(DIR)/.bootstrap
138-
@cp $(DIR)/.bootstrap .build/
141+
@cp $(DIR)/.bootstrap .build/.bootstrap
139142
@echo "export PROJECT := $(PROJECT)" > $(DIR)/cache.mk
140143
@echo "export VERSION := $(VERSION)" >> $(DIR)/cache.mk
141144
@echo "export OPT_FILE := $(abspath $(OPT_FILE))" >> $(DIR)/cache.mk

0 commit comments

Comments
 (0)