diff --git a/Makefile b/Makefile index 1be3a02756..10913d67b6 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,9 @@ ABI_MESSAGES_H=$(STATICINCLUDE)/abi_messages.h GEN_HEADERS = $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(XSENS_PROTOCOL_H) $(DL_PROTOCOL_H) $(DL_PROTOCOL2_H) $(ABI_MESSAGES_H) +# default directory for temporary files +TMPDIR ?= /tmp + all: ground_segment ext lpctools print_build_version: @@ -151,46 +154,46 @@ static_h: $(GEN_HEADERS) $(MESSAGES_H) : $(MESSAGES_XML) tools $(Q)test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE) @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages.out $< telemetry > /tmp/msg.h - $(Q)mv /tmp/msg.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages.out $< telemetry > $(TMPDIR)/msg.h + $(Q)mv $(TMPDIR)/msg.h $@ $(Q)chmod a+r $@ $(MESSAGES2_H) : $(MESSAGES_XML) tools $(Q)test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE) @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages2.out $< telemetry > /tmp/msg2.h - $(Q)mv /tmp/msg2.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages2.out $< telemetry > $(TMPDIR)/msg2.h + $(Q)mv $(TMPDIR)/msg2.h $@ $(Q)chmod a+r $@ $(UBX_PROTOCOL_H) : $(UBX_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_ubx.out $< > /tmp/ubx.h - $(Q)mv /tmp/ubx.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_ubx.out $< > $(TMPDIR)/ubx.h + $(Q)mv $(TMPDIR)/ubx.h $@ $(MTK_PROTOCOL_H) : $(MTK_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_mtk.out $< > /tmp/mtk.h - $(Q)mv /tmp/mtk.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_mtk.out $< > $(TMPDIR)/mtk.h + $(Q)mv $(TMPDIR)/mtk.h $@ $(XSENS_PROTOCOL_H) : $(XSENS_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_xsens.out $< > /tmp/xsens.h - $(Q)mv /tmp/xsens.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_xsens.out $< > $(TMPDIR)/xsens.h + $(Q)mv $(TMPDIR)/xsens.h $@ $(DL_PROTOCOL_H) : $(MESSAGES_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages.out $< datalink > /tmp/dl.h - $(Q)mv /tmp/dl.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages.out $< datalink > $(TMPDIR)/dl.h + $(Q)mv $(TMPDIR)/dl.h $@ $(DL_PROTOCOL2_H) : $(MESSAGES_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages2.out $< datalink > /tmp/dl2.h - $(Q)mv /tmp/dl2.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_messages2.out $< datalink > $(TMPDIR)/dl2.h + $(Q)mv $(TMPDIR)/dl2.h $@ $(ABI_MESSAGES_H) : $(MESSAGES_XML) tools @echo BUILD $@ - $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_abi.out $< airborne > /tmp/abi.h - $(Q)mv /tmp/abi.h $@ + $(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(TOOLS)/gen_abi.out $< airborne > $(TMPDIR)/abi.h + $(Q)mv $(TMPDIR)/abi.h $@ include Makefile.ac diff --git a/Makefile.ac b/Makefile.ac index 1ef55631b3..fdd11d5da3 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -62,6 +62,9 @@ endif # telemetry periodic frequency defaults to 60Hz TELEMETRY_FREQUENCY ?= 60 +# default directory for temporary files +TMPDIR ?= /tmp + init: @[ -d $(PAPARAZZI_HOME) ] || (echo "Copying config example in your $(PAPARAZZI_HOME) directory"; mkdir -p $(PAPARAZZI_HOME); cp -a conf $(PAPARAZZI_HOME); cp -a data $(PAPARAZZI_HOME); mkdir -p $(PAPARAZZI_HOME)/var/maps; mkdir -p $(PAPARAZZI_HOME)/var/include) @@ -87,15 +90,15 @@ makefile_ac: $(MAKEFILE_AC) $(AIRFRAME_H) : $(CONF)/$(AIRFRAME_XML) $(CONF_XML) $(AIRCRAFT_MD5) $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ - $(Q)$(TOOLS)/gen_airframe.out $(AC_ID) $(AIRCRAFT) $(MD5SUM) $< > /tmp/airframe.h - $(Q)mv /tmp/airframe.h $@ + $(Q)$(TOOLS)/gen_airframe.out $(AC_ID) $(AIRCRAFT) $(MD5SUM) $< > $(TMPDIR)/airframe.h + $(Q)mv $(TMPDIR)/airframe.h $@ $(Q)cp $(CONF)/airframes/airframe.dtd $(AIRCRAFT_CONF_DIR)/airframes $(RADIO_H) : $(CONF)/$(RADIO) $(CONF_XML) $(TOOLS)/gen_radio.out $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ - $(Q)$(TOOLS)/gen_radio.out $< > /tmp/radio.h - $(Q)mv /tmp/radio.h $@ + $(Q)$(TOOLS)/gen_radio.out $< > $(TMPDIR)/radio.h + $(Q)mv $(TMPDIR)/radio.h $@ $(Q)cp $< $(AIRCRAFT_CONF_DIR)/radios $(PERIODIC_H) : $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF_XML) $(CONF)/$(TELEMETRY) $(MAKEFILE_AC) @@ -109,8 +112,8 @@ $(PERIODIC_H) : $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF_XML) $(CONF)/$(TE $(FLIGHT_PLAN_H) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML) $(TOOLS)/gen_flight_plan.out $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ - $(Q)$(TOOLS)/gen_flight_plan.out $< > /tmp/$(AC_ID)_fp.h - $(Q)mv /tmp/$(AC_ID)_fp.h $@ + $(Q)$(TOOLS)/gen_flight_plan.out $< > $(TMPDIR)/$(AC_ID)_fp.h + $(Q)mv $(TMPDIR)/$(AC_ID)_fp.h $@ $(Q)chmod a+r $@ $(Q)cp $< $(AIRCRAFT_CONF_DIR)/flight_plans diff --git a/data/maps/Makefile b/data/maps/Makefile index 426e3ae36d..9e8dd00a43 100644 --- a/data/maps/Makefile +++ b/data/maps/Makefile @@ -3,6 +3,9 @@ DATADIR = $(PAPARAZZI_HOME)/conf/maps_data Q=@ +# default directory for temporary files +TMPDIR ?= /tmp + all: $(PAPARAZZI_HOME)/conf/maps.xml clean: @@ -24,11 +27,11 @@ $(PAPARAZZI_HOME)/conf/maps.xml: $(DATADIR)/maps.google.com $(eval GOOGLE_VERSION := $(shell grep -E "http://khm[0-9]+.google.com/kh/v=[0-9]+.x26" $(DATADIR)/maps.google.com | sed -E 's#.*http://khm[0-9]+.google.com/kh/v=##;s#.x26.*##')) @echo "Updated google maps version to $(GOOGLE_VERSION)" @echo "-----------------------------------------------" - $(Q)echo "" > /tmp/maps.xml - $(Q)echo "" >> /tmp/maps.xml - $(Q)echo "" >> /tmp/maps.xml - $(Q)echo "" >> /tmp/maps.xml - $(Q)mv /tmp/maps.xml $@ + $(Q)echo "" > $(TMPDIR)/maps.xml + $(Q)echo "" >> $(TMPDIR)/maps.xml + $(Q)echo "" >> $(TMPDIR)/maps.xml + $(Q)echo "" >> $(TMPDIR)/maps.xml + $(Q)mv $(TMPDIR)/maps.xml $@ FORCE: .PHONY: all clean diff --git a/sw/in_progress/button/Makefile b/sw/in_progress/button/Makefile index c24a18928a..73f653b0d5 100644 --- a/sw/in_progress/button/Makefile +++ b/sw/in_progress/button/Makefile @@ -27,6 +27,10 @@ OCAMLC = ocamlc OCAMLOPT = ocamlopt INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../../lib/ocaml +# default directory for temporary files +TMPDIR ?= /tmp + + all: panic $^ @@ -54,8 +58,8 @@ export.cmo : gtk_export.cmo export.cmx : gtk_export.cmx gtk_export.ml : export.glade - grep -v invisible_char $< > /tmp/$< - lablgladecc2 -root export -hide-default /tmp/$< | grep -B 1000000 " end" > $@ + grep -v invisible_char $< > $(TMPDIR)/$< + lablgladecc2 -root export -hide-default $(TMPDIR)/$< | grep -B 1000000 " end" > $@ pt : ahrsview imuview ahrs2fg diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile index 4c185fd899..bf3adb718f 100644 --- a/sw/lib/ocaml/Makefile +++ b/sw/lib/ocaml/Makefile @@ -51,6 +51,9 @@ XCMX = $(XSRC:.ml=.cmx) TESTS_SRC = test/test_latlong.ml TESTS_CMO = $(TESTS_SRC:.ml=.cmo) +# default directory for temporary files +TMPDIR ?= /tmp + $(XCMO) $(XCMX) myGtkInit.cmo : INCLUDES=$(XINCLUDES) all : lib-pprz.cma xlib-pprz.cma myGtkInit.cmo xml_get.out opt @@ -141,24 +144,24 @@ expr_syntax.cmo : expr_syntax.cmi gtk_papget_editor.ml : widgets.glade - grep -v invisible_char $< > /tmp/$@_$< - lablgladecc2 -root papget_editor -hide-default /tmp/$@_$< | grep -B 1000000 " end" > $@ - @rm /tmp/$@_$< + grep -v invisible_char $< > $(TMPDIR)/$@_$< + lablgladecc2 -root papget_editor -hide-default $(TMPDIR)/$@_$< | grep -B 1000000 " end" > $@ + @rm $(TMPDIR)/$@_$< gtk_papget_text_editor.ml : widgets.glade - grep -v invisible_char $< > /tmp/$@_$< - lablgladecc2 -root table_text_editor -hide-default /tmp/$@_$< | grep -B 1000000 " end" > $@ - @rm /tmp/$@_$< + grep -v invisible_char $< > $(TMPDIR)/$@_$< + lablgladecc2 -root table_text_editor -hide-default $(TMPDIR)/$@_$< | grep -B 1000000 " end" > $@ + @rm $(TMPDIR)/$@_$< gtk_papget_gauge_editor.ml : widgets.glade - grep -v invisible_char $< > /tmp/$@_$< - lablgladecc2 -root table_gauge_editor -hide-default /tmp/$@_$< | grep -B 1000000 " end" > $@ - @rm /tmp/$@_$< + grep -v invisible_char $< > $(TMPDIR)/$@_$< + lablgladecc2 -root table_gauge_editor -hide-default $(TMPDIR)/$@_$< | grep -B 1000000 " end" > $@ + @rm $(TMPDIR)/$@_$< gtk_papget_led_editor.ml : widgets.glade - grep -v invisible_char $< > /tmp/$@_$< - lablgladecc2 -root table_led_editor -hide-default /tmp/$@_$< | grep -B 1000000 " end" > $@ - @rm /tmp/$@_$< + grep -v invisible_char $< > $(TMPDIR)/$@_$< + lablgladecc2 -root table_led_editor -hide-default $(TMPDIR)/$@_$< | grep -B 1000000 " end" > $@ + @rm $(TMPDIR)/$@_$< clean : rm -f *~ *.cm* *.out *.opt .depend *.a *.o *.so caml_from_c_example tests gtk_papget_*.ml expr_parser.ml expr_parser.mli expr_lexer.ml expr_lexer.mli diff --git a/sw/logalizer/Makefile b/sw/logalizer/Makefile index 7478e5a918..5b719da7df 100644 --- a/sw/logalizer/Makefile +++ b/sw/logalizer/Makefile @@ -33,6 +33,9 @@ LIBPPRZCMXA=$(LIBPPRZCMA:.cma=.cmxa) XLIBPPRZCMA=$(LIBPPRZDIR)/xlib-pprz.cma XLIBPPRZCMXA=$(XLIBPPRZCMA:.cma=.cmxa) +# default directory for temporary files +TMPDIR ?= /tmp + all: play plotter plot sd2log plotprofile openlog2tlm play : log_file.cmo play_core.cmo play.cmo @@ -86,8 +89,8 @@ export.cmo : gtk_export.cmo export.cmx : gtk_export.cmx gtk_export.ml : export.glade - grep -v invisible_char $< > /tmp/$< - lablgladecc2 -root export -hide-default /tmp/$< | grep -B 1000000 " end" > $@ + grep -v invisible_char $< > $(TMPDIR)/$< + lablgladecc2 -root export -hide-default $(TMPDIR)/$< | grep -B 1000000 " end" > $@ diff --git a/sw/supervision/Makefile b/sw/supervision/Makefile index 75331ef8c7..18c8756e2a 100644 --- a/sw/supervision/Makefile +++ b/sw/supervision/Makefile @@ -31,6 +31,9 @@ INCLUDES= -I $(LIBPPRZDIR) $(shell ocamlfind query -r -i-format lablgtk2) $(shel LIBPPRZCMA=$(LIBPPRZDIR)/lib-pprz.cma PAPARAZZICENTERCMO = gtk_pc.cmo gtk_process.cmo pc_common.cmo pc_aircraft.cmo pc_control_panel.cmo paparazzicenter.cmo +# default directory for temporary files +TMPDIR ?= /tmp + all: paparazzicenter paparazzicenter : $(PAPARAZZICENTERCMO) $(LIBPPRZDIR)/lib-pprz.cma @@ -38,12 +41,12 @@ paparazzicenter : $(PAPARAZZICENTERCMO) $(LIBPPRZDIR)/lib-pprz.cma $(Q)$(OCAMLC) -custom $(INCLUDES) -o $@ unix.cma str.cma xml-light.cma lablgtk.cma lablglade.cma gtkInit.cmo lib-pprz.cma xlib-pprz.cma lablgnomeui.cma $^ gtk_pc.ml : paparazzicenter.glade - grep -v invisible_char $< > /tmp/$< - lablgladecc2 -hide-default -root window /tmp/$< > $@ + grep -v invisible_char $< > $(TMPDIR)/$< + lablgladecc2 -hide-default -root window $(TMPDIR)/$< > $@ gtk_process.ml : paparazzicenter.glade - grep -v invisible_char $< > /tmp/$< - lablgladecc2 -hide-default -root hbox_program /tmp/$< | grep -B 1000000 " end" > $@ + grep -v invisible_char $< > $(TMPDIR)/$< + lablgladecc2 -hide-default -root hbox_program $(TMPDIR)/$< | grep -B 1000000 " end" > $@ %.cmo : %.ml @echo OC $<