Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Reworking generation of metadata and buildlogs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsfv committed Feb 19, 2021
1 parent 99439a2 commit e67d563
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 228 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ help:
@echo " openocd"
@echo " trace-decoder"
@echo " xc3sprog"
@echo " custom"
@echo " Requires that CUSTOM_GITURL is set."
@echo ""
@echo " CUSTOM_COMMIT can be set for a package to"
@echo " TARGET_BRANCH can be set for a package to"
@echo " override the one in freedom-*.mk files."
@echo ""

# Include Makefiles for all modules (alphabetically)
# Include Makefiles for all modules
include modules/freedom-binutils-metal.mk
include modules/freedom-gcc-metal.mk
include modules/freedom-gdb-metal.mk
Expand Down
46 changes: 27 additions & 19 deletions modules/freedom-binutils-metal.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@

FREEDOM_BINUTILS_METAL_GITURL := https://github.com/sifive/freedom-binutils-metal.git
FREEDOM_BINUTILS_METAL_COMMIT := main
FREEDOM_BINUTILS_METAL_GITURL := [email protected]:sifive/freedom-binutils-metal.git
FREEDOM_BINUTILS_METAL_BRANCH := main
FREEDOM_BINUTILS_METAL_MODULE := $(SRCDIR)/freedom-binutils-metal

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_BINUTILS_METAL_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_BINUTILS_METAL_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_BINUTILS_METAL_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_BINUTILS_METAL := freedom-binutils-metal
SRCPATH_FREEDOM_BINUTILS_METAL := $(SRCDIR)/$(SRCNAME_FREEDOM_BINUTILS_METAL)
ifneq ($(TOOLCHAIN_BINUTILS_GITURL),)
FREEDOM_BINUTILS_METAL_GITURL := $(TOOLCHAIN_BINUTILS_GITURL)
endif
ifneq ($(TOOLCHAIN_BINUTILS_BRANCH),)
FREEDOM_BINUTILS_METAL_BRANCH := $(TOOLCHAIN_BINUTILS_BRANCH)
endif

.PHONY: binutils-metal binutils-metal-package binutils-metal-regress binutils-metal-cleanup binutils-metal-flushup
binutils-metal: binutils-metal-package
Expand All @@ -17,26 +25,26 @@ binutils-only-package: binutils-metal-package
binutils-only-regress: binutils-metal-regress
binutils-only: binutils-metal

$(SRCPATH_FREEDOM_BINUTILS_METAL).$(FREEDOM_BINUTILS_METAL_COMMIT):
$(FREEDOM_BINUTILS_METAL_MODULE).$(FREEDOM_BINUTILS_METAL_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_BINUTILS_METAL)
rm -rf $(SRCPATH_FREEDOM_BINUTILS_METAL).*
git clone $(FREEDOM_BINUTILS_METAL_GITURL) $(SRCPATH_FREEDOM_BINUTILS_METAL) --single-branch -b $(FREEDOM_BINUTILS_METAL_COMMIT)
cd $(SRCPATH_FREEDOM_BINUTILS_METAL) && git submodule update --init --recursive
rm -rf $(FREEDOM_BINUTILS_METAL_MODULE)
rm -rf $(FREEDOM_BINUTILS_METAL_MODULE).*
git clone $(FREEDOM_BINUTILS_METAL_GITURL) $(FREEDOM_BINUTILS_METAL_MODULE) --single-branch -b $(FREEDOM_BINUTILS_METAL_BRANCH)
cd $(FREEDOM_BINUTILS_METAL_MODULE) && git submodule update --init --recursive
date > $@

binutils-metal-package: \
$(SRCPATH_FREEDOM_BINUTILS_METAL).$(FREEDOM_BINUTILS_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_BINUTILS_METAL) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_BINUTILS_METAL_MODULE).$(FREEDOM_BINUTILS_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_BINUTILS_METAL_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

binutils-metal-regress: \
$(SRCPATH_FREEDOM_BINUTILS_METAL).$(FREEDOM_BINUTILS_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_BINUTILS_METAL) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_BINUTILS_METAL_MODULE).$(FREEDOM_BINUTILS_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_BINUTILS_METAL_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

binutils-metal-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_BINUTILS_METAL) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_BINUTILS_METAL).*
rm -rf $(SRCPATH_FREEDOM_BINUTILS_METAL)
$(MAKE) -C $(FREEDOM_BINUTILS_METAL_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_BINUTILS_METAL_MODULE).*
rm -rf $(FREEDOM_BINUTILS_METAL_MODULE)

binutils-metal-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_BINUTILS_METAL) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_BINUTILS_METAL_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
46 changes: 27 additions & 19 deletions modules/freedom-gcc-metal.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@

FREEDOM_GCC_METAL_GITURL := https://github.com/sifive/freedom-gcc-metal.git
FREEDOM_GCC_METAL_COMMIT := main
FREEDOM_GCC_METAL_GITURL := [email protected]:sifive/freedom-gcc-metal.git
FREEDOM_GCC_METAL_BRANCH := main
FREEDOM_GCC_METAL_MODULE := $(SRCDIR)/freedom-gcc-metal

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_GCC_METAL_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_GCC_METAL_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_GCC_METAL_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_GCC_METAL := freedom-gcc-metal
SRCPATH_FREEDOM_GCC_METAL := $(SRCDIR)/$(SRCNAME_FREEDOM_GCC_METAL)
ifneq ($(TOOLCHAIN_GCC_GITURL),)
FREEDOM_GCC_METAL_GITURL := $(TOOLCHAIN_GCC_GITURL)
endif
ifneq ($(TOOLCHAIN_GCC_BRANCH),)
FREEDOM_GCC_METAL_BRANCH := $(TOOLCHAIN_GCC_BRANCH)
endif

.PHONY: gcc-metal gcc-metal-package gcc-metal-regress gcc-metal-cleanup gcc-metal-flushup
gcc-metal: gcc-metal-package
Expand All @@ -17,26 +25,26 @@ gcc-only-package: gcc-metal-package
gcc-only-regress: gcc-metal-regress
gcc-only: gcc-metal

$(SRCPATH_FREEDOM_GCC_METAL).$(FREEDOM_GCC_METAL_COMMIT):
$(FREEDOM_GCC_METAL_MODULE).$(FREEDOM_GCC_METAL_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_GCC_METAL)
rm -rf $(SRCPATH_FREEDOM_GCC_METAL).*
git clone $(FREEDOM_GCC_METAL_GITURL) $(SRCPATH_FREEDOM_GCC_METAL) --single-branch -b $(FREEDOM_GCC_METAL_COMMIT)
cd $(SRCPATH_FREEDOM_GCC_METAL) && git submodule update --init --recursive
rm -rf $(FREEDOM_GCC_METAL_MODULE)
rm -rf $(FREEDOM_GCC_METAL_MODULE).*
git clone $(FREEDOM_GCC_METAL_GITURL) $(FREEDOM_GCC_METAL_MODULE) --single-branch -b $(FREEDOM_GCC_METAL_BRANCH)
cd $(FREEDOM_GCC_METAL_MODULE) && git submodule update --init --recursive
date > $@

gcc-metal-package: \
$(SRCPATH_FREEDOM_GCC_METAL).$(FREEDOM_GCC_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_GCC_METAL) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_GCC_METAL_MODULE).$(FREEDOM_GCC_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_GCC_METAL_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

gcc-metal-regress: \
$(SRCPATH_FREEDOM_GCC_METAL).$(FREEDOM_GCC_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_GCC_METAL) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_GCC_METAL_MODULE).$(FREEDOM_GCC_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_GCC_METAL_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

gcc-metal-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_GCC_METAL) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_GCC_METAL).*
rm -rf $(SRCPATH_FREEDOM_GCC_METAL)
$(MAKE) -C $(FREEDOM_GCC_METAL_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_GCC_METAL_MODULE).*
rm -rf $(FREEDOM_GCC_METAL_MODULE)

gcc-metal-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_GCC_METAL) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_GCC_METAL_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
46 changes: 27 additions & 19 deletions modules/freedom-gdb-metal.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@

FREEDOM_GDB_METAL_GITURL := https://github.com/sifive/freedom-gdb-metal.git
FREEDOM_GDB_METAL_COMMIT := main
FREEDOM_GDB_METAL_GITURL := [email protected]:sifive/freedom-gdb-metal.git
FREEDOM_GDB_METAL_BRANCH := main
FREEDOM_GDB_METAL_MODULE := $(SRCDIR)/freedom-gdb-metal

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_GDB_METAL_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_GDB_METAL_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_GDB_METAL_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_GDB_METAL := freedom-gdb-metal
SRCPATH_FREEDOM_GDB_METAL := $(SRCDIR)/$(SRCNAME_FREEDOM_GDB_METAL)
ifneq ($(TOOLCHAIN_GDB_GITURL),)
FREEDOM_GDB_METAL_GITURL := $(TOOLCHAIN_GDB_GITURL)
endif
ifneq ($(TOOLCHAIN_GDB_BRANCH),)
FREEDOM_GDB_METAL_BRANCH := $(TOOLCHAIN_GDB_BRANCH)
endif

.PHONY: gdb-metal gdb-metal-package gdb-metal-regress gdb-metal-cleanup gdb-metal-flushup
gdb-metal: gdb-metal-package
Expand All @@ -17,26 +25,26 @@ gdb-only-package: gdb-metal-package
gdb-only-regress: gdb-metal-regress
gdb-only: gdb-metal

$(SRCPATH_FREEDOM_GDB_METAL).$(FREEDOM_GDB_METAL_COMMIT):
$(FREEDOM_GDB_METAL_MODULE).$(FREEDOM_GDB_METAL_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_GDB_METAL)
rm -rf $(SRCPATH_FREEDOM_GDB_METAL).*
git clone $(FREEDOM_GDB_METAL_GITURL) $(SRCPATH_FREEDOM_GDB_METAL) --single-branch -b $(FREEDOM_GDB_METAL_COMMIT)
cd $(SRCPATH_FREEDOM_GDB_METAL) && git submodule update --init --recursive
rm -rf $(FREEDOM_GDB_METAL_MODULE)
rm -rf $(FREEDOM_GDB_METAL_MODULE).*
git clone $(FREEDOM_GDB_METAL_GITURL) $(FREEDOM_GDB_METAL_MODULE) --single-branch -b $(FREEDOM_GDB_METAL_BRANCH)
cd $(FREEDOM_GDB_METAL_MODULE) && git submodule update --init --recursive
date > $@

gdb-metal-package: \
$(SRCPATH_FREEDOM_GDB_METAL).$(FREEDOM_GDB_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_GDB_METAL) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_GDB_METAL_MODULE).$(FREEDOM_GDB_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_GDB_METAL_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

gdb-metal-regress: \
$(SRCPATH_FREEDOM_GDB_METAL).$(FREEDOM_GDB_METAL_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_GDB_METAL) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_GDB_METAL_MODULE).$(FREEDOM_GDB_METAL_BRANCH)
$(MAKE) -C $(FREEDOM_GDB_METAL_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

gdb-metal-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_GDB_METAL) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_GDB_METAL).*
rm -rf $(SRCPATH_FREEDOM_GDB_METAL)
$(MAKE) -C $(FREEDOM_GDB_METAL_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_GDB_METAL_MODULE).*
rm -rf $(FREEDOM_GDB_METAL_MODULE)

gdb-metal-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_GDB_METAL) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_GDB_METAL_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
41 changes: 21 additions & 20 deletions modules/freedom-openocd.mk
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@

FREEDOM_OPENOCD_GITURL := https://github.com/sifive/freedom-openocd.git
FREEDOM_OPENOCD_COMMIT := main
FREEDOM_OPENOCD_GITURL := [email protected]:sifive/freedom-openocd.git
FREEDOM_OPENOCD_BRANCH := main
FREEDOM_OPENOCD_MODULE := $(SRCDIR)/freedom-openocd

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_OPENOCD_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_OPENOCD_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_OPENOCD_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_OPENOCD := freedom-openocd
SRCPATH_FREEDOM_OPENOCD := $(SRCDIR)/$(SRCNAME_FREEDOM_OPENOCD)

.PHONY: openocd openocd-package openocd-regress openocd-cleanup openocd-flushup
openocd: openocd-package

$(SRCPATH_FREEDOM_OPENOCD).$(FREEDOM_OPENOCD_COMMIT):
$(FREEDOM_OPENOCD_MODULE).$(FREEDOM_OPENOCD_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_OPENOCD)
rm -rf $(SRCPATH_FREEDOM_OPENOCD).*
git clone $(FREEDOM_OPENOCD_GITURL) $(SRCPATH_FREEDOM_OPENOCD) --single-branch -b $(FREEDOM_OPENOCD_COMMIT)
cd $(SRCPATH_FREEDOM_OPENOCD) && git submodule update --init --recursive
rm -rf $(FREEDOM_OPENOCD_MODULE)
rm -rf $(FREEDOM_OPENOCD_MODULE).*
git clone $(FREEDOM_OPENOCD_GITURL) $(FREEDOM_OPENOCD_MODULE) --single-branch -b $(FREEDOM_OPENOCD_BRANCH)
cd $(FREEDOM_OPENOCD_MODULE) && git submodule update --init --recursive
date > $@

openocd-package: \
$(SRCPATH_FREEDOM_OPENOCD).$(FREEDOM_OPENOCD_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_OPENOCD) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_OPENOCD_MODULE).$(FREEDOM_OPENOCD_BRANCH)
$(MAKE) -C $(FREEDOM_OPENOCD_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

openocd-regress: \
$(SRCPATH_FREEDOM_OPENOCD).$(FREEDOM_OPENOCD_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_OPENOCD) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_OPENOCD_MODULE).$(FREEDOM_OPENOCD_BRANCH)
$(MAKE) -C $(FREEDOM_OPENOCD_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

openocd-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_OPENOCD) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_OPENOCD).*
rm -rf $(SRCPATH_FREEDOM_OPENOCD)
$(MAKE) -C $(FREEDOM_OPENOCD_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_OPENOCD_MODULE).*
rm -rf $(FREEDOM_OPENOCD_MODULE)

openocd-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_OPENOCD) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_OPENOCD_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
41 changes: 21 additions & 20 deletions modules/freedom-qemu.mk
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@

FREEDOM_QEMU_GITURL := https://github.com/sifive/freedom-qemu.git
FREEDOM_QEMU_COMMIT := main
FREEDOM_QEMU_GITURL := [email protected]:sifive/freedom-qemu.git
FREEDOM_QEMU_BRANCH := main
FREEDOM_QEMU_MODULE := $(SRCDIR)/freedom-qemu

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_QEMU_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_QEMU_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_QEMU_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_QEMU := freedom-qemu
SRCPATH_FREEDOM_QEMU := $(SRCDIR)/$(SRCNAME_FREEDOM_QEMU)

.PHONY: qemu qemu-package qemu-regress qemu-cleanup qemu-flushup
qemu: qemu-package

$(SRCPATH_FREEDOM_QEMU).$(FREEDOM_QEMU_COMMIT):
$(FREEDOM_QEMU_MODULE).$(FREEDOM_QEMU_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_QEMU)
rm -rf $(SRCPATH_FREEDOM_QEMU).*
git clone $(FREEDOM_QEMU_GITURL) $(SRCPATH_FREEDOM_QEMU) --single-branch -b $(FREEDOM_QEMU_COMMIT)
cd $(SRCPATH_FREEDOM_QEMU) && git submodule update --init --recursive
rm -rf $(FREEDOM_QEMU_MODULE)
rm -rf $(FREEDOM_QEMU_MODULE).*
git clone $(FREEDOM_QEMU_GITURL) $(FREEDOM_QEMU_MODULE) --single-branch -b $(FREEDOM_QEMU_BRANCH)
cd $(FREEDOM_QEMU_MODULE) && git submodule update --init --recursive
date > $@

qemu-package: \
$(SRCPATH_FREEDOM_QEMU).$(FREEDOM_QEMU_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_QEMU) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_QEMU_MODULE).$(FREEDOM_QEMU_BRANCH)
$(MAKE) -C $(FREEDOM_QEMU_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

qemu-regress: \
$(SRCPATH_FREEDOM_QEMU).$(FREEDOM_QEMU_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_QEMU) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_QEMU_MODULE).$(FREEDOM_QEMU_BRANCH)
$(MAKE) -C $(FREEDOM_QEMU_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

qemu-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_QEMU) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_QEMU).*
rm -rf $(SRCPATH_FREEDOM_QEMU)
$(MAKE) -C $(FREEDOM_QEMU_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_QEMU_MODULE).*
rm -rf $(FREEDOM_QEMU_MODULE)

qemu-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_QEMU) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_QEMU_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
41 changes: 21 additions & 20 deletions modules/freedom-sdk-utilities.mk
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@

FREEDOM_SDK_UTILITIES_GITURL := https://github.com/sifive/freedom-sdk-utilities.git
FREEDOM_SDK_UTILITIES_COMMIT := main
FREEDOM_SDK_UTILITIES_GITURL := [email protected]:sifive/freedom-sdk-utilities.git
FREEDOM_SDK_UTILITIES_BRANCH := main
FREEDOM_SDK_UTILITIES_MODULE := $(SRCDIR)/freedom-sdk-utilities

ifneq ($(CUSTOM_COMMIT),)
FREEDOM_SDK_UTILITIES_COMMIT := $(CUSTOM_COMMIT)
ifneq ($(TARGET_GITURL),)
FREEDOM_SDK_UTILITIES_GITURL := $(TARGET_GITURL)
endif
ifneq ($(TARGET_BRANCH),)
FREEDOM_SDK_UTILITIES_BRANCH := $(TARGET_BRANCH)
endif

SRCNAME_FREEDOM_SDK_UTILITIES := freedom-sdk-utilities
SRCPATH_FREEDOM_SDK_UTILITIES := $(SRCDIR)/$(SRCNAME_FREEDOM_SDK_UTILITIES)

.PHONY: sdk-utilities sdk-utilities-package sdk-utilities-regress sdk-utilities-cleanup sdk-utilities-flushup
sdk-utilities: sdk-utilities-package

$(SRCPATH_FREEDOM_SDK_UTILITIES).$(FREEDOM_SDK_UTILITIES_COMMIT):
$(FREEDOM_SDK_UTILITIES_MODULE).$(FREEDOM_SDK_UTILITIES_BRANCH):
mkdir -p $(dir $@)
rm -rf $(SRCPATH_FREEDOM_SDK_UTILITIES)
rm -rf $(SRCPATH_FREEDOM_SDK_UTILITIES).*
git clone $(FREEDOM_SDK_UTILITIES_GITURL) $(SRCPATH_FREEDOM_SDK_UTILITIES) --single-branch -b $(FREEDOM_SDK_UTILITIES_COMMIT)
cd $(SRCPATH_FREEDOM_SDK_UTILITIES) && git submodule update --init --recursive
rm -rf $(FREEDOM_SDK_UTILITIES_MODULE)
rm -rf $(FREEDOM_SDK_UTILITIES_MODULE).*
git clone $(FREEDOM_SDK_UTILITIES_GITURL) $(FREEDOM_SDK_UTILITIES_MODULE) --single-branch -b $(FREEDOM_SDK_UTILITIES_BRANCH)
cd $(FREEDOM_SDK_UTILITIES_MODULE) && git submodule update --init --recursive
date > $@

sdk-utilities-package: \
$(SRCPATH_FREEDOM_SDK_UTILITIES).$(FREEDOM_SDK_UTILITIES_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_SDK_UTILITIES) package POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_SDK_UTILITIES_MODULE).$(FREEDOM_SDK_UTILITIES_BRANCH)
$(MAKE) -C $(FREEDOM_SDK_UTILITIES_MODULE) package BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

sdk-utilities-regress: \
$(SRCPATH_FREEDOM_SDK_UTILITIES).$(FREEDOM_SDK_UTILITIES_COMMIT)
$(MAKE) -C $(SRCPATH_FREEDOM_SDK_UTILITIES) regress POSTFIXPATH=$(abspath $(POSTFIXPATH))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)
$(FREEDOM_SDK_UTILITIES_MODULE).$(FREEDOM_SDK_UTILITIES_BRANCH)
$(MAKE) -C $(FREEDOM_SDK_UTILITIES_MODULE) regress BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/ EXTRA_OPTION=$(EXTRA_OPTION) EXTRA_SUFFIX=$(EXTRA_SUFFIX)

sdk-utilities-cleanup:
$(MAKE) -C $(SRCPATH_FREEDOM_SDK_UTILITIES) cleanup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
rm -rf $(SRCPATH_FREEDOM_SDK_UTILITIES).*
rm -rf $(SRCPATH_FREEDOM_SDK_UTILITIES)
$(MAKE) -C $(FREEDOM_SDK_UTILITIES_MODULE) cleanup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
rm -rf $(FREEDOM_SDK_UTILITIES_MODULE).*
rm -rf $(FREEDOM_SDK_UTILITIES_MODULE)

sdk-utilities-flushup:
$(MAKE) -C $(SRCPATH_FREEDOM_SDK_UTILITIES) flushup POSTFIXPATH=$(abspath $(POSTFIXPATH))/
$(MAKE) -C $(FREEDOM_SDK_UTILITIES_MODULE) flushup BINDIR_PREFIX=$(abspath $(BINDIR_PREFIX))/ OBJDIR_PREFIX=$(abspath $(OBJDIR_PREFIX))/
Loading

0 comments on commit e67d563

Please sign in to comment.