Skip to content

Commit

Permalink
Optimizing makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
xX7 committed Dec 1, 2022
1 parent b183a41 commit 2c79c1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ curPath:=$(abspath .)
srcPath:=$(curPath)/src
imgPath:=$(curPath)/sdcard

all: platform freertos
all: dir platform freertos

dir:
@mkdir -p $(imgPath)

include platform.mk
include freertos.mk
include linux.mk

.PHONY: all
.PHONY: dir all
6 changes: 4 additions & 2 deletions freertos.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
freertos_src:=$(srcPath)/freertos
freertos_dest_image:=$(imgPath)/freertos.bin

freertos $(freertos_dest_image): $(freertos_src)
$(freertos_dest_image): $(freertos_src)
$(MAKE) -C $(freertos_src) PLATFORM=$(PLATFORM)
cp $(freertos_src)/build/$(PLATFORM)/freertos.bin $(freertos_dest_image)
cp $(freertos_src)/build/$(PLATFORM)/freertos.bin $(freertos_dest_image)

freertos: $(freertos_dest_image)
11 changes: 3 additions & 8 deletions platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ firmware_images:=$(curPath)/firmware-rpi

atf_src:=$(srcPath)/arm-trusted-firmware
atf_dest_image:=$(imgPath)/bl31.bin
atf_plat:=PLATFORM
atf_plat:=$(PLATFORM)

uboot_src:=$(srcPath)/u-boot
uboot_defconfig:=rpi_4_defconfig
Expand All @@ -24,14 +24,9 @@ u-boot $(uboot_dest_image): $(uboot_src)
$(firmware_images):
git clone --depth 1 --branch $(firmware_version) $(firmware_repo) $(firmware_images)

sdcardDir:
@mkdir -p $(imgPath)

#instuctions:=$(bao_demos)/platforms/$(PLATFORM)/README.md

platform: sdcardDir $(uboot_dest_image) $(atf_dest_image) $(firmware_images)
platform: $(uboot_dest_image) $(atf_dest_image) $(firmware_images)
# $(call print-instructions, $(instuctions), 1, false)
# $(call print-instructions, $(instuctions), 2, false)
# $(call print-instructions, $(instuctions), 3, true)

.PHONY: sdcardDir
# $(call print-instructions, $(instuctions), 3, true)

0 comments on commit 2c79c1c

Please sign in to comment.