Permalink
Browse files

WebSocketライブラリを分離した refs 48

  • Loading branch information...
1 parent 437819c commit b584bd20dfe6d95f65bc6e1ba8838b1ecfa8ec0e @mzp committed Nov 23, 2010
View
@@ -9,4 +9,5 @@ runner
main
*.opt
*.run
-*.annot
+*.annot
+echo/echo
View
@@ -1,78 +1,21 @@
-.PHONY: all check install clean
-
-.SUBDIRS:
+public.UseCamlp4(files) =
+ protected.CAMLP4CMO = $(addprefix $(ROOT)/camlp4/,$(addsuffix .cmo,$(files)))
+ OCAMLPPFLAGS+=-pp 'camlp4o $(CAMLP4CMO)'
+ OCAMLDEPFLAGS+=-pp 'camlp4o $(CAMLP4CMO)'
+ export
+ .SCANNER: scan-ocaml-%.ml: %.ml $(CAMLP4CMO)
USE_OCAMLFIND = true
-OCAMLPACKS[] =
- oUnit
- extlib
- num
if $(not $(OCAMLFIND_EXISTS))
eprintln('This project requires ocamlfind, but is was not found.')
eprintln('You need to install ocamlfind and run "omake --configure".')
exit 1
NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-public.UseCamlp4(files) =
- protected.CAMLP4CMO = $(addprefix $(ROOT)/camlp4/,$(addsuffix .cmo,$(files)))
- OCAMLPPFLAGS+=-pp 'camlp4o $(CAMLP4CMO)'
- OCAMLDEPFLAGS+=-pp 'camlp4o $(CAMLP4CMO)'
- export
- .SCANNER: scan-ocaml-%.ml: %.ml $(CAMLP4CMO)
+BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
OCAML_WARN_FLAGS=-w A -warn-error A -annot
OCAMLFLAGS=$`(OCAML_WARN_FLAGS) #`
-OCAMLFLAGS +=
-OCAMLCFLAGS +=
-OCAMLOPTFLAGS +=
-OCAML_LINK_FLAGS +=
-OCAML_BYTE_LINK_FLAGS +=
-OCAML_NATIVE_LINK_FLAGS +=
-
-FILES[] =
- base
- hList
- server
- logger
- dispatch
- bigIntUtil
- parsec
- handshake
- frame
- httpResponse
- httpRequest
- echo
- glob
- maybe
- getHandler
- wsHandler
- dsl
-
-UseCamlp4($(EMPTY))
-
-TEST_FILES[] =
- loggerTest
- bigIntUtilTest
- handshakeTest
- frameTest
- httpResponseTest
- httpRequestTest
- globTest
-
-PROGRAM = main
-TEST_PROGRAM = runner
-OCAML_LIBS +=
-OCAML_CLIBS +=
-OCAML_OTHER_LIBS +=
-OCAML_LIB_FLAGS +=
-
-.DEFAULT : all
-all: $(OCamlProgram $(PROGRAM), main $(FILES))
-check : $(OCamlProgram $(TEST_PROGRAM), $(TEST_FILES) $(FILES))
- ./$(TEST_PROGRAM)
-clean:
- rm -f $(PROGRAM) $(TEST_PROGRAM) *.cm[iox] *.opt *.run *~ *.out *.o
+.SUBDIRS: webSocket echo
View
@@ -0,0 +1,35 @@
+.PHONY: all
+
+OCAMLPACKS[] =
+ num
+ extlib
+ unix
+
+OCAMLFLAGS +=
+OCAMLCFLAGS +=
+OCAMLOPTFLAGS +=
+OCAML_LINK_FLAGS +=
+OCAML_BYTE_LINK_FLAGS +=
+OCAML_NATIVE_LINK_FLAGS +=
+
+OCAMLINCLUDES[] =
+ ../webSocket
+
+FILES[] =
+ echo
+ main
+ ../webSocket/webSocket
+
+UseCamlp4($(EMPTY))
+
+PROGRAM=echo
+OCAML_LIBS +=
+OCAML_CLIBS +=
+OCAML_OTHER_LIBS +=
+OCAML_LIB_FLAGS +=
+
+.DEFAULT : all
+all: $(OCamlProgram $(PROGRAM), $(FILES))
+
+clean:
+ rm -f $(PROGRAM) *.cm[iox] *.opt *.run *~ *.out *.o *.annot
File renamed without changes.
View
@@ -1,4 +1,4 @@
-open Dsl
+open WebSocket.Dsl
let echo =
server begin fun s ->
View
@@ -0,0 +1,5 @@
+let _ =
+ WebSocket.Logger.setup ();
+ WebSocket.Logger.set_level WebSocket.Logger.cDebug;
+ WebSocket.Logger.info "Websocket/OCaml server start(0.0.0.0:8080)";
+ WebSocket.Server.run (WebSocket.Dispatch.make Echo.echo) "0.0.0.0" 8080
View
@@ -1,5 +0,0 @@
-let _ =
- Logger.setup ();
- Logger.set_level Logger.cDebug;
- Logger.info "Websocket/OCaml server start(0.0.0.0:8080)";
- Server.run (Dispatch.make Echo.echo) "0.0.0.0" 8080
View
@@ -0,0 +1,65 @@
+.PHONY: all check clean
+
+
+OCAMLPACKS[] =
+ oUnit
+ extlib
+ num
+
+
+OCAMLFLAGS +=
+OCAMLCFLAGS +=
+OCAMLOPTFLAGS +=
+OCAML_LINK_FLAGS +=
+OCAML_BYTE_LINK_FLAGS +=
+OCAML_NATIVE_LINK_FLAGS +=
+
+FILES[] =
+ base
+ hList
+ server
+ logger
+ dispatch
+ bigIntUtil
+ parsec
+ handshake
+ frame
+ httpResponse
+ httpRequest
+ glob
+ maybe
+ getHandler
+ wsHandler
+ dsl
+
+UseCamlp4($(EMPTY))
+
+TEST_FILES[] =
+ loggerTest
+ bigIntUtilTest
+ handshakeTest
+ frameTest
+ httpResponseTest
+ httpRequestTest
+ globTest
+
+PROGRAM=webSocket
+TEST_PROGRAM = runner
+OCAML_LIBS +=
+OCAML_CLIBS +=
+OCAML_OTHER_LIBS +=
+OCAML_LIB_FLAGS +=
+
+OCAMLLINK = $(OCAMLC)
+OCAMLOPTLINK = $(OCAMLOPT)
+OCAMLC += -for-pack $(capitalize $(PROGRAM))
+OCAMLOPT += -for-pack $(capitalize $(PROGRAM))
+
+
+.DEFAULT : all
+all: $(OCamlPackage $(PROGRAM), $(FILES))
+check : $(OCamlProgram $(TEST_PROGRAM), $(TEST_FILES) $(FILES))
+ ./$(TEST_PROGRAM)
+
+clean:
+ rm -f $(PROGRAM) $(TEST_PROGRAM) *.cm[iox] *.opt *.run *~ *.out *.o
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.
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.
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.
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.
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.
File renamed without changes.

0 comments on commit b584bd2

Please sign in to comment.