-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1 KB
/
Copy pathMakefile
File metadata and controls
48 lines (37 loc) · 1 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
CXX = g++
CXXFLAGS = -std=c++17 -O2 -Wall -Wextra -Wno-deprecated-declarations
INCLUDES = -I/usr/include -I/usr/local/include -Isrc
LIBS = -lssl -lcrypto -lpqxx -lpq -lpthread
TARGET = econtract_api
BUILD_DIR = build
# Source files
SRCS = src/main.cpp \
src/crypto/crypto_manager.cpp \
src/blockchain/block.cpp \
src/database/database_manager.cpp \
src/services/contract_service.cpp \
src/api/contract_api.cpp
# Object files
OBJS = $(SRCS:src/%.cpp=$(BUILD_DIR)/%.o)
# Default target
all: $(TARGET)
# Link
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LIBS)
# Compile source files
$(BUILD_DIR)/%.o: src/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR) $(TARGET)
# Run the server
run: $(TARGET)
./$(TARGET)
# Rebuild
rebuild: clean all
# Show project structure
structure:
@echo "Project Structure:"
@find src -type f -name "*.cpp" -o -name "*.hpp" | sort
.PHONY: all clean run rebuild structure