-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (55 loc) · 1.59 KB
/
Makefile
File metadata and controls
75 lines (55 loc) · 1.59 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Makefile — super-convenient wrapper around CMake
# You still get all the power of CMake, but now you can type `make run` like a god
.PHONY: all setup build run test tests debug clean distclean
# Default target
all: build/main
# First-time setup (creates build dir + configures)
setup:
@cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
# Normal fast rebuild (assumes build/ already configured)
build:
@cmake --build build --config Release -j$(nproc)
# Debug build
debug:
@cmake --build build --config Debug -j$(nproc)
# Run the demo
run: build/main
@./build/main
# Build + run
go: build run
# Build and run all unit tests
test tests: build
@echo "=== Running all tests ==="
@./build/test_DataGenerator && \
./build/test_ResponseGenerator && \
./build/test_PLSR && \
./build/test_Fourier && \
./build/test_Bspline
# Individual tests (optional)
test-data: build
@./build/test_DataGenerator
test-response: build
@./build/test_ResponseGenerator
test-plsr: build
@./build/test_PLSR
test-fourier: build
@./build/test_Fourier
test-bspline: build
@./build/test_Bspline
# Clean build directory (your old friend)
clean:
@rm -rf build/*
# Nuclear option — also delete CMake cache
distclean: clean
@rm -rf build/
# Force reconfiguration (useful if you add new files)
reconfig:
@cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
# Show what actually got compiled last time (debugging hero)
last:
@cmake --build build --verbose --target help | tail -20
# The actual executables
build/main: setup
@cmake --build build --target main -j$(nproc)
build/%: setup
@cmake --build build --target $* -j$(nproc)