File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ RM = rm -rf
2+ MKDIR = mkdir -p
3+
4+ # CXX = g++
5+ CXXFLAGS += -std=c++14 -c -Wall -O2
6+ LDFLAGS = -ldl -lpthread -lrt -lgnutls
7+
8+ DEFS = POSIX
9+ DEFINES = $(patsubst % , -D% , $(DEFS ) )
10+
11+ SOURCEDIR = ./src
12+ BUILDDIR = ./build
13+ OBJDIR = $(BUILDDIR ) /obj
14+
15+ SOURCES = $(shell find $(SOURCEDIR ) -type f -name '* .cpp')
16+ OBJECTS = $(patsubst $(SOURCEDIR ) /% .cpp, $(OBJDIR ) /% .o, $(SOURCES ) )
17+
18+ EXECUTABLE = $(BUILDDIR ) /httpserver
19+
20+ .PHONY : all clean
21+ all : $(BUILDDIR ) $(EXECUTABLE )
22+
23+ $(BUILDDIR ) :
24+ $(MKDIR ) $@
25+
26+ $(EXECUTABLE ) : $(OBJECTS )
27+ $(CXX ) $(LDFLAGS ) $(OBJECTS ) -o $@
28+
29+ $(OBJECTS ) : $(OBJDIR ) /% .o : $(SOURCEDIR ) /% .cpp
30+ @$(MKDIR ) $(dir $@ )
31+ $(CXX ) $(DEFINES ) $(CXXFLAGS ) $< -o $@
32+
33+ clean :
34+ $(RM ) $(OBJDIR ) $(EXECUTABLE )
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ Windows: `ws2_32.lib`, `libgnutls.dll.a`
3636
3737Linux:
3838
39+ ``` sh
40+ git clone https://github.com/awwit/httpserver.git
41+ cd httpserver
42+ make
43+ ```
44+
45+ or
46+
3947``` sh
4048git clone https://github.com/awwit/httpserver.git
4149cd httpserver
You can’t perform that action at this time.
0 commit comments