first
This commit is contained in:
commit
60ece440f6
553 changed files with 361616 additions and 0 deletions
8
buildroot/bin/build_marlin
Normal file
8
buildroot/bin/build_marlin
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
case "$#" in
|
||||
0 ) BOARD=arduino:avr:mega:cpu=atmega2560 ;;
|
||||
* ) BOARD=arduino:avr:$1 ;;
|
||||
esac
|
||||
|
||||
arduino --verify --board $BOARD Marlin/Marlin.ino
|
4
buildroot/bin/build_marlin_fail
Normal file
4
buildroot/bin/build_marlin_fail
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
build_marlin $@ && exit 0
|
||||
exit 1
|
55
buildroot/bin/generate_version_header_for_marlin
Normal file
55
buildroot/bin/generate_version_header_for_marlin
Normal file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env bash
|
||||
# generate_version_header_for_marlin
|
||||
|
||||
DIR="${1}"
|
||||
|
||||
BUILDATE=$(date '+%s')
|
||||
DISTDATE=$(date '+%Y-%m-%d %H:%M')
|
||||
|
||||
BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD)
|
||||
VERSION=$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null)
|
||||
|
||||
if [ -z "${BRANCH}" ]; then
|
||||
BRANCH=$(echo "${TRAVIS_BRANCH}")
|
||||
fi
|
||||
|
||||
if [ -z "${VERSION}" ]; then
|
||||
VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
|
||||
fi
|
||||
|
||||
SHORT_BUILD_VERSION=$(echo "${BRANCH}")
|
||||
DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")
|
||||
|
||||
# Gets some misc options from their defaults
|
||||
DEFAULT_MACHINE_UUID=$(awk -F'"' \
|
||||
'/#define DEFAULT_MACHINE_UUID/{ print $2 }' < "${DIR}/Version.h")
|
||||
MACHINE_NAME=$(awk -F'"' \
|
||||
'/#define MACHINE_NAME/{ print $2 }' < "${DIR}/Version.h")
|
||||
PROTOCOL_VERSION=$(awk -F'"' \
|
||||
'/#define PROTOCOL_VERSION/{ print $2 }' < "${DIR}/Version.h")
|
||||
SOURCE_CODE_URL=$(awk -F'"' \
|
||||
'/#define SOURCE_CODE_URL/{ print $2 }' < "${DIR}/Version.h")
|
||||
WEBSITE_URL=$(awk -F'"' \
|
||||
'/#define WEBSITE_URL/{ print $2 }' < "${DIR}/Version.h")
|
||||
|
||||
cat > "${DIR}/_Version.h" <<EOF
|
||||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED DO NOT MANUALLY EDIT IT.
|
||||
* IT DOES NOT GET COMMITTED TO THE REPOSITORY.
|
||||
*
|
||||
* Branch: ${BRANCH}
|
||||
* Version: ${VERSION}
|
||||
*/
|
||||
|
||||
#define BUILD_UNIX_DATETIME "${BUILDATE}"
|
||||
#define STRING_DISTRIBUTION_DATE "${DISTDATE}"
|
||||
|
||||
#define SHORT_BUILD_VERSION "${SHORT_BUILD_VERSION}"
|
||||
#define DETAILED_BUILD_VERSION "${DETAILED_BUILD_VERSION}"
|
||||
|
||||
#define PROTOCOL_VERSION "${PROTOCOL_VERSION}"
|
||||
#define MACHINE_NAME "${MACHINE_NAME}"
|
||||
#define SOURCE_CODE_URL "${SOURCE_CODE_URL}"
|
||||
#define DEFAULT_MACHINE_UUID "${DEFAULT_MACHINE_UUID}"
|
||||
#define WEBSITE_URL "${WEBSITE_URL}"
|
||||
EOF
|
3
buildroot/bin/opt_add
Normal file
3
buildroot/bin/opt_add
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
eval "echo \"#define ${1} ${2}\" >>Marlin/Configuration.h"
|
3
buildroot/bin/opt_add_adv
Normal file
3
buildroot/bin/opt_add_adv
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
eval "echo \"#define ${1} ${2}\" >>Marlin/Configuration_adv.h"
|
7
buildroot/bin/opt_disable
Normal file
7
buildroot/bin/opt_disable
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h"
|
||||
done
|
7
buildroot/bin/opt_disable_adv
Normal file
7
buildroot/bin/opt_disable_adv
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h"
|
||||
done
|
7
buildroot/bin/opt_enable
Normal file
7
buildroot/bin/opt_enable
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h"
|
||||
done
|
7
buildroot/bin/opt_enable_adv
Normal file
7
buildroot/bin/opt_enable_adv
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h"
|
||||
done
|
5
buildroot/bin/opt_set
Normal file
5
buildroot/bin/opt_set
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
eval "${SED} -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration.h"
|
5
buildroot/bin/opt_set_adv
Normal file
5
buildroot/bin/opt_set_adv
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
eval "${SED} -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h"
|
5
buildroot/bin/pins_set
Normal file
5
buildroot/bin/pins_set
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SED=$(which gsed || which sed)
|
||||
|
||||
eval "${SED} -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/src/pins/pins_${1}.h"
|
9
buildroot/bin/restore_configs
Normal file
9
buildroot/bin/restore_configs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cp Marlin/Configuration.h.backup Marlin/Configuration.h
|
||||
cp Marlin/Configuration_adv.h.backup Marlin/Configuration_adv.h
|
||||
cp Marlin/pins_RAMPS.h.backup Marlin/pins_RAMPS.h
|
||||
|
||||
if [ -f Marlin/_Bootscreen.h ]; then
|
||||
rm Marlin/_Bootscreen.h
|
||||
fi
|
47
buildroot/bin/travis_at_home
Normal file
47
buildroot/bin/travis_at_home
Normal file
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# travis_at_home
|
||||
#
|
||||
# Run all Travis test builds at home to save time finding typos
|
||||
# Make sure to have 'arduino' somewhere in your PATH
|
||||
#
|
||||
|
||||
LOG="travis-out.txt"
|
||||
|
||||
cd `dirname "$0"`/../..
|
||||
|
||||
TRAVIS_BUILD_DIR=`pwd`
|
||||
echo $'Tests for '$TRAVIS_BUILD_DIR$' ...\n' >"$LOG"
|
||||
|
||||
# Add a temporary execution PATH
|
||||
export PATH="./buildroot/bin:$PATH"
|
||||
|
||||
# Scan .travis.yml and run config/build commands only
|
||||
X=1
|
||||
while read P; do
|
||||
|
||||
# Command lines start with a hyphen
|
||||
if [[ $P =~ ^-\ (([^ ]+)(\ .*)?)$ ]]; then
|
||||
WORD="${BASH_REMATCH[2]}" ; # The first word
|
||||
CMD="${BASH_REMATCH[1]}" ; # The whole command
|
||||
RUN=1 ; BUILD=0
|
||||
case "$WORD" in
|
||||
cp|opt_*|pins_*|use_*|restore_*|gen*) ;;
|
||||
build_*) BUILD=1 ;;
|
||||
*) RUN=0 ;;
|
||||
esac
|
||||
|
||||
# Runnable command
|
||||
if [[ $RUN == 1 ]]; then
|
||||
echo "$CMD" >>"$LOG"
|
||||
RESULT=$( eval "$CMD >>\"$LOG\" 2>&1" )
|
||||
if [[ $BUILD == 1 ]]; then
|
||||
echo "--- Build $X done."
|
||||
echo >>"$LOG"
|
||||
X=$((X+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done <.travis.yml
|
||||
|
||||
cd - >/dev/null
|
9
buildroot/bin/use_example_configs
Normal file
9
buildroot/bin/use_example_configs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
restore_configs
|
||||
|
||||
cp Marlin/example_configurations/"$@"/Configuration* Marlin/
|
||||
|
||||
if [ -f "Marlin/example_configurations/$@/_Bootscreen.h" ]; then
|
||||
cp "Marlin/example_configurations/$@/_Bootscreen.h" Marlin/
|
||||
fi
|
Reference in a new issue