2009-02-16 01:34:45 +01:00
|
|
|
EVDIR=$(HOME)/local/libev
|
2009-03-13 12:22:35 +01:00
|
|
|
|
|
|
|
OIINC = $(HOME)/projects/oi/
|
|
|
|
OILIB = $(HOME)/projects/oi/liboi.a
|
|
|
|
|
2009-02-16 01:34:45 +01:00
|
|
|
V8INC = $(HOME)/src/v8/include
|
2009-03-13 12:22:35 +01:00
|
|
|
#V8LIB = $(HOME)/src/v8/libv8_g.a
|
|
|
|
V8LIB = $(HOME)/src/v8/libv8.a
|
2009-02-16 01:34:45 +01:00
|
|
|
|
2009-03-13 12:22:35 +01:00
|
|
|
CFLAGS = -g -I$(V8INC) -I$(OIINC) -DHAVE_GNUTLS=0 -Ideps/ebb
|
2009-02-23 21:53:03 +01:00
|
|
|
LDFLAGS = -lev -pthread # -lefence
|
2009-02-16 01:34:45 +01:00
|
|
|
|
|
|
|
ifdef EVDIR
|
|
|
|
CFLAGS += -I$(EVDIR)/include
|
|
|
|
LDFLAGS += -L$(EVDIR)/lib
|
|
|
|
endif
|
|
|
|
|
2009-03-13 12:22:35 +01:00
|
|
|
node: node.o node_tcp.o node_http.o node_timer.o ebb_request_parser.o
|
|
|
|
g++ -o node $^ $(LDFLAGS) $(V8LIB) $(OILIB)
|
2009-02-16 01:34:45 +01:00
|
|
|
|
2009-03-03 01:56:15 +01:00
|
|
|
node.o: node.cc
|
2009-02-20 16:34:18 +01:00
|
|
|
g++ $(CFLAGS) -c $<
|
2009-03-02 15:49:24 +01:00
|
|
|
|
2009-03-03 01:56:15 +01:00
|
|
|
node_tcp.o: node_tcp.cc
|
2009-02-22 17:46:11 +01:00
|
|
|
g++ $(CFLAGS) -c $<
|
2009-02-16 01:34:45 +01:00
|
|
|
|
2009-03-03 01:56:15 +01:00
|
|
|
node_http.o: node_http.cc
|
|
|
|
g++ $(CFLAGS) -c $<
|
2009-03-03 19:17:33 +01:00
|
|
|
|
|
|
|
node_timer.o: node_timer.cc
|
|
|
|
g++ $(CFLAGS) -c $<
|
2009-03-03 01:56:15 +01:00
|
|
|
|
|
|
|
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 $@
|
2009-02-22 17:46:11 +01:00
|
|
|
|
2009-03-04 11:29:39 +01:00
|
|
|
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
|
|
|
|
|
2009-02-16 01:34:45 +01:00
|
|
|
clean:
|
2009-02-20 16:34:18 +01:00
|
|
|
rm -f ebb_request_parser.c
|
2009-02-16 01:34:45 +01:00
|
|
|
rm -f *.o
|
2009-03-03 01:56:15 +01:00
|
|
|
rm -f node
|
2009-02-16 01:34:45 +01:00
|
|
|
|
|
|
|
.PHONY: clean test
|