0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 20:29:23 +01:00
nodejs/Makefile

56 lines
1.1 KiB
Makefile

EVDIR=$(HOME)/local/libev
OIINC = $(HOME)/projects/oi/
OILIB = $(HOME)/projects/oi/liboi.a
V8INC = $(HOME)/src/v8/include
#V8LIB = $(HOME)/src/v8/libv8_g.a
V8LIB = $(HOME)/src/v8/libv8.a
CFLAGS = -g -I$(V8INC) -I$(OIINC) -DHAVE_GNUTLS=0 -Ideps/ebb
LDFLAGS = -lev -pthread # -lefence
ifdef EVDIR
CFLAGS += -I$(EVDIR)/include
LDFLAGS += -L$(EVDIR)/lib
endif
node: node.o node_tcp.o node_http.o node_timer.o ebb_request_parser.o
g++ -o node $^ $(LDFLAGS) $(V8LIB) $(OILIB)
node.o: node.cc
g++ $(CFLAGS) -c $<
node_tcp.o: node_tcp.cc
g++ $(CFLAGS) -c $<
node_http.o: node_http.cc
g++ $(CFLAGS) -c $<
node_timer.o: node_timer.cc
g++ $(CFLAGS) -c $<
ebb_request_parser.o: ebb_request_parser.c deps/ebb/ebb_request_parser.h
g++ $(CFLAGS) -c $<
ebb_request_parser.c: deps/ebb/ebb_request_parser.rl
ragel -s -G2 $< -o $@
PASS="\033[1;32mPASS\033[0m\n"
FAIL="\033[1;31mFAIL\033[0m\n"
test: node test/test_*
@for i in test/test_*; do \
if [ -x $$i ]; then \
echo "\n\033[1m$$i\033[0m"; \
./$$i && echo $(PASS) || echo $(FAIL); \
fi \
done
clean:
rm -f ebb_request_parser.c
rm -f *.o
rm -f node
.PHONY: clean test