-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 815 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 815 Bytes
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
# List the names of your C++ source files here (without the .cpp extension)
SRCS := server master_thread workers_threads global
# Specify the g++ compiler
CXX := g++
# Compile flags (none in this case)
CXXFLAGS := -pthread
# List the names of your header files (with .hpp extension)
HEADERS := server.hpp workers_threads.hpp global.hpp
# List the names of your object files (generated from your source files)
OBJS := $(SRCS:=.o)
# Name of your executable (change this to whatever you want)
EXEC := poller
# Default target
all: $(EXEC)
# Rule to link the object files into an executable
$(EXEC): $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) -o $(EXEC)
# Rule to compile each source file into an object file
%.o: %.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) -c $< -o $@
# Remove generated files
clean:
rm -f $(OBJS) $(EXEC)