From 6c26d1eda0badcfb8d2c49993156c01b003e091c Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Mon, 13 Feb 2012 14:53:46 +1100 Subject: [PATCH] Cleaning up a lot of warnings from ld about references to directories that don't exist. Cleaning up some formatting of "warnings" that are sent to the user about what the aircraft config is. Made it possible to use a different "make" command so it's now possible to do gnumake and everything build using gnumake instead of the make files calling "make". --- Makefile | 2 +- Makefile.ac | 6 +++--- conf/autopilot/subsystems/fixedwing/autopilot.makefile | 2 +- sw/ground_segment/lpc21iap/Makefile | 6 ++---- sw/ground_segment/misc/Makefile | 4 ++-- sw/lib/ocaml/xml2h.ml | 4 ++-- sw/supervision/Makefile | 2 +- 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index b4c88c3627..da225bf3e9 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ MULTIMON=sw/ground_segment/multimon MISC=sw/ground_segment/misc LOGALIZER=sw/logalizer SIMULATOR=sw/simulator -MAKE=make PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) +MAKE:=$(MAKE) PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) CONF=$(PAPARAZZI_SRC)/conf STATICINCLUDE =$(PAPARAZZI_HOME)/var/include MESSAGES_H=$(STATICINCLUDE)/messages.h diff --git a/Makefile.ac b/Makefile.ac index 3d04b1aa22..d738526d7f 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -51,7 +51,7 @@ SETTINGS_FILE=$(SETTINGS:settings%=%) #TUNING_FILE=$(subst ,_,$(SETTINGS:settings/%.xml=%)).h TUNING_H=$(AC_GENERATED)/tuning.h SUPERVISION=./paparazzi -MAKE=make PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) +MAKE:=$(MAKE) PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) MODULES_H=$(AC_GENERATED)/modules.h AIRCRAFT_MD5=$(AIRCRAFT_CONF_DIR)/aircraft.md5 @@ -138,7 +138,7 @@ $(MODULES_H) : $(CONF)/$(AIRFRAME_XML) $(TOOLS)/gen_modules.out $(CONF)/modules/ $(SETTINGS_MODULES) : $(MODULES_H) %.ac_h : $(TOOLS)/gen_aircraft.out - $(Q)if (expr "$(AIRCRAFT)"); then : ; else echo "AIRCRAFT undefined: type 'make AIRCRAFT=AircraftName ...'"; exit 1; fi + $(Q)if (expr "$(AIRCRAFT)"); then : ; else echo "AIRCRAFT undefined: type '$(MAKE) AIRCRAFT=AircraftName ...'"; exit 1; fi @echo BUILD $(AIRCRAFT), TARGET $* +$(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) TARGET=$* Q=$(Q) $(TOOLS)/gen_aircraft.out $(AIRCRAFT) @@ -187,5 +187,5 @@ check_fuses_fbw: fbw.check_fuses hard_ac ac: ac_h fbw ap clean_ac : - $(Q)if (expr "$(AIRCRAFT)"); then : ; else echo "AIRCRAFT undefined: type 'make AIRCRAFT=AircraftName ...'"; exit 1; fi + $(Q)if (expr "$(AIRCRAFT)"); then : ; else echo "AIRCRAFT undefined: type '$(MAKE) AIRCRAFT=AircraftName ...'"; exit 1; fi rm -fr $(PAPARAZZI_HOME)/var/$(AIRCRAFT) diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile index 3a398196d5..d7b61c5485 100644 --- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -177,7 +177,7 @@ ap_srcs += $(SRC_FIRMWARE)/ap_downlink.c UNAME = $(shell uname -s) ifeq ("$(UNAME)","Darwin") - sim.CFLAGS += -I/opt/paparazzi/include/ -I/opt/local/include/ + sim.CFLAGS += $(shell if test -d /opt/local/include; then echo "-I/opt/local/include"; elif test -d /opt/paparazzi/include; then echo "-I/opt/paparazzi/include"; fi) endif sim.CFLAGS += $(CPPFLAGS) diff --git a/sw/ground_segment/lpc21iap/Makefile b/sw/ground_segment/lpc21iap/Makefile index dc4a954a37..419a2717a3 100644 --- a/sw/ground_segment/lpc21iap/Makefile +++ b/sw/ground_segment/lpc21iap/Makefile @@ -27,12 +27,10 @@ endif UNAME = $(shell uname -s) ifeq ("$(UNAME)","Darwin") - LIBRARYS = -L /opt/paparazzi/lib -L /opt/local/lib - INCLUDES = -I /opt/paparazzi/include -I /opt/local/include/ + LIBRARYS = $(shell if test -d /opt/local/lib; then echo "-L /opt/local/lib"; elif test -d /opt/paparazzi/lib; then echo "-L /opt/paparazzi/lib"; fi) + INCLUDES = $(shell if test -d /opt/local/include; then echo "-I /opt/local/include"; elif test -d /opt/paparazzi/include; then echo "-I /opt/paparazzi/include"; fi) endif - - CFLAGS = -Wall -g $(FPIC) $(INCLUDES) $(LIBRARYS) SOURCES = lpc21iap.c elf.c lpcusb.c diff --git a/sw/ground_segment/misc/Makefile b/sw/ground_segment/misc/Makefile index 7870fe7e62..08572c95ae 100644 --- a/sw/ground_segment/misc/Makefile +++ b/sw/ground_segment/misc/Makefile @@ -1,8 +1,8 @@ UNAME = $(shell uname -s) ifeq ("$(UNAME)","Darwin") - LIBRARYS = -L /opt/paparazzi/lib -L /opt/local/lib - INCLUDES = -I /opt/paparazzi/include -I /opt/local/include/ + LIBRARYS = $(shell if test -d /opt/local/lib; then echo "-L /opt/local/lib"; elif test -d /opt/paparazzi/lib; then echo "-L /opt/paparazzi/lib"; fi) + INCLUDES = $(shell if test -d /opt/local/include; then echo "-I /opt/local/include"; elif test -d /opt/paparazzi/include; then echo "-I /opt/paparazzi/include"; fi) else LIBRARYS = -s endif diff --git a/sw/lib/ocaml/xml2h.ml b/sw/lib/ocaml/xml2h.ml index 0aca62a239..093e42af8a 100644 --- a/sw/lib/ocaml/xml2h.ml +++ b/sw/lib/ocaml/xml2h.ml @@ -77,6 +77,6 @@ let finish = fun h_name -> let warning s = Printf.fprintf stderr "##################################################\n"; - Printf.fprintf stderr "\n %s\n" s; - Printf.fprintf stderr "\n##################################################\n" + Printf.fprintf stderr " %s\n" s; + Printf.fprintf stderr "##################################################\n" diff --git a/sw/supervision/Makefile b/sw/supervision/Makefile index 462de61158..abfa686910 100644 --- a/sw/supervision/Makefile +++ b/sw/supervision/Makefile @@ -4,7 +4,7 @@ Q=@ OCAMLC = ocamlc OCAMLOPT = ocamlopt OCAMLLIB = ../lib/ocaml -INCLUDES= -I $(OCAMLLIB) -I ../multimon $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) +INCLUDES= -I $(OCAMLLIB) $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) LIBPPRZCMA=$(OCAMLLIB)/lib-pprz.cma PAPARAZZICENTERCMO = gtk_pc.cmo gtk_process.cmo pc_common.cmo pc_aircraft.cmo pc_control_panel.cmo paparazzicenter.cmo