-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved all headers under native dir; updated Makefile; added webserver…
…e and webclient sample app
- Loading branch information
Showing
11 changed files
with
20 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
*.a | ||
*.o | ||
sample | ||
|
||
.cproject | ||
.project | ||
.settings/* | ||
|
||
webclient | ||
webserver | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,20 @@ | ||
PROGNAME = sample | ||
LIBS = -lrt -lm -lpthread | ||
LIBUV_INC = $(LIBUV_PATH)/include | ||
HTTP_PARSER_INC = $(HTTP_PARSER_PATH) | ||
INCLUDES = -I$(LIBUV_INC) -I$(HTTP_PARSER_INC) | ||
LDFLAGS = | ||
OBJECTS = sample.o $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o | ||
CPPFLAGS = -std=gnu++0x | ||
CPPFLAGS_DEBUG = $(CPPFLAGS) -g -O0 | ||
CXXFLAGS = -std=gnu++0x -g -O0 -I$(LIBUV_PATH)/include -I$(HTTP_PARSER_PATH) -I. | ||
|
||
all: env_req $(PROGNAME) | ||
all: webclient webserver | ||
|
||
$(PROGNAME): $(OBJECTS) | ||
g++ -o $(PROGNAME) $(OBJECTS) $(LIBS) $(INCLUDES) $(LDFLAGS) | ||
|
||
$(OBJECTS): Makefile | ||
webclient: webclient.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h) | ||
$(CXX) $(CXXFLAGS) -o webclient webclient.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o -lrt -lm -lpthread | ||
|
||
webserver: webserver.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h) | ||
$(CXX) $(CXXFLAGS) -o webserver webserver.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o -lrt -lm -lpthread | ||
|
||
$(LIBUV_PATH)/uv.a: | ||
$(MAKE) -C $(LIBUV_PATH) | ||
|
||
$(HTTP_PARSER_PATH)/http_parser.o: | ||
$(MAKE) -C $(HTTP_PARSER_PATH) http_parser.o | ||
|
||
sample.o: sample.cpp $(wildcard *.h) | ||
g++ -c $(CPPFLAGS_DEBUG) $(INCLUDES) -o sample.o sample.cpp | ||
|
||
env_req: | ||
ifndef LIBUV_PATH | ||
$(error Variable 'LIBUV_PATH' must be set to the path of libuv library.) | ||
endif | ||
ifndef HTTP_PARSER_PATH | ||
$(error Variable 'HTTP_PARSER_PATH' must be set to the path of http-parser library.) | ||
endif | ||
|
||
|
||
clean: | ||
rm -f $(LIBUV_PATH)/uv.a | ||
rm -f $(HTTP_PARSER_PATH)/http_parser.o | ||
rm *.o $(PROGNAME) | ||
rm -f webclient webserver |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <iostream> | ||
#include <native/http.h> | ||
using namespace native::http; | ||
|
||
int main() | ||
{ | ||
return native::run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include <iostream> | ||
#include "http.h" | ||
#include <native/http.h> | ||
using namespace native::http; | ||
|
||
int main() | ||
|