Skip to content

Commit

Permalink
makefile: add bootstrap-dist-arm target
Browse files Browse the repository at this point in the history
The bootstrap-dist-arm target works like bootstrap-dist but
only builds for ARM/AARCH64 targets.  This is convenient
when porting and creating source bootstrap that may have
different build options (requirements) than what has been built
historically.

example:
  make bootstrap-dist-arm DEFAULT_CPUTTYPE_ARM=FB_CPUTYPE_ARMV7A_FP ...
  • Loading branch information
jayrm committed Dec 28, 2023
1 parent 661c5fc commit ec23f93
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -13,6 +13,7 @@ fbc: BUILD_FB_DEFAULT_CPUTYPE_X86 to set FB_DEFAULT_CPUTYPE_X86 in source code;
makefile: DEFAULT_CPUTYPE_ARM build option to set the default ARM cpu; if given sets BUILD_FB_DEFAULT_CPUTYPE_ARM compiler configration option
makefile: add BUILD_FB_DEFAULT_CPUTYPE_ARM to BOOTFBCFLAGS
fbc: BUILD_FB_DEFAULT_CPUTYPE_ARM to set FB_DEFAULT_CPUTYPE_ARM in source code; if not given then default is FB_CPUTYPE_ARMV7A
makefile: add bootstrap-dist-arm to make ARM/AARCH64 only bootstrap-source-arm package (convenience for different build requirements and not building every source bootstrap target)

[fixed]

Expand Down
20 changes: 20 additions & 0 deletions makefile
Expand Up @@ -77,6 +77,7 @@
# clean-tests
#
# bootstrap-dist Create source package with precompiled fbc sources
# bootstrap-dist-arm Create source package with precompiled fbc sources for arm and aarach64 only
# bootstrap Build fbc from the precompiled sources (only if precompiled sources exist)
# bootstrap-minimal Build fbc from the precompiled sources (only if precompiled sources exist) with only the minimal features needed to compile another fbc
#
Expand Down Expand Up @@ -1392,6 +1393,25 @@ bootstrap-dist:
tar -cJf "$(FBBOOTSTRAPTITLE).tar.xz" "$(FBBOOTSTRAPTITLE)"
rm -rf "$(FBBOOTSTRAPTITLE)"

FBBOOTSTRAPTITLEARM := $(FBSOURCETITLE)-bootstrap-arm
.PHONY: bootstrap-dist-arm
bootstrap-dist-arm:
# Precompile fbc sources for various targets
rm -rf bootstrap
mkdir -p bootstrap/linux-arm
mkdir -p bootstrap/linux-aarch64
./$(FBC_EXE) src/compiler/*.bas -m fbc -i inc -e -r -v $(BOOTFBCFLAGS) -target linux-arm && mv src/compiler/*.c bootstrap/linux-arm
./$(FBC_EXE) src/compiler/*.bas -m fbc -i inc -e -r -v $(BOOTFBCFLAGS) -target linux-aarch64 && mv src/compiler/*.c bootstrap/linux-aarch64
dos2unix bootstrap/linux-arm/*
dos2unix bootstrap/linux-aarch64/*

# Package FB sources (similar to our "gitdist" command), and add the bootstrap/ directory
# Making a .tar.xz should be good enough for now.
git -c core.autocrlf=false archive --format tar --prefix "$(FBBOOTSTRAPTITLEARM)/" HEAD | tar xf -
mv bootstrap $(FBBOOTSTRAPTITLEARM)
tar -cJf "$(FBBOOTSTRAPTITLEARM).tar.xz" "$(FBBOOTSTRAPTITLEARM)"
rm -rf "$(FBBOOTSTRAPTITLEARM)"

#
# Build the fbc[.exe] binary from the precompiled sources in the bootstrap/
# directory.
Expand Down

0 comments on commit ec23f93

Please sign in to comment.