From daf392f1a704501c0bb3da7ecd8e07f02771b02e Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 21 Feb 2021 12:49:49 +0100 Subject: [PATCH] Added toplevel Makefile wrapper for cmake --- .gitignore | 1 - Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 998f1647..0c064166 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ CMakeCache.txt CMakeFiles CMakeScripts Testing -Makefile cmake_install.cmake install_manifest.txt compile_commands.json diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..83ef3ec1 --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +# Makefile +# +# Copyright (c) 2021 Bartek Kryza +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This Makefile is just a handy wrapper around cmake +# + +# Specify LLVM version +LLVM_VERSION ?= 11 + +.PHONY: clean +clean: + rm -rf debug release + +debug/CMakeLists.txt: + cmake -S . -B debug \ + -DCMAKE_BUILD_TYPE=Debug \ + -DLIBCLANG_LLVM_CONFIG_EXECUTABLE=/usr/bin/llvm-config-${LLVM_VERSION} + +release/CMakeLists.txt: + cmake -S . -B release \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIBCLANG_LLVM_CONFIG_EXECUTABLE=/usr/bin/llvm-config-${LLVM_VERSION} + +debug: debug/CMakeLists.txt + make -C debug -j + make -C debug test + +release: release/CMakeLists.txt + make -C release -j + +.PHONY: clang-format +clang-format: + docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.2