Skip to content

Commit

Permalink
Use #!/usr/bin/env bash to find the correct bash path and support gmake
Browse files Browse the repository at this point in the history
  • Loading branch information
drizzt authored and Youness Alaoui committed Oct 19, 2010
1 parent 614cdb6 commit ff363d4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build_hex.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (C) Youness Alaoui (KaKaRoTo)
#
Expand All @@ -25,6 +25,12 @@ for target in ${all_targets}; do
let i++
done

if command -v gmake &>/dev/null; then
MAKE=gmake
else
MAKE=make
fi

mcu[$teensy1]=at90usb162
board[$teensy1]=TEENSY
mhz_clock[$teensy1]=16
Expand Down Expand Up @@ -110,18 +116,18 @@ echo "Building for targets : $targets"

rm -rf psgroove_hex/
mkdir psgroove_hex
make clean_list > /dev/null
$MAKE clean_list > /dev/null

for target in ${targets}; do
for firmware in 3.01 3.10 3.15 3.41 ; do
firmware=${firmware/./_}
low_board=`echo ${board[${!target}]} | awk '{print tolower($0)}'`
filename="psgroove_${low_board}_${mcu[${!target}]}_${mhz_clock[${!target}]}mhz_firmware_${firmware}"
echo "Compiling $filename for ${name[${!target}]}"
make TARGET=$filename MCU=${mcu[${!target}]} BOARD=${board[${!target}]} F_CPU=${mhz_clock[${!target}]}000000 FIRMWARE_VERSION=${firmware} > /dev/null || exit 1
$MAKE TARGET=$filename MCU=${mcu[${!target}]} BOARD=${board[${!target}]} F_CPU=${mhz_clock[${!target}]}000000 FIRMWARE_VERSION=${firmware} > /dev/null || exit 1
mkdir -p "psgroove_hex/${name[${!target}]}"
mv *.hex "psgroove_hex/${name[${!target}]}/"
make clean_list TARGET=$filename > /dev/null
$MAKE clean_list TARGET=$filename > /dev/null
done
done

0 comments on commit ff363d4

Please sign in to comment.