complete makefile rework
This commit is contained in:
parent
aa040652ee
commit
ccd17ba0a1
83
src/Makefile
83
src/Makefile
@ -1,40 +1,41 @@
|
|||||||
#******************************************************************************
|
#******************************************************************************
|
||||||
# CONFIGURE (no spaces!)
|
# CONFIGURE (no spaces!)
|
||||||
# - VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION: e.g 5.0.0 or 5.1.0 (usually
|
|
||||||
# is the same to the SoftDevice if possible)
|
|
||||||
#
|
#
|
||||||
# - SDK_PATH : path to SDK directory
|
# - SDK_PATH : path to SDK directory
|
||||||
# - SRC_PATH : path to src folder
|
# - SRC_PATH : path to src folder
|
||||||
#
|
#
|
||||||
# - SD_NAME : e.g s132, s140
|
# - SD_NAME : e.g s132, s140
|
||||||
# - SD_VERSION : e.g 5.1.0
|
# - SD_VER1, SD_VER2, SD_VER3: SoftDevice version e.g 6.0.0
|
||||||
# - SD_HEX : path to bootloader hex binary
|
# - SD_VER4 : is build number for bootloader
|
||||||
|
# - SD_HEX : to bootloader hex binary
|
||||||
#******************************************************************************
|
#******************************************************************************
|
||||||
VERSION_SINGLEBANK = 1
|
SDK_PATH = ../lib/sdk/components
|
||||||
|
SDK11_PATH = ../lib/sdk11/components
|
||||||
|
|
||||||
VERSION_MAJOR = 6
|
SRC_PATH = .
|
||||||
VERSION_MINOR = 0
|
TUSB_PATH = ../lib/tinyusb/src
|
||||||
VERSION_REVISION = 0
|
|
||||||
|
|
||||||
SDK_PATH = ../lib/sdk/components
|
SD_NAME = s140
|
||||||
SDK11_PATH = ../lib/sdk11/components
|
SD_VER1 = 6
|
||||||
|
SD_VER2 = 0
|
||||||
|
SD_VER3 = 0
|
||||||
|
SD_VER4 = 0
|
||||||
|
SD_VERSION = $(SD_VER1).$(SD_VER2).$(SD_VER3)
|
||||||
|
SD_VERSION_FULL = $(SD_VERSION)r$(SD_VER4)
|
||||||
|
|
||||||
SRC_PATH = .
|
SD_PATH = ../lib/softdevice/$(SD_VERSION)
|
||||||
TUSB_PATH = ../lib/tinyusb/src
|
SD_HEX = $(SD_PATH)/$(SD_NAME)/hex/$(SD_NAME)_nrf52_$(SD_VERSION)_softdevice.hex
|
||||||
|
LINKER_SCRIPT = $(SRC_PATH)/$(SD_NAME)_$(SD_VERSION).ld
|
||||||
|
|
||||||
SD_NAME = s140
|
OUTPUT_FILENAME = $(BOARD)_bootloader
|
||||||
SD_VERSION = 6.0.0
|
BOOT_SD_NAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION_FULL)
|
||||||
|
|
||||||
MK_DIS_FIRMWARE = "$(subst s,S,$(SD_NAME)) $(SD_VERSION), $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)"
|
BETA_DIR = ../bin/$(BOARD)/beta
|
||||||
|
RELEASE_DIR = ../bin/$(BOARD)/$(SD_VERSION)
|
||||||
|
|
||||||
SD_PATH = ../lib/softdevice/$(SD_VERSION)
|
|
||||||
SD_HEX = $(SD_PATH)/$(SD_NAME)/hex/$(SD_NAME)_nrf52_$(SD_VERSION)_softdevice.hex
|
|
||||||
LINKER_SCRIPT = $(SRC_PATH)/$(SD_NAME)_$(SD_VERSION).ld
|
|
||||||
|
|
||||||
BOOT_SD_NAME = $(OUTPUT_FILENAME)_$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)_$(SD_NAME)
|
MK_DIS_FIRMWARE = "$(subst s,S,$(SD_NAME)) $(SD_VERSION_FULL)"
|
||||||
|
|
||||||
BETA_DIR = ../bin/$(BOARD)/beta
|
|
||||||
RELEASE_DIR = ../bin/$(BOARD)/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
|
|
||||||
|
|
||||||
# Select the board to build for.
|
# Select the board to build for.
|
||||||
ifeq ($(BOARD),)
|
ifeq ($(BOARD),)
|
||||||
@ -204,7 +205,7 @@ CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
|
|||||||
CFLAGS += -fno-builtin --short-enums
|
CFLAGS += -fno-builtin --short-enums
|
||||||
|
|
||||||
# Defined Symbol (MACROS)
|
# Defined Symbol (MACROS)
|
||||||
CFLAGS += -DBOOTLOADER_VERSION=0x0$(VERSION_MAJOR)0$(VERSION_MINOR)0$(VERSION_REVISION)0$(VERSION_SINGLEBANK)UL
|
CFLAGS += -DBOOTLOADER_VERSION=0x0$(SD_VER1)0$(SD_VER2)0$(SD_VER3)0$(SD_VER4)UL
|
||||||
CFLAGS += -DNRF52840_XXAA
|
CFLAGS += -DNRF52840_XXAA
|
||||||
CFLAGS += -D__HEAP_SIZE=0
|
CFLAGS += -D__HEAP_SIZE=0
|
||||||
CFLAGS += -DS140
|
CFLAGS += -DS140
|
||||||
@ -252,18 +253,7 @@ ASMFLAGS += -DSWI_DISABLE0
|
|||||||
ASMFLAGS += -DSOFTDEVICE_PRESENT
|
ASMFLAGS += -DSOFTDEVICE_PRESENT
|
||||||
ASMFLAGS += -DFLOAT_ABI_HARD
|
ASMFLAGS += -DFLOAT_ABI_HARD
|
||||||
|
|
||||||
#******************************************************************************
|
|
||||||
# BUILD TARGETS
|
|
||||||
# - BOARD
|
|
||||||
# - V
|
|
||||||
#******************************************************************************
|
|
||||||
|
|
||||||
ifeq ("$(V)","1")
|
|
||||||
$(info CFLAGS $(CFLAGS))
|
|
||||||
$(info )
|
|
||||||
$(info LDFLAGS $(LDFLAGS))
|
|
||||||
$(info )
|
|
||||||
endif
|
|
||||||
|
|
||||||
C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
|
C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
|
||||||
C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
|
C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
|
||||||
@ -278,18 +268,21 @@ vpath %.S $(ASM_PATHS)
|
|||||||
|
|
||||||
OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
|
OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
|
||||||
|
|
||||||
|
#******************************************************************************
|
||||||
|
# BUILD TARGETS
|
||||||
|
#******************************************************************************
|
||||||
|
|
||||||
|
ifeq ("$(V)","1")
|
||||||
|
$(info CFLAGS $(CFLAGS))
|
||||||
|
$(info )
|
||||||
|
$(info LDFLAGS $(LDFLAGS))
|
||||||
|
$(info )
|
||||||
|
endif
|
||||||
|
|
||||||
|
.phony: all clean size flash sd
|
||||||
OUTPUT_FILENAME = $(BOARD)_bootloader
|
|
||||||
|
|
||||||
|
|
||||||
all: $(BUILD)/$(OUTPUT_FILENAME).out size
|
all: $(BUILD)/$(OUTPUT_FILENAME).out size
|
||||||
|
|
||||||
|
|
||||||
######## FLASH tagert #######
|
|
||||||
.phony: flash sd
|
|
||||||
|
|
||||||
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
|
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||||
@echo Flashing: $<
|
@echo Flashing: $<
|
||||||
nrfjprog --program $< --sectoranduicrerase -f nrf52 --reset
|
nrfjprog --program $< --sectoranduicrerase -f nrf52 --reset
|
||||||
@ -300,8 +293,6 @@ sd:
|
|||||||
|
|
||||||
|
|
||||||
## Create build directories
|
## Create build directories
|
||||||
.phony: $(BUILD) clean size
|
|
||||||
|
|
||||||
$(BUILD):
|
$(BUILD):
|
||||||
@$(MK) $@
|
@$(MK) $@
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user