From 527887bbf9452803d0b17a2af68f1efa41a9d397 Mon Sep 17 00:00:00 2001 From: Andi Drebes Date: Tue, 19 Oct 2021 21:48:55 +0200 Subject: [PATCH] fix(compiler): Makefile: Do not let target 'build' depend on directory The target `build` creates a build directory with the same name and initializes through an invocation of CMake. Regardless of the success or failure of the CMake invocation, all subsequent invocations of the target do not invoke CMake anymore, as the target's prerequisites are satisfied through the existence of the build directory created upon the first invocation. This patch changes the dependencies to the build directory with an intermediate target that depends on a stamp file that is only created when the first CMake invocation in the build directory succeeds. --- compiler/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/Makefile b/compiler/Makefile index 325753c13..5ba032d56 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -2,7 +2,7 @@ BUILD_DIR=./build Python3_EXECUTABLE= -build: +$(BUILD_DIR)/configured.stamp: cmake -B $(BUILD_DIR) -GNinja ../llvm-project/llvm/ \ -DLLVM_ENABLE_PROJECTS=mlir \ -DLLVM_BUILD_EXAMPLES=OFF \ @@ -15,14 +15,17 @@ build: -DLLVM_EXTERNAL_PROJECTS=zamalang \ -DLLVM_EXTERNAL_ZAMALANG_SOURCE_DIR=. \ -DPython3_EXECUTABLE=${Python3_EXECUTABLE} + touch $@ -build-end-to-end-jit: build +build-initialized: $(BUILD_DIR)/configured.stamp + +build-end-to-end-jit: build-initialized cmake --build $(BUILD_DIR) --target end_to_end_jit_test -zamacompiler: build +zamacompiler: build-initialized cmake --build $(BUILD_DIR) --target zamacompiler -python-bindings: build +python-bindings: build-initialized cmake --build $(BUILD_DIR) --target ZamalangMLIRPythonModules ZamalangPythonModules test-check: zamacompiler file-check not