-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
46 lines (35 loc) · 1.12 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
# ============================================================================
# ExtBit ProtoUI Reference Implementation
# Copyright (c) 2026 ExtBit LLC. All rights reserved.
# License: MIT
# ============================================================================
CXX ?= g++
AR ?= ar
CXXFLAGS ?= -std=c++20 -O2 -Wall -Wextra -fPIC
ARFLAGS ?= rcs
# Directories (allow external callers to override IMGUI_DIR)
IMGUI_DIR ?= ../external/imgui
INC_DIR := include
SRC_DIR := src
BUILD_DIR := build
LIB_DIR := lib
# Target
TARGET := $(LIB_DIR)/libProtoUI.a
# Sources & Objects
SRCS := $(wildcard $(SRC_DIR)/*.cpp)
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
# Include Paths
INCLUDES := -I$(INC_DIR) -I$(IMGUI_DIR)
.PHONY: all clean
all: $(TARGET)
# Compile C++ source files into build/
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
# Archive object files into libProtoUI.a
$(TARGET): $(OBJS) | $(LIB_DIR)
$(AR) $(ARFLAGS) $@ $^
# Ensure output directories exist
$(BUILD_DIR) $(LIB_DIR):
mkdir -p $@
clean:
rm -rf $(BUILD_DIR) $(LIB_DIR)