forked from chipsalliance/UHDM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.17 KB
/
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
42
43
44
45
46
47
48
49
# UHDM top Makefile (Wrapper to cmake)
# Use bash as the default shell
SHELL := /bin/bash
ifeq ($(CPU_CORES),)
CPU_CORES := $(shell nproc)
ifeq ($(CPU_CORES),)
CPU_CORES := 1
endif
endif
PREFIX?=/usr/local
release: build
cmake --build build --config Release -j $(CPU_CORES)
debug:
mkdir -p dbuild
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$(PREFIX) -S . -B dbuild
cmake --build dbuild --config Debug -j $(CPU_CORES)
test: build
cmake --build build --target UnitTests --config Release -j $(CPU_CORES)
cd build && ctest -C Release --output-on-failure
test-junit: release
cd build && ctest --no-compress-output -T Test -C RelWithDebInfo --output-on-failure
xsltproc .github/kokoro/ctest2junit.xsl build/Testing/*/Test.xml > build/test_results.xml
clean:
rm -f src/*
rm -rf headers/*
rm -rf build
install: build
cmake --install build --config Release
uninstall:
rm -rf $(PREFIX)/lib/uhdm
rm -rf $(PREFIX)/include/uhdm
build:
mkdir -p build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(PREFIX) -S . -B build
test_install:
cmake --build build --target test_inst --config Release -j $(CPU_CORES)
find build/bin -name test_inst* -exec {} \;