-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (31 loc) · 1.23 KB
/
Makefile
File metadata and controls
33 lines (31 loc) · 1.23 KB
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
# Check if a default C++ compiler exists, otherwise use g++
CXX ?= g++
CXXFLAGS = -Wall -Wextra -Wpedantic
CREATE_BUILD_DIR = mkdir -p build; cp -n llama.jpg build;
BUILD_TESTS = $(CXX) $(CXXFLAGS) test/test.cpp -Iinclude -Itest -pthread -latomic
# Uncomment to test newer variants of C++
all: examples test-cpp11 test-cpp14 test-cpp17 test-cpp20 #test-cpp23 test-cpp26
build:
mkdir -p build
ifeq ($(OS),Windows_NT)
if not exist "build/llama.jpg" copy "llama.jpg" "build"
else
cp -n llama.jpg build
endif
examples: build examples/main.cpp
$(CXX) $(CXXFLAGS) examples/main.cpp -Iinclude -o build/examples -std=c++11 -pthread -latomic
test: test-cpp11
test-cpp11: build test/test.cpp
$(BUILD_TESTS) -o build/test -std=c++11 -pthread -latomic
test-cpp14: build test/test.cpp
$(BUILD_TESTS) -o build/test-cpp14 -std=c++14 -pthread -latomic
test-cpp17: build test/test.cpp
$(BUILD_TESTS) -o build/test-cpp17 -std=c++17 -pthread -latomic
test-cpp20: build test/test.cpp
$(BUILD_TESTS) -o build/test-cpp20 -std=c++2a -pthread -latomic
test-cpp23: build test/test.cpp
$(BUILD_TESTS) -o build/test-cpp23 -std=c++2b -pthread -latomic
test-cpp26: build test/test.cpp
$(BUILD_TESTS) -o build/test-cpp26 -std=c++2c -pthread -latomic
clean:
rm -rf build