Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalandi committed Sep 13, 2024
1 parent b8d2961 commit 15d738c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
############################################################################################
# Defines
############################################################################################

PRJ_NAME = Baremetal_Pico2_dual_core_nosdk
OUTPUT_DIR = ../Output
OBJ_DIR = $(OUTPUT_DIR)/Obj
LD_SCRIPT = $(SRC_DIR)/Memory_Map.ld
PIO_OUT_DIR= $(SRC_DIR)/pio
SRC_DIR = ../Code
CORE_FAMILY_LOWER_CASE = $(shell echo $(CORE_FAMILY) | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z]//g')
PRJ_NAME = $(CORE_FAMILY_LOWER_CASE)_baremetal_pico2_dual_core_nosdk
OUTPUT_DIR = ../Output
OBJ_DIR = $(OUTPUT_DIR)/$(CORE_FAMILY_LOWER_CASE)_obj
LD_SCRIPT = $(SRC_DIR)/Memory_Map.ld
PIO_OUT_DIR = $(SRC_DIR)/pio
SRC_DIR = ../Code

ifeq ($(OS),Windows_NT)
PYTHON = python
Expand Down Expand Up @@ -251,21 +251,22 @@ ifeq ($(MAKECMDGOALS),build)
-include $(subst .o,.d,$(FILES_O))
endif

build : PRE_BUILD_INFO PIO_SRC_GEN $(OUTPUT_DIR)/$(PRJ_NAME).elf POST_BUILD_INFO
build : PRE_BUILD PIO_SRC_GEN $(OUTPUT_DIR)/$(PRJ_NAME).elf POST_BUILD

all : PRE_BUILD_INFO PIO_SRC_GEN $(OUTPUT_DIR)/$(PRJ_NAME).elf POST_BUILD_INFO
all : PRE_BUILD PIO_SRC_GEN $(OUTPUT_DIR)/$(PRJ_NAME).elf POST_BUILD

.PHONY : PRE_BUILD_INFO
PRE_BUILD_INFO:
.PHONY : PRE_BUILD
PRE_BUILD:
@$(if $(strip $(PICOTOOL_FAMILY_ID)), ,$(error Error: the Entered CORE_FAMILY is not supported!))
@-echo +++ Building RP2350 baremetal image for $(CORE_FAMILY) core
@git log -n 1 --decorate-refs=refs/heads/ --pretty=format:"+++ Git branch: %D (%h)" 2>/dev/null || true
@git log -n 1 --clear-decorations 2> /dev/null > /dev/null || true
@echo +++ info: "$(shell $(CC) -v 2>&1 | tail -n 1)"
@echo +++ info: "$(shell make -v 2>&1 | head -n 1)"
@$(if $(shell test -d $(OBJ_DIR) && echo yes),,mkdir -p $(subst \,/,$(OBJ_DIR)))

.PHONY : POST_BUILD_INFO
POST_BUILD_INFO:
.PHONY : POST_BUILD
POST_BUILD:
@-echo +++ End

.PHONY : PIO_SRC_GEN
Expand All @@ -283,7 +284,7 @@ clean :
@-rm -rf $(OUTPUT_DIR) *.list 2>/dev/null || true
@-rm -rf $(OUTPUT_DIR) *.map 2>/dev/null || true
@-rm -rf $(OUTPUT_DIR) *.txt 2>/dev/null || true
@-mkdir -p $(subst \,/,$(OBJ_DIR))
@-mkdir -p $(subst \,/,$(OUTPUT_DIR))

$(OBJ_DIR)/%.o : %.c
@-echo +++ compile: $(subst \,/,$<) to $(subst \,/,$@)
Expand Down

0 comments on commit 15d738c

Please sign in to comment.