Permalink
Browse files

copied dependent libs into deps directory; output is native.a (this i…

…ncludes uv.a and http_parser.o) from now on
  • Loading branch information...
1 parent 7c5da91 commit e122ef2f54084f4194bf887b126be96fcbeed097 @d5 committed Feb 20, 2012
Showing with 34 additions and 19 deletions.
  1. +4 −1 .gitignore
  2. +26 −10 Makefile
  3. +1 −8 README.md
  4. +1 −0 deps/http-parser
  5. +1 −0 deps/libuv
  6. +1 −0 native.cpp
View
@@ -6,6 +6,9 @@ doc/html/*
doc/latex/*
wiki/*
-webclient
+echo
webserver
file_test
+
+*.a
+*.o
View
@@ -1,4 +1,4 @@
-CXXFLAGS = -std=gnu++0x -g -O0 -I$(LIBUV_PATH)/include -I$(HTTP_PARSER_PATH) -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CXXFLAGS = -std=gnu++0x -g -O0 -Ideps/libuv/include -Ideps/http-parser -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
OS_NAME=$(shell uname -s)
ifeq (${OS_NAME},Darwin)
@@ -7,18 +7,34 @@ else
RTLIB=-lrt
endif
-all: echo
+all: native.a echo
-echo: echo.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h) $(wildcard native/detail/*.h) native.h
- $(CXX) $(CXXFLAGS) -o echo echo.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(RTLIB) -lm -lpthread
+echo: native.a echo.cpp
+ $(CXX) $(CXXFLAGS) -o echo echo.cpp native.a $(RTLIB) -lm -lpthread
-$(LIBUV_PATH)/uv.a:
- $(MAKE) -C $(LIBUV_PATH)
+native.a: deps/libuv/uv.a deps/http-parser/http_parser.o native.o
+ mkdir -p objs
+ cd objs; \
+ ar x ../deps/libuv/uv.a; \
+ cp ../deps/http-parser/http_parser.o .; \
+ cp ../native.o .; \
+ ar rcs native.a *.o; \
+ cp native.a ../; \
+ cd ..; \
+ rm -rf objs
-$(HTTP_PARSER_PATH)/http_parser.o:
- $(MAKE) -C $(HTTP_PARSER_PATH) http_parser.o
+deps/libuv/uv.a:
+ $(MAKE) -C deps/libuv
+
+deps/http-parser/http_parser.o:
+ $(MAKE) -C deps/http-parser http_parser.o
+
+native.o: native.cpp native.h $(wildcard native/*.h) $(wildcard native/detail/*.h)
+ $(CXX) $(CXXFLAGS) -o native.o -c native.cpp $(RTLIB) -lm -lpthread
clean:
- rm -f $(LIBUV_PATH)/uv.a
- rm -f $(HTTP_PARSER_PATH)/http_parser.o
+ rm -f deps/libuv/uv.a
+ rm -f deps/http-parser/http_parser.o
+ rm -f native.a
rm -f echo
+ rm -rf objs
View
@@ -27,14 +27,7 @@ Simple echo server:
## Getting started
-<em>node.native</em> consists of header files(*.h) only, but requires [libuv](https://github.com/joyent/libuv) and [http-parser](https://github.com/joyent/http-parser) lib to use.
-
-To compile included sample application(webserver.cpp):
-
- export LIBUV_PATH=/path/to/libuv_dir
- export HTTP_PARSER_PATH=/path/to/http-parser_dir
-
-then,
+To compile <b>native.a</b> and sample apps:
make
Submodule http-parser added at 7bc668
Submodule libuv added at 372ed1
View
@@ -0,0 +1 @@
+#include "native.h"

0 comments on commit e122ef2

Please sign in to comment.