-
Notifications
You must be signed in to change notification settings - Fork 22
/
cmake-makefile
41 lines (32 loc) · 1.31 KB
/
cmake-makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# License: Apache-2.0
# Usage: make -f cmake-makefile
# This Makefile is a helper file to run the cmake CMakelists.txt present in this project
# This is an alternative build system for Synlig when used in a cmake-based project.
# Use bash as the default shell
SHELL := /usr/bin/env bash
ifeq ($(CPU_CORES),)
CPU_CORES := $(shell nproc)
ifeq ($(CPU_CORES),)
CPU_CORES := $(shell sysctl -n hw.physicalcpu)
endif
ifeq ($(CPU_CORES),)
CPU_CORES := 2 # Good minimum assumption
endif
endif
PREFIX ?= /usr/local
ADDITIONAL_CMAKE_OPTIONS ?=
# If 'on', then the progress messages are printed. If 'off', makes it easier
# to detect actual warnings and errors in the build output.
RULE_MESSAGES ?= on
release: run-cmake-release
cmake --build build -j $(CPU_CORES)
run-cmake-release:
cmake -DCMAKE_BUILD_TYPE=Release -DCPU_CORES=$(CPU_CORES) -DYOSYS_CONFIG=$(YOSYS_CONFIG) \
-DYOSYS_PATH=$(YOSYS_PATH) -DCMAKE_INSTALL_PREFIX=$(PREFIX) \
-DCMAKE_RULE_MESSAGES=$(RULE_MESSAGES) -S . -B build
debug: run-cmake-debug
cmake --build build -j $(CPU_CORES)
run-cmake-debug:
cmake -DCMAKE_BUILD_TYPE=Debug -DCPU_CORES=$(CPU_CORES) -DYOSYS_CONFIG=$(YOSYS_CONFIG) \
-DYOSYS_PATH=$(YOSYS_PATH) -DCMAKE_INSTALL_PREFIX=$(PREFIX) \
-DCMAKE_RULE_MESSAGES=$(RULE_MESSAGES) -S . -B build