add misc. forgotten Makefile stuff
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 27 Jul 2022 01:58:14 +0000 (18:58 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 27 Jul 2022 01:58:14 +0000 (18:58 -0700)
Makefile

index 64bacb58f4e009699b6e36e0082b15f99c09ea5e..e3bb793603c770664642c566ecb4eb2993365f38 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,21 +20,24 @@ common_cmake_flags += -DCMAKE_BUILD_TYPE=RelWithDebInfo
 
 reset_make_env = "MAKEFLAGS=" "MFLAGS=" "MAKELEVEL=" "MAKE_TERMERR=" "MAKE_TERMOUT="
 
-.installed-dependencies: install-deps.sh
+.installed-dependencies: install-deps.sh Makefile
        ./install-deps.sh $(enabled_arches)
        touch .installed-dependencies
 
 build-ppc64le/Makefile: toolchain-powerpc64le-linux-gnu.cmake CMakeLists.txt .installed-dependencies
        rm -fr build-ppc64le
        env $(reset_make_env) cmake $(common_cmake_flags) -B build-ppc64le -DCMAKE_TOOLCHAIN_FILE=toolchain-powerpc64le-linux-gnu.cmake
+       [ "$(host_arch)" != "ppc64le" ] || cp build-ppc64le/compile_commands.json .
 
 build-aarch64/Makefile: toolchain-aarch64-linux-gnu.cmake CMakeLists.txt .installed-dependencies
        rm -fr build-aarch64
        env $(reset_make_env) cmake $(common_cmake_flags) -B build-aarch64 -DCMAKE_TOOLCHAIN_FILE=toolchain-aarch64-linux-gnu.cmake
+       [ "$(host_arch)" != "aarch64" ] || cp build-aarch64/compile_commands.json .
 
 build-x86_64/Makefile: toolchain-x86_64-linux-gnu.cmake CMakeLists.txt .installed-dependencies
        rm -fr build-x86_64
        env $(reset_make_env) cmake $(common_cmake_flags) -B build-x86_64 -DCMAKE_TOOLCHAIN_FILE=toolchain-x86_64-linux-gnu.cmake
+       [ "$(host_arch)" != "x86_64" ] || cp build-x86_64/compile_commands.json .
 
 configure: $(foreach arch,$(enabled_arches),build-$(arch)/Makefile)
 
@@ -50,5 +53,5 @@ build-x86_64/benchmarks: build-x86_64/Makefile __force-run
        $(MAKE) -C build-x86_64 benchmarks
 
 clean:
-       rm -fr build-ppc64le build-aarch64 build-x86_64 .installed-dependencies
+       rm -fr build-ppc64le build-aarch64 build-x86_64 .installed-dependencies compile_commands.json