-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 812 Bytes
/
Makefile
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
# Makefile for IsakaJames Server Project
# Compiler and flags
CXX = clang++
CXXFLAGS = -std=c++17 -Wall -Wextra -O2
# Target executable
TARGET = server
# Source and object files
SRC = src/main.cpp
OBJ = $(SRC:.cpp=.o)
# Library source and object files
LIB_SRC = lib/strings_int_play.cpp
LIB_OBJ = lib/strings_int_play.o
# Library file
LIB = libstrings_play.a
# Default target
all: $(TARGET)
# Compile library
$(LIB): $(LIB_OBJ)
ar rcs $(LIB) $(LIB_OBJ)
# Link object files and libraries to create the executable
$(TARGET): $(OBJ) $(LIB)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJ) -L. -lstrings_play
# Compile source files into object files
%.o: %.cpp
$(CXX) $(CXXFLAGS) -Iinclude -c $< -o $@
# Clean up build artifacts
clean:
rm -f $(TARGET) $(OBJ) $(LIB) $(LIB_OBJ)
# Phony targets
.PHONY: all clean