Makefile: add variable for output directory

pull/840/head
Viktor 2023-06-03 04:37:54 +02:00 committed by viktorxda
parent 8bc07df4f5
commit fa3ee8074b
4 changed files with 15 additions and 10 deletions

View File

@ -200,19 +200,24 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Determine toolchain
run: |
GCC=$(make BOARD=${{matrix.platform}}_lite toolname)
echo GCC=${GCC} >> ${GITHUB_ENV}
- name: Setup ccache - name: Setup ccache
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: /tmp/ccache path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}} key: ${{env.GCC}}
- name: Restore ccache - name: Restore ccache
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
with: with:
path: /tmp/ccache path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}} key: ${{env.GCC}}
- name: Restore download - name: Restore download
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
@ -225,7 +230,7 @@ jobs:
FAMILY=${{matrix.platform}} FAMILY=${{matrix.platform}}
RELEASE=${{matrix.release}} RELEASE=${{matrix.release}}
IMAGES=${GITHUB_WORKSPACE}/output/images IMAGES=${GITHUB_WORKSPACE}/output/images
CONFIG=$(find br-ext-chip-*/configs -name ${FAMILY}_${RELEASE}_defconfig) CONFIG=$(find br-ext-chip-* -name ${FAMILY}_${RELEASE}_defconfig)
export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA}) export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA})
export GIT_BRANCH=${GITHUB_REF_NAME} export GIT_BRANCH=${GITHUB_REF_NAME}

View File

@ -66,7 +66,7 @@ jobs:
- name: Build toolchain - name: Build toolchain
if: env.BUILD if: env.BUILD
run: | run: |
CONFIG=$(find br-ext-chip-*/configs -name ${{matrix.platform}}_lite_defconfig) CONFIG=$(find br-ext-chip-* -name ${{matrix.platform}}_lite_defconfig)
sed -i "s|EXTERNAL=y|EXTERNAL=n|g" ${CONFIG} sed -i "s|EXTERNAL=y|EXTERNAL=n|g" ${CONFIG}
export BR2_DL_DIR=/tmp/download export BR2_DL_DIR=/tmp/download
make BOARD=${CONFIG} br-sdk make BOARD=${CONFIG} br-sdk

View File

@ -1,7 +1,8 @@
BR_VER = 2021.02.12 BR_VER = 2021.02.12
BR_MAKE = $(MAKE) -C buildroot-$(BR_VER) BR2_EXTERNAL=$(PWD)/general O=$(TARGET)
BR_LINK = https://github.com/buildroot/buildroot/archive/refs/tags BR_LINK = https://github.com/buildroot/buildroot/archive/refs/tags
BR_FILE = /tmp/download/buildroot-$(BR_VER).tar.gz BR_FILE = /tmp/buildroot-$(BR_VER).tar.gz
BR_MAKE = $(MAKE) -C buildroot-$(BR_VER) BR2_EXTERNAL=$(PWD)/general O=$(PWD)/output TARGET ?= $(PWD)/output
ifdef BOARD ifdef BOARD
CONFIG = $(shell find br-ext-chip-*/configs -type f | grep -m1 $(BOARD)) CONFIG = $(shell find br-ext-chip-*/configs -type f | grep -m1 $(BOARD))
@ -35,7 +36,6 @@ defconfig: prepare
@$(BR_MAKE) BR2_DEFCONFIG=$(PWD)/$(CONFIG) defconfig @$(BR_MAKE) BR2_DEFCONFIG=$(PWD)/$(CONFIG) defconfig
prepare: prepare:
@mkdir -p /tmp/download
@test -e $(BR_FILE) || wget -c -q $(BR_LINK)/$(BR_VER).tar.gz -O $(BR_FILE) @test -e $(BR_FILE) || wget -c -q $(BR_LINK)/$(BR_VER).tar.gz -O $(BR_FILE)
@test -e buildroot-$(BR_VER) || tar -xf $(BR_FILE) -C $(PWD) @test -e buildroot-$(BR_VER) || tar -xf $(BR_FILE) -C $(PWD)
@ -46,10 +46,10 @@ buildroot-version:
@echo $(BR_VER) @echo $(BR_VER)
clean: clean:
@rm -rf output/target output/.config @rm -rf $(TARGET)/target $(TARGET)/.config
distclean: distclean:
@rm -rf output buildroot-$(BR_VER) $(BR_FILE) @rm -rf buildroot-$(BR_VER) $(BR_FILE) $(TARGET)
info: info:
@echo $(CONFIG): @echo $(CONFIG):

View File

@ -3,7 +3,7 @@ export OPENIPC_MODEL = $(call qstrip,$(BR2_OPENIPC_MODEL))
export OPENIPC_FAMILY = $(call qstrip,$(BR2_OPENIPC_FAMILY)) export OPENIPC_FAMILY = $(call qstrip,$(BR2_OPENIPC_FAMILY))
export OPENIPC_RELEASE = $(call qstrip,$(BR2_OPENIPC_RELEASE)) export OPENIPC_RELEASE = $(call qstrip,$(BR2_OPENIPC_RELEASE))
export BR2_EXTERNAL_VENDOR = $(BR2_EXTERNAL)/../br-ext-chip-$(BR2_OPENIPC_VENDOR) export BR2_EXTERNAL_VENDOR = $(BR2_EXTERNAL)/../br-ext-chip-$(OPENIPC_VENDOR)
OPENIPC_TOOLCHAIN = latest/$(shell $(BR2_EXTERNAL)/scripts/show_toolchains.sh $(BR2_DEFCONFIG)) OPENIPC_TOOLCHAIN = latest/$(shell $(BR2_EXTERNAL)/scripts/show_toolchains.sh $(BR2_DEFCONFIG))
include $(sort $(wildcard $(BR2_EXTERNAL)/package/*/*.mk)) include $(sort $(wildcard $(BR2_EXTERNAL)/package/*/*.mk))