simplifly Makefiles a bit, use ?= instead of ifndef

This commit is contained in:
Felix Ruess
2012-09-18 23:14:54 +02:00
parent 7c5e62611d
commit 5cae44e2ea
3 changed files with 8 additions and 15 deletions
+2 -3
View File
@@ -33,9 +33,8 @@ ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
AIRCRAFT_CONF_DIR = $(ACINCLUDE)/conf
AC_GENERATED = $(ACINCLUDE)/generated
ifndef PERIODIC_FREQ
PERIODIC_FREQ = 60
endif
# periodic frequency defaults to 60Hz
PERIODIC_FREQ ?= 60
AIRFRAME_H=$(AC_GENERATED)/airframe.h
PERIODIC_H=$(AC_GENERATED)/periodic_telemetry.h
+1 -3
View File
@@ -126,9 +126,7 @@ LDFLAGS +=-T$(LDSCRIPT)
# Settings and variables:
LPC21ISP = lpc21isp
ifndef LPC21ISP_PORT
LPC21ISP_PORT = /dev/ttyS0
endif
LPC21ISP_PORT ?= /dev/ttyS0
LPC21ISP_FLASHFILE = $(OBJDIR)/$(TARGET).hex
# verbose output:
#LPC21ISP_DEBUG = -debug
+5 -9
View File
@@ -45,9 +45,7 @@ OPT = s
#OPT = 0
ifndef $(PYTHON)
PYTHON = $(shell which python)
endif
PYTHON ?= $(shell which python)
ifneq ($(BOARD_SERIAL),)
OOCD_OPTIONS = -c "ft2232_serial $(BOARD_SERIAL)"
@@ -266,11 +264,10 @@ upload: $(OBJDIR)/$(TARGET).hex
-c shutdown
else
# jtag via BMP
ifndef $(BMP_UPLOAD_SCRIPT)
BMP_UPLOAD_SCRIPT = $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_jtag_flash.scr
endif
BMP_UPLOAD_SCRIPT ?= $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_jtag_flash.scr
upload: $(OBJDIR)/$(TARGET).elf
@echo "Assuming luftboot bootloader: $(ASSUMING_LUFTBOOT)"
@echo "Using Black Magic Probe with JTAG"
@echo "Using GDB = $(GDB)"
@echo " BMP\t$<"
@@ -284,10 +281,9 @@ endif
else ifeq ($(FLASH_MODE),SWD)
# only works if BMP_PORT is defined
ifneq ($(BMP_PORT),)
ifndef $(BMP_UPLOAD_SCRIPT)
BMP_UPLOAD_SCRIPT = $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_swd_flash.scr
endif
BMP_UPLOAD_SCRIPT ?= $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_swd_flash.scr
upload: $(OBJDIR)/$(TARGET).elf
@echo "Assuming luftboot bootloader: $(ASSUMING_LUFTBOOT)"
@echo "Using Black Magic Probe with SWD"
@echo "Using GDB = $(GDB)"
@echo " BMP\t$<"