mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
[build system] more makefile cleanup for lpc stuff
- removed usb_lib target, not used anywhere - fix lpc bootloader makefile
This commit is contained in:
@@ -206,7 +206,7 @@ sim: sim_static
|
|||||||
|
|
||||||
# stuff to build and upload the lpc bootloader ...
|
# stuff to build and upload the lpc bootloader ...
|
||||||
include Makefile.lpctools
|
include Makefile.lpctools
|
||||||
lpctools: lpc21iap usb_lib
|
lpctools: lpc21iap
|
||||||
|
|
||||||
commands: paparazzi
|
commands: paparazzi
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -1,23 +1,19 @@
|
|||||||
# Hey Emacs, this is a -*- makefile -*-
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
|
|
||||||
usb_lib:
|
|
||||||
@[ -d sw/airborne/arch/lpc21/lpcusb ] && (cd sw/airborne/arch/lpc21/lpcusb; $(MAKE)) || echo "Not building usb_lib: sw/airborne/arch/lpc21/lpcusb directory missing"
|
|
||||||
|
|
||||||
bl:
|
bl:
|
||||||
cd $(AIRBORNE)/arch/lpc21/test/bootloader; $(MAKE) clean; $(MAKE)
|
cd $(AIRBORNE)/arch/lpc21/test/bootloader; $(MAKE) clean; $(MAKE)
|
||||||
|
|
||||||
BOOTLOADER_DEV=/dev/ttyUSB0
|
BOOTLOADER_DEV ?= /dev/ttyUSB0
|
||||||
upload_bl bl.upload: bl
|
upload_bl bl.upload: bl
|
||||||
lpc21isp -control $(AIRBORNE)/arch/lpc21/test/bootloader/bl.hex $(BOOTLOADER_DEV) 38400 12000
|
lpc21isp -control $(AIRBORNE)/arch/lpc21/test/bootloader/bl.hex $(BOOTLOADER_DEV) 38400 12000
|
||||||
|
|
||||||
JTAG_INTERFACE = olimex-jtag-tiny.cfg
|
JTAG_INTERFACE ?= olimex-jtag-tiny.cfg
|
||||||
#JTAG_INTERFACE = olimex-arm-usb-ocd.cfg
|
#JTAG_INTERFACE = olimex-arm-usb-ocd.cfg
|
||||||
|
|
||||||
upload_jtag: bl
|
upload_jtag: bl
|
||||||
openocd -f interface/$(JTAG_INTERFACE) -f board/olimex_lpc_h2148.cfg -c init -c halt -c "flash write_image erase $(AIRBORNE)/arch/lpc21/test/bootloader/bl.hex" -c reset -c shutdown
|
openocd -f interface/$(JTAG_INTERFACE) -f board/olimex_lpc_h2148.cfg -c init -c halt -c "flash write_image erase $(AIRBORNE)/arch/lpc21/test/bootloader/bl.hex" -c reset -c shutdown
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lpc21iap:
|
lpc21iap:
|
||||||
$(MAKE) -C sw/ground_segment/lpc21iap
|
$(MAKE) -C sw/ground_segment/lpc21iap
|
||||||
|
|
||||||
@@ -32,4 +28,4 @@ ms:
|
|||||||
upload_ms ms.upload: ms
|
upload_ms ms.upload: ms
|
||||||
$(PAPARAZZI_SRC)/sw/ground_segment/lpc21iap/lpc21iap $(AIRBORNE)/arch/lpc21/lpcusb/examples/msc.elf
|
$(PAPARAZZI_SRC)/sw/ground_segment/lpc21iap/lpc21iap $(AIRBORNE)/arch/lpc21/lpcusb/examples/msc.elf
|
||||||
|
|
||||||
.PHONY: usb_lib bl upload_bl upload_jtag ms upload_ms lpc21iap upgrade_bl
|
.PHONY: bl upload_bl upload_jtag ms upload_ms lpc21iap upgrade_bl
|
||||||
|
|||||||
@@ -23,49 +23,7 @@
|
|||||||
# This is the common Makefile for finding the arm compiler and OpenOcd
|
# This is the common Makefile for finding the arm compiler and OpenOcd
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
include $(PAPARAZZI_SRC)/conf/Makefile.arm-toolchain
|
||||||
# try to pick up the compiler from the path
|
|
||||||
#
|
|
||||||
CC = $(shell which arm-none-eabi-gcc)
|
|
||||||
LD = $(shell which arm-none-eabi-gcc)
|
|
||||||
AR = $(shell which arm-none-eabi-ar)
|
|
||||||
CP = $(shell which arm-none-eabi-objcopy)
|
|
||||||
DMP = $(shell which arm-none-eabi-objdump)
|
|
||||||
NM = $(shell which arm-none-eabi-nm)
|
|
||||||
SIZE = $(shell which arm-none-eabi-size)
|
|
||||||
GDB = $(shell which arm-none-eabi-gdb)
|
|
||||||
TOOLCHAIN_DIR=$(shell dirname `which arm-none-eabi-gcc`)
|
|
||||||
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/../arm-none-eabi/lib
|
|
||||||
|
|
||||||
#
|
|
||||||
# if not found in path, try the paparazzi toolchain in /opt
|
|
||||||
#
|
|
||||||
ifeq ($(CC),)
|
|
||||||
TOOLCHAIN=$(shell find -L /opt/paparazzi/arm-multilib -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1)
|
|
||||||
ifneq ($(TOOLCHAIN),)
|
|
||||||
TOOLCHAIN_DIR=$(shell dirname $(TOOLCHAIN))
|
|
||||||
GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin
|
|
||||||
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib
|
|
||||||
|
|
||||||
# Define programs and commands.
|
|
||||||
GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi
|
|
||||||
CC = $(GCC_BIN_PREFIX)-gcc
|
|
||||||
LD = $(GCC_BIN_PREFIX)-gcc
|
|
||||||
AR = $(GCC_BIN_PREFIX)-ar
|
|
||||||
CP = $(GCC_BIN_PREFIX)-objcopy
|
|
||||||
DMP = $(GCC_BIN_PREFIX)-objdump
|
|
||||||
NM = $(GCC_BIN_PREFIX)-nm
|
|
||||||
SIZE = $(GCC_BIN_PREFIX)-size
|
|
||||||
GDB = $(GCC_BIN_PREFIX)-gdb
|
|
||||||
else
|
|
||||||
# toolchain not found...
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# some general commands
|
|
||||||
RM = rm
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# some generic and informative targets
|
# some generic and informative targets
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
|
|
||||||
|
#
|
||||||
|
# This is the common Makefile for finding the arm compiler
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# try to pick up the compiler from the path
|
||||||
|
#
|
||||||
|
CC = $(shell which arm-none-eabi-gcc)
|
||||||
|
LD = $(shell which arm-none-eabi-gcc)
|
||||||
|
AR = $(shell which arm-none-eabi-ar)
|
||||||
|
CP = $(shell which arm-none-eabi-objcopy)
|
||||||
|
DMP = $(shell which arm-none-eabi-objdump)
|
||||||
|
NM = $(shell which arm-none-eabi-nm)
|
||||||
|
SIZE = $(shell which arm-none-eabi-size)
|
||||||
|
GDB = $(shell which arm-none-eabi-gdb)
|
||||||
|
TOOLCHAIN_DIR=$(shell dirname `which arm-none-eabi-gcc`)
|
||||||
|
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/../arm-none-eabi/lib
|
||||||
|
|
||||||
|
#
|
||||||
|
# if not found in path, try the paparazzi toolchain in /opt
|
||||||
|
#
|
||||||
|
ifeq ($(CC),)
|
||||||
|
TOOLCHAIN=$(shell find -L /opt/paparazzi/arm-multilib -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1)
|
||||||
|
ifneq ($(TOOLCHAIN),)
|
||||||
|
TOOLCHAIN_DIR=$(shell dirname $(TOOLCHAIN))
|
||||||
|
GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin
|
||||||
|
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib
|
||||||
|
|
||||||
|
# Define programs and commands.
|
||||||
|
GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi
|
||||||
|
CC = $(GCC_BIN_PREFIX)-gcc
|
||||||
|
LD = $(GCC_BIN_PREFIX)-gcc
|
||||||
|
AR = $(GCC_BIN_PREFIX)-ar
|
||||||
|
CP = $(GCC_BIN_PREFIX)-objcopy
|
||||||
|
DMP = $(GCC_BIN_PREFIX)-objdump
|
||||||
|
NM = $(GCC_BIN_PREFIX)-nm
|
||||||
|
SIZE = $(GCC_BIN_PREFIX)-size
|
||||||
|
GDB = $(GCC_BIN_PREFIX)-gdb
|
||||||
|
else
|
||||||
|
# toolchain not found...
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# some general commands
|
||||||
|
RM = rm
|
||||||
@@ -107,7 +107,6 @@ LDFLAGS += $(MATH_LIB)
|
|||||||
LDFLAGS += -lc -lgcc
|
LDFLAGS += -lc -lgcc
|
||||||
LDFLAGS += $(CPLUSPLUS_LIB)
|
LDFLAGS += $(CPLUSPLUS_LIB)
|
||||||
LDFLAGS += -Wl,--gc-sections
|
LDFLAGS += -Wl,--gc-sections
|
||||||
# -lusbstack -Larm7/lpcusb
|
|
||||||
|
|
||||||
ifndef LDSCRIPT
|
ifndef LDSCRIPT
|
||||||
ifeq ($(FLASH_MODE),ISP)
|
ifeq ($(FLASH_MODE),ISP)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ DATE = $$(date +%Y%m%d)
|
|||||||
#
|
#
|
||||||
# find compiler toolchain
|
# find compiler toolchain
|
||||||
#
|
#
|
||||||
include $(PAPARAZZI_SRC)/conf/Makefile.arm-common
|
include $(PAPARAZZI_SRC)/conf/Makefile.arm-toolchain
|
||||||
|
|
||||||
#
|
#
|
||||||
# if the new arm-none-eabi multilib compiler was not found try the old arm-elf one
|
# if the new arm-none-eabi multilib compiler was not found try the old arm-elf one
|
||||||
@@ -82,6 +82,6 @@ depend: $(LIBSRCS)
|
|||||||
$(Q)$(CC) $(CFLAGS) -MM $^ > .depend || rm -f .depend
|
$(Q)$(CC) $(CFLAGS) -MM $^ > .depend || rm -f .depend
|
||||||
|
|
||||||
# phony targets
|
# phony targets
|
||||||
.PHONY: all clean depend
|
.PHONY: all clean lib dist depend
|
||||||
|
|
||||||
-include .depend
|
-include .depend
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ LINKFILE_RAM = lpc2148-ram.ld
|
|||||||
#
|
#
|
||||||
# try to find the paparazzi multilib toolchain
|
# try to find the paparazzi multilib toolchain
|
||||||
#
|
#
|
||||||
include $(PAPARAZZI_SRC)/conf/Makefile.arm-common
|
include $(PAPARAZZI_SRC)/conf/Makefile.arm-toolchain
|
||||||
|
|
||||||
TAR = tar
|
TAR = tar
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ lib: $(LIBOBJS)
|
|||||||
app: $(APPNAME).elf
|
app: $(APPNAME).elf
|
||||||
$(Q)echo "...copying"
|
$(Q)echo "...copying"
|
||||||
$(CP) $(CPFLAGS) $(APPNAME).elf $(APPNAME).hex
|
$(CP) $(CPFLAGS) $(APPNAME).elf $(APPNAME).hex
|
||||||
$(OD) $(ODFLAGS) $(APPNAME).elf > $(APPNAME).dmp
|
$(DMP) $(ODFLAGS) $(APPNAME).elf > $(APPNAME).dmp
|
||||||
# $(Q)echo "....loading"
|
# $(Q)echo "....loading"
|
||||||
# ./lpc21isp -control bl.hex com4 38400 12000
|
# ./lpc21isp -control bl.hex com4 38400 12000
|
||||||
# ./lpc21isp -control -termonly bl.hex com4 115200 12000
|
# ./lpc21isp -control -termonly bl.hex com4 115200 12000
|
||||||
@@ -57,7 +57,7 @@ app: $(APPNAME).elf
|
|||||||
app_ram: $(APPNAME_RAM).elf
|
app_ram: $(APPNAME_RAM).elf
|
||||||
$(Q)echo "...copying"
|
$(Q)echo "...copying"
|
||||||
$(CP) $(CPFLAGS) $(APPNAME_RAM).elf $(APPNAME_RAM).hex
|
$(CP) $(CPFLAGS) $(APPNAME_RAM).elf $(APPNAME_RAM).hex
|
||||||
$(OD) $(ODFLAGS) $(APPNAME_RAM).elf > $(APPNAME_RAM).dmp
|
$(DMP) $(ODFLAGS) $(APPNAME_RAM).elf > $(APPNAME_RAM).dmp
|
||||||
|
|
||||||
$(APPNAME).elf: $(OBJS) $(LIBNAME).a $(LINKFILE)
|
$(APPNAME).elf: $(OBJS) $(LIBNAME).a $(LINKFILE)
|
||||||
$(Q)echo "..linking"
|
$(Q)echo "..linking"
|
||||||
@@ -81,3 +81,5 @@ dist: clean
|
|||||||
|
|
||||||
# recompile if the Makefile changes
|
# recompile if the Makefile changes
|
||||||
$(OBJS) $(LIBOBJS): Makefile
|
$(OBJS) $(LIBOBJS): Makefile
|
||||||
|
|
||||||
|
.PHONY: all clean lib app app_ram arch dist
|
||||||
|
|||||||
Reference in New Issue
Block a user