mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 12:23:23 +08:00
simplifly Makefiles a bit, use ?= instead of ifndef
This commit is contained in:
+2
-3
@@ -33,9 +33,8 @@ ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
|||||||
AIRCRAFT_CONF_DIR = $(ACINCLUDE)/conf
|
AIRCRAFT_CONF_DIR = $(ACINCLUDE)/conf
|
||||||
AC_GENERATED = $(ACINCLUDE)/generated
|
AC_GENERATED = $(ACINCLUDE)/generated
|
||||||
|
|
||||||
ifndef PERIODIC_FREQ
|
# periodic frequency defaults to 60Hz
|
||||||
PERIODIC_FREQ = 60
|
PERIODIC_FREQ ?= 60
|
||||||
endif
|
|
||||||
|
|
||||||
AIRFRAME_H=$(AC_GENERATED)/airframe.h
|
AIRFRAME_H=$(AC_GENERATED)/airframe.h
|
||||||
PERIODIC_H=$(AC_GENERATED)/periodic_telemetry.h
|
PERIODIC_H=$(AC_GENERATED)/periodic_telemetry.h
|
||||||
|
|||||||
+1
-3
@@ -126,9 +126,7 @@ LDFLAGS +=-T$(LDSCRIPT)
|
|||||||
|
|
||||||
# Settings and variables:
|
# Settings and variables:
|
||||||
LPC21ISP = lpc21isp
|
LPC21ISP = lpc21isp
|
||||||
ifndef LPC21ISP_PORT
|
LPC21ISP_PORT ?= /dev/ttyS0
|
||||||
LPC21ISP_PORT = /dev/ttyS0
|
|
||||||
endif
|
|
||||||
LPC21ISP_FLASHFILE = $(OBJDIR)/$(TARGET).hex
|
LPC21ISP_FLASHFILE = $(OBJDIR)/$(TARGET).hex
|
||||||
# verbose output:
|
# verbose output:
|
||||||
#LPC21ISP_DEBUG = -debug
|
#LPC21ISP_DEBUG = -debug
|
||||||
|
|||||||
+5
-9
@@ -45,9 +45,7 @@ OPT = s
|
|||||||
#OPT = 0
|
#OPT = 0
|
||||||
|
|
||||||
|
|
||||||
ifndef $(PYTHON)
|
PYTHON ?= $(shell which python)
|
||||||
PYTHON = $(shell which python)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BOARD_SERIAL),)
|
ifneq ($(BOARD_SERIAL),)
|
||||||
OOCD_OPTIONS = -c "ft2232_serial $(BOARD_SERIAL)"
|
OOCD_OPTIONS = -c "ft2232_serial $(BOARD_SERIAL)"
|
||||||
@@ -266,11 +264,10 @@ upload: $(OBJDIR)/$(TARGET).hex
|
|||||||
-c shutdown
|
-c shutdown
|
||||||
else
|
else
|
||||||
# jtag via BMP
|
# jtag via BMP
|
||||||
ifndef $(BMP_UPLOAD_SCRIPT)
|
BMP_UPLOAD_SCRIPT ?= $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_jtag_flash.scr
|
||||||
BMP_UPLOAD_SCRIPT = $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_jtag_flash.scr
|
|
||||||
endif
|
|
||||||
|
|
||||||
upload: $(OBJDIR)/$(TARGET).elf
|
upload: $(OBJDIR)/$(TARGET).elf
|
||||||
|
@echo "Assuming luftboot bootloader: $(ASSUMING_LUFTBOOT)"
|
||||||
@echo "Using Black Magic Probe with JTAG"
|
@echo "Using Black Magic Probe with JTAG"
|
||||||
@echo "Using GDB = $(GDB)"
|
@echo "Using GDB = $(GDB)"
|
||||||
@echo " BMP\t$<"
|
@echo " BMP\t$<"
|
||||||
@@ -284,10 +281,9 @@ endif
|
|||||||
else ifeq ($(FLASH_MODE),SWD)
|
else ifeq ($(FLASH_MODE),SWD)
|
||||||
# only works if BMP_PORT is defined
|
# only works if BMP_PORT is defined
|
||||||
ifneq ($(BMP_PORT),)
|
ifneq ($(BMP_PORT),)
|
||||||
ifndef $(BMP_UPLOAD_SCRIPT)
|
BMP_UPLOAD_SCRIPT ?= $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_swd_flash.scr
|
||||||
BMP_UPLOAD_SCRIPT = $(PAPARAZZI_SRC)/conf/boards/upload_scripts/bmp_swd_flash.scr
|
|
||||||
endif
|
|
||||||
upload: $(OBJDIR)/$(TARGET).elf
|
upload: $(OBJDIR)/$(TARGET).elf
|
||||||
|
@echo "Assuming luftboot bootloader: $(ASSUMING_LUFTBOOT)"
|
||||||
@echo "Using Black Magic Probe with SWD"
|
@echo "Using Black Magic Probe with SWD"
|
||||||
@echo "Using GDB = $(GDB)"
|
@echo "Using GDB = $(GDB)"
|
||||||
@echo " BMP\t$<"
|
@echo " BMP\t$<"
|
||||||
|
|||||||
Reference in New Issue
Block a user