-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (41 loc) · 1.16 KB
/
Makefile
File metadata and controls
53 lines (41 loc) · 1.16 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
# --- Provision1: Lithic Lattice Build System ---
# Target: Embedded Linux / Multi-core Drone Architecture
# Requirements: G++ with OpenMP support
CXX := g++
CXXFLAGS := -O3 -std=c++17 -fopenmp -Wall -Wextra -fPIC
INCLUDES := -Iinclude
SRC_DIR := src
TEST_DIR := tests
OBJ_DIR := obj
BIN_DIR := bin
# Sources
KERNEL_SRC := $(SRC_DIR)/kernel.cpp
BENCH_SRC := $(TEST_DIR)/bench_swarm.cpp
# Objects
KERNEL_OBJ := $(OBJ_DIR)/kernel.o
BENCH_OBJ := $(OBJ_DIR)/bench_swarm.o
# Target Binary
TARGET := $(BIN_DIR)/bench_swarm
.PHONY: all clean directories
all: directories $(TARGET)
# Create necessary directory structure
directories:
@mkdir -p $(OBJ_DIR)
@mkdir -p $(BIN_DIR)
# Compile Kernel Object
$(KERNEL_OBJ): $(KERNEL_SRC)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
# Compile Benchmark Object
$(BENCH_OBJ): $(BENCH_SRC)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
# Link Benchmark Binary
$(TARGET): $(KERNEL_OBJ) $(BENCH_OBJ)
$(CXX) $(CXXFLAGS) $^ -o $@
# Cleanup Workspace
clean:
rm -rf $(OBJ_DIR) $(BIN_DIR)
@echo "[CLEAN] Workspace sanitized."
# Hardware-specific Optimization (Optional)
# Usage: make native
native: CXXFLAGS += -march=native
native: all