Makefile: praise the return of utop
.
The Makefile is really hackish...
This commit is contained in:
parent
bc16b027c2
commit
09dcb59c14
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,6 +5,8 @@
|
||||
/tezos-webclient
|
||||
/tezos-attacker
|
||||
|
||||
/src/.ocamlinit.utils
|
||||
/src/.ocamlinit.node
|
||||
/src/Makefile.local
|
||||
|
||||
/src/webclient_static.ml
|
||||
|
19
src/Makefile
19
src/Makefile
@ -65,6 +65,8 @@ node/updater/proto_environment.cmi: \
|
||||
@echo OCAMLOPT ${TARGET} $@
|
||||
@$(OCAMLOPT) -nopervasives -nostdlib -opaque -I tmp -I node/updater -c $<
|
||||
|
||||
node/updater/protocol.cmi: node/updater/protocol.cmx
|
||||
|
||||
partial-clean::
|
||||
rm -f node/updater/proto_environment.mli
|
||||
rm -f node/updater/environment_gen
|
||||
@ -190,6 +192,7 @@ UTILS_PACKAGES := \
|
||||
calendar \
|
||||
ezjsonm \
|
||||
ipaddr.unix \
|
||||
lwt.unix \
|
||||
mtime.os \
|
||||
nocrypto \
|
||||
sodium \
|
||||
@ -208,6 +211,12 @@ utils.cmxa: ${UTILS_LIB_IMPLS:.ml=.cmx}
|
||||
@echo LINK $(notdir $@)
|
||||
@${OCAMLOPT} ${OCAMLFLAGS} -a -o $@ $^
|
||||
|
||||
utils.top: DEVFLAGS=
|
||||
utils.top:
|
||||
( $(patsubst %, echo "#require \"%\";;" ; ,${UTILS_PACKAGES}) ) > .ocamlinit.utils
|
||||
( $(patsubst %, echo "#mod_use \"%\";;" ; ,${MINUTILS_LIB_IMPLS} ${UTILS_LIB_IMPLS}) ) >> .ocamlinit.utils
|
||||
utop -init .ocamlinit.utils ${OCAMLFLAGS}
|
||||
|
||||
############################################################################
|
||||
## Node protocol compiler (also embedded in the main program)
|
||||
############################################################################
|
||||
@ -280,7 +289,6 @@ NODE_LIB_INTFS := \
|
||||
node/db/store.mli \
|
||||
node/db/db_proxy.mli \
|
||||
\
|
||||
node/updater/protocol.mli \
|
||||
node/updater/updater.mli \
|
||||
node/updater/proto_environment.mli \
|
||||
node/updater/register.mli \
|
||||
@ -319,6 +327,7 @@ NODE_LIB_IMPLS := \
|
||||
node/db/context.ml \
|
||||
node/db/db_proxy.ml \
|
||||
\
|
||||
node/updater/protocol.ml \
|
||||
node/updater/updater.ml \
|
||||
node/updater/environment.ml \
|
||||
node/updater/proto_environment.ml \
|
||||
@ -390,6 +399,14 @@ ${TZNODE}: minutils.cmxa utils.cmxa compiler.cmxa node.cmxa ${EMBEDDED_NODE_PROT
|
||||
partial-clean::
|
||||
-rm -f proto/*.cm* proto/*.a
|
||||
|
||||
node.top: DEVFLAGS=
|
||||
node.top: ${MINUTILS_LIB_IMPLS} ${UTILS_LIB_IMPLS} ${COMPILER_LIB_IMPLS} ${NODE_LIB_IMPLS}
|
||||
( $(patsubst %, echo "#require \"%\";;" ; ,${NODE_PACKAGES}) ) > .ocamlinit.node
|
||||
( $(patsubst %, echo "#mod_use \"%\";;" ; ,${MINUTILS_LIB_IMPLS} ${UTILS_LIB_IMPLS}) ) >> .ocamlinit.node
|
||||
( $(patsubst %, echo "open %;;" ; ,Error_monad Hash Utils) ) >> .ocamlinit.node
|
||||
( $(patsubst %, echo "#mod_use \"%\";;" ; ,${COMPILER_LIB_IMPLS} ${NODE_LIB_IMPLS}) ) >> .ocamlinit.node
|
||||
utop -init .ocamlinit.node ${OCAMLFLAGS}
|
||||
|
||||
## Embedded protocol modules
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
@ -95,6 +95,7 @@ type template = Lwt_log.template
|
||||
let default_template = "$(date) - $(section): $(message)"
|
||||
|
||||
module Output = struct
|
||||
|
||||
type t =
|
||||
| Null
|
||||
| Stdout
|
||||
@ -102,10 +103,7 @@ module Output = struct
|
||||
| File of string
|
||||
| Syslog of Lwt_log.syslog_facility
|
||||
|
||||
let encoding =
|
||||
let open Data_encoding in
|
||||
conv
|
||||
(function
|
||||
let to_string : t -> string = function
|
||||
| Null -> "/dev/null"
|
||||
| Stdout -> "stdout"
|
||||
| Stderr -> "stderr"
|
||||
@ -132,8 +130,9 @@ module Output = struct
|
||||
| Syslog `UUCP -> "syslog:uucp"
|
||||
| Syslog `NTP -> "syslog:ntp"
|
||||
| Syslog `Security -> "syslog:security"
|
||||
| Syslog `Console -> "syslog:console")
|
||||
(function
|
||||
| Syslog `Console -> "syslog:console"
|
||||
|
||||
let of_string : string -> t = function
|
||||
| "/dev/null" | "null" -> Null
|
||||
| "stdout" -> Stdout
|
||||
| "stderr" -> Stderr
|
||||
@ -163,8 +162,11 @@ module Output = struct
|
||||
(* | s when start_with "syslog:" FIXME error or warning. *)
|
||||
| fp ->
|
||||
(* TODO check absolute path *)
|
||||
File fp)
|
||||
string
|
||||
File fp
|
||||
|
||||
let encoding =
|
||||
let open Data_encoding in
|
||||
conv to_string of_string string
|
||||
|
||||
let of_string str =
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user