ocaml applications -> dynamic compil and link

"make deb" creates a valid (???) deb package
paparazzi_demo to play s simple example
This commit is contained in:
Pascal Brisset
2005-02-24 13:22:14 +00:00
parent 175d65779e
commit c1622f28ed
26 changed files with 231 additions and 129 deletions
+10 -3
View File
@@ -1,13 +1,17 @@
OCAML=ocaml
OCAMLC=ocamlc -g -I ../lib/ocaml
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc
all: gen_aircraft.out gen_airframe.out gen_calib.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out
FP_CMO = fp_syntax.cmo fp_parser.cmo fp_lexer.cmo fp_proc.cmo gen_flight_plan.cmo
FP_CMO = fp_syntax.cmo fp_parser.cmo fp_lexer.cmo fp_proc.cmo gen_flight_plan.ml
ABS_FP = $(FP_CMO:%=$$PAPARAZZI_SRC/sw/tools/%)
gen_flight_plan.out : $(FP_CMO)
$(OCAMLC) lib.cma $^ -o $@
cat ../../pprz_src_test.sh > $@
echo '$(OCAML) -I $$PAPARAZZI_SRC/sw/lib/ocaml -I $$PAPARAZZI_SRC/sw/tools lib-pprz.cma $(ABS_FP) $$*' >> $@
chmod a+x $@
fp_parser.cmo : fp_parser.cmi fp_syntax.cmi
fp_parser.cmi : fp_parser.ml fp_syntax.cmi
@@ -18,7 +22,10 @@ fp_syntax.cmo : fp_syntax.cmi
%.out : %.ml
$(OCAMLC) lib.cma $< -o $@
$(OCAMLC) -o /dev/null lib-pprz.cma $< # To check
cat ../../pprz_src_test.sh > $@
echo '$(OCAML) -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma $$PAPARAZZI_SRC/sw/tools/$< $$*' >> $@
chmod a+x $@
%.cmo : %.ml
$(OCAMLC) -c $<
+2
View File
@@ -10,6 +10,8 @@ let mkdir = fun d ->
Unix.mkdir d 0o755
let _ =
if Array.length Sys.argv <> 2 then
failwith (sprintf "Usage: %s <xml_airframe_file>" Sys.argv.(0));
let aircraft = Sys.argv.(1) in
let conf = Xml.parse_file conf_xml in
let aircraft_xml =
+3 -1
View File
@@ -358,12 +358,14 @@ let check_distance = fun (hx, hy) max_d wp ->
let _ =
let xml_file = ref "fligh_plan.xml"
let xml_file = ref ""
and dump = ref false in
Arg.parse [("-dump", Arg.Set dump, "Dump compile result");
("-nocheck", Arg.Clear check_expressions, "Disable expression checking")]
(fun f -> xml_file := f)
"Usage:";
if !xml_file = "" then
failwith (sprintf "Usage: %s <xml-flight-plan-file>" Sys.argv.(0));
try
let xml = Xml.parse_file !xml_file in
let dir = Filename.dirname !xml_file in
+1 -1
View File
@@ -239,7 +239,7 @@ end
let _ =
if Array.length Sys.argv <> 3 then begin
fprintf stderr "Usage: %s <.xml file> <class_name>" Sys.argv.(0)
failwith (sprintf "Usage: %s <.xml file> <class_name>" Sys.argv.(0))
end;
let filename = Sys.argv.(1) in
let class_name = Sys.argv.(2) in
+3
View File
@@ -100,6 +100,9 @@ let parse_class = fun c ->
let _ =
if Array.length Sys.argv <> 2 then begin
failwith (sprintf "Usage: %s <.xml ubx protocol file>" Sys.argv.(0))
end;
let xml_file = Sys.argv.(1) in
try
let xml = Xml.parse_file xml_file in