Skip to content

Commit fa9881c

Browse files
committed
Makefile fixes (again!!)
Bench: 2999049
1 parent b1039b1 commit fa9881c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Makefile

+11-8
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ BUILD_DIR=build
1818
CMAKE_BUILD_OPTION ?= Release
1919
BUILD_TYPE ?= BUILD_NATIVE
2020

21+
# Executable name (can be overridden from command line)
22+
EXE ?= integral
23+
2124
# Standard targets
2225
.PHONY: all clean debug x86_64 x86_64_popcnt x86_64_bmi2 native
2326

2427
all: $(BUILD_DIR)
25-
@echo Building integral with $(BUILD_TYPE)...
28+
@echo Building $(EXE) with $(BUILD_TYPE)...
2629
ifeq ($(detected_OS),Windows)
2730
@$(MAKE) -C $(BUILD_DIR) all > NUL 2>&1
2831
else
@@ -43,23 +46,23 @@ endif
4346
clean:
4447
ifeq ($(detected_OS),Windows)
4548
@if exist $(BUILD_DIR) rmdir /s /q $(BUILD_DIR)
46-
@del /f /q integral*$(EXE_EXT)
49+
@del /f /q $(EXE)*$(EXE_EXT)
4750
else
4851
@rm -rf $(BUILD_DIR)
49-
@rm -f integral*$(EXE_EXT)
52+
@rm -f $(EXE)*$(EXE_EXT)
5053
endif
5154

5255
copy_executable:
5356
ifeq ($(BUILD_TYPE),BUILD_DEBUG)
54-
$(eval EXE_NAME := integral_debug$(EXE_EXT))
57+
$(eval EXE_NAME := $(EXE)_debug$(EXE_EXT))
5558
else ifeq ($(BUILD_TYPE),BUILD_X86_64_POPCNT)
56-
$(eval EXE_NAME := integral_x86_64_popcnt$(EXE_EXT))
59+
$(eval EXE_NAME := $(EXE)_x86_64_popcnt$(EXE_EXT))
5760
else ifeq ($(BUILD_TYPE),BUILD_X86_64_MODERN)
58-
$(eval EXE_NAME := integral_x86_64_modern$(EXE_EXT))
61+
$(eval EXE_NAME := $(EXE)_x86_64_modern$(EXE_EXT))
5962
else ifeq ($(BUILD_TYPE),BUILD_X86_64_BMI2)
60-
$(eval EXE_NAME := integral_x86_64_bmi2$(EXE_EXT))
63+
$(eval EXE_NAME := $(EXE)_x86_64_bmi2$(EXE_EXT))
6164
else
62-
$(eval EXE_NAME := integral$(EXE_EXT))
65+
$(eval EXE_NAME := $(EXE)$(EXE_EXT))
6366
endif
6467

6568
ifeq ($(detected_OS),Windows)

0 commit comments

Comments
 (0)