diff --git a/Makefile b/Makefile index d1f4c2f58e4..57e884d2f00 100644 --- a/Makefile +++ b/Makefile @@ -60,14 +60,14 @@ XSENS_XML = $(CONF)/xsens_MTi-G.xml TOOLS=$(PAPARAZZI_SRC)/sw/tools HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc) ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),) -#ARMGCC=/opt/paparazzi/bin/arm-elf-gcc -ARMGCC=/usr/bin/arm-elf-gcc +ARMGCC=$(shell which arm-elf-gcc) else ARMGCC=$(HAVE_ARM_NONE_EABI_GCC) endif +OCAML=$(shell which ocaml) +OCAMLRUN=$(shell which ocamlrun) - -all: static conf +all: commands static conf static : lib center tools cockpit multimon tmtc logalizer lpc21iap sim_static static_h usb_lib @@ -211,6 +211,7 @@ clean: rm -f $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(DL_PROTOCOL_H) find . -mindepth 2 -name Makefile -exec sh -c '$(MAKE) -C `dirname {}` $@' \; find . -name '*~' -exec rm -f {} \; + rm -f paparazzi sw/simulator/launchsitl cleanspaces: find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \; @@ -232,3 +233,13 @@ test_all_example_airframes: $(MAKE) AIRCRAFT=HITL clean_ac ap $(MAKE) AIRCRAFT=DM clean_ac ap sim $(MAKE) AIRCRAFT=CSC clean_ac ap + +commands: paparazzi sw/simulator/launchsitl + +paparazzi: + cat src/paparazzi | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ + chmod a+x $@ + +sw/simulator/launchsitl: + cat src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ + chmod a+x $@ diff --git a/paparazzi.osx b/paparazzi.osx deleted file mode 100755 index 7efa9dc9a67..00000000000 --- a/paparazzi.osx +++ /dev/null @@ -1,15 +0,0 @@ -#!/opt/local/bin/ocamlrun /opt/local/bin/ocaml -#load "unix.cma";; -let (//) = Filename.concat -let dirname = Filename.dirname Sys.argv.(0) -let dirname = if Filename.is_relative dirname && dirname <> Filename.current_dir_name then Sys.getcwd () // dirname else dirname -let env = - Array.map (fun var -> - let value = try Sys.getenv var with _ -> dirname in - let value = if value = "." then Sys.getcwd () else value in - Printf.sprintf "%s=%s" var value) - [|"PAPARAZZI_SRC"; "PAPARAZZI_HOME"|] -let com = dirname // "sw/supervision/paparazzicenter";; -Sys.argv.(0) <- com;; -let env = Array.append env (Unix.environment ());; -Unix.execve com Sys.argv env diff --git a/sw/simulator/launchsitl b/src/launchsitl similarity index 96% rename from sw/simulator/launchsitl rename to src/launchsitl index d6dbb69d894..261de6c4775 100755 --- a/sw/simulator/launchsitl +++ b/src/launchsitl @@ -1,4 +1,4 @@ -#!/usr/bin/ocamlrun /usr/bin/ocaml +#!OCAMLRUN OCAML #load "unix.cma";; let (//) = Filename.concat let paparazzi_home = diff --git a/paparazzi b/src/paparazzi similarity index 94% rename from paparazzi rename to src/paparazzi index cc39f72a8c0..8895cccacba 100755 --- a/paparazzi +++ b/src/paparazzi @@ -1,4 +1,4 @@ -#!/usr/bin/ocamlrun /usr/bin/ocaml +#!OCAMLRUN OCAML #load "unix.cma";; let (//) = Filename.concat let dirname = Filename.dirname Sys.argv.(0)