Skip to content

Commit

Permalink
update build.sh and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Dec 31, 2023
1 parent 038babb commit 0b5fdfd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ clean:
@rm -f $(obj)include/generated/asm-offsets.h
@rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@rm -f uboot_build/*
@$(MAKE) -s -C doc/DocBook/ cleandocs
@$(MAKE) -s -C $(TOPTREE)tools/ingenic-tools/ clean
@find $(OBJTREE) -type f \
Expand Down Expand Up @@ -969,6 +970,7 @@ clobber: tidy
@rm -f $(obj)u-boot-lzo.img
@rm -f $(obj)u-boot-lzo.bin
@rm -f $(obj)u-boot-lzo-with-spl.bin
@rm -rf uboot_build

mrproper \
distclean: clobber unconfig
Expand Down
28 changes: 25 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export ARCH=mips
export CROSS_COMPILE=mipsel-linux-gnu-
#export CCACHE=/usr/bin/ccache

declare -A cfg

Expand Down Expand Up @@ -36,15 +37,36 @@ cfg[t31a]="isvp_t31a_sfcnor_ddr128M"
cfg[t31al]="isvp_t31al_sfcnor_ddr128M"
cfg[t31lc]="isvp_t31lc_sfcnor"

OUTPUTDIR="./uboot_build"

OUTPUTDIR="${HOME}/uboot"
mkdir -p ${OUTPUTDIR} 2>&1 > /dev/null
# Collecting platform names and formatting output
platforms=""
column_count=0
for key in "${!cfg[@]}"; do
platforms+="${cfg[$key]}\t"
((++column_count))
if [ $column_count -eq 1 ]; then
platforms+="\n"
column_count=0
fi
done

echo -e "Building U-Boot 2013.07 on Ingenic XBurst1 for:\n$platforms"

# Start timer
SECONDS=0

# Building process
for soc in "${!cfg[@]}"; do
echo "Building U-Boot for ${soc}"
log=building-${soc}.log; :>$log
make distclean >>$log 2>&1
mkdir -p ${OUTPUTDIR} 2>&1 > /dev/null
make ${cfg[$soc]} >>$log 2>&1
make -j`nproc` >>$log 2>&1
make -j$(nproc) >>$log 2>&1
cp u-boot-lzo-with-spl.bin ${OUTPUTDIR}/u-boot-${soc}-gtxaspec.bin
done

# End timer and report
duration=$SECONDS
echo "Total build time: $(($duration / 60)) minutes and $(($duration % 60)) seconds."

0 comments on commit 0b5fdfd

Please sign in to comment.