forked from awwit/httpserverapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 702 Bytes
/
Makefile
File metadata and controls
34 lines (24 loc) · 702 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
33
34
RM = rm -rf
MKDIR = mkdir -p
#CXX = g++
CXXFLAGS += -fPIC -std=c++14 -c -Wall -O2
LDFLAGS = -shared -ldl -lpthread -lgnutls
DEFS = POSIX
DEFINES = $(patsubst %, -D%, $(DEFS) )
SOURCEDIR = ./src
BUILDDIR = ./build
OBJDIR = $(BUILDDIR)/obj
SOURCES = $(shell find $(SOURCEDIR) -type f -name '*.cpp')
OBJECTS = $(patsubst $(SOURCEDIR)/%.cpp, $(OBJDIR)/%.o, $(SOURCES) )
EXECUTABLE = $(BUILDDIR)/httpserverapp.so
.PHONY: all clean
all: $(BUILDDIR) $(EXECUTABLE)
$(BUILDDIR):
$(MKDIR) $@
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
$(OBJECTS) : $(OBJDIR)/%.o : $(SOURCEDIR)/%.cpp
@$(MKDIR) $(dir $@)
$(CXX) $(DEFINES) $(CXXFLAGS) $< -o $@
clean:
$(RM) $(OBJDIR) $(EXECUTABLE)