Cleanup of the buildroot
This commit is contained in:
3
buildroot/bin/build_marlin
Normal file
3
buildroot/bin/build_marlin
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
arduino --verify --board arduino:avr:mega:cpu=atmega2560 Marlin/Marlin.ino
|
52
buildroot/bin/generate_version_header_for_marlin
Normal file
52
buildroot/bin/generate_version_header_for_marlin
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
# generate_version_header_for_marlin
|
||||
|
||||
DIR="$1"
|
||||
OUTFILE="$2"
|
||||
|
||||
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)
|
||||
|
||||
# Voodoo version tag generator
|
||||
if [ -z "${VERSION}" ]; then
|
||||
VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
|
||||
SHORT_BUILD_VERSION=$(echo "${VERSION}" | sed "s/-.*/${BRANCH}/")
|
||||
DETAILED_BUILD_VERSION=$(echo "${VERSION}" | sed "s/-/${BRANCH}-/")
|
||||
else
|
||||
SHORT_BUILD_VERSION=$(echo "${BRANCH}")
|
||||
DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")
|
||||
fi
|
||||
|
||||
# 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 > "$OUTFILE" <<EOF
|
||||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED DO NOT MANUALLY EDIT IT.
|
||||
* IT DOES NOT GET COMMITTED TO THE REPOSITORY.
|
||||
*/
|
||||
|
||||
#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
|
5
buildroot/bin/opt_disable
Normal file
5
buildroot/bin/opt_disable
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "sed -i 's/\(\/\/ *\)*\(\#define *$opt\)/\/\/\2/g' Marlin/Configuration.h"
|
||||
done
|
5
buildroot/bin/opt_enable
Normal file
5
buildroot/bin/opt_enable
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "sed -i 's/\/\/ *\(#define *$opt\)/\1/g' Marlin/Configuration.h"
|
||||
done
|
5
buildroot/bin/opt_enable_adv
Normal file
5
buildroot/bin/opt_enable_adv
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for opt in "$@" ; do
|
||||
eval "sed -i 's/\/\/ *\(#define *$opt\)/\1/g' Marlin/Configuration_adv.h"
|
||||
done
|
3
buildroot/bin/opt_set
Normal file
3
buildroot/bin/opt_set
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval "sed -i 's/\(#define *$1\) *.*$/\1 $2/g' Marlin/Configuration.h"
|
3
buildroot/bin/opt_set_adv
Normal file
3
buildroot/bin/opt_set_adv
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval "sed -i 's/\(#define *$1\) *.*$/\1 $2/g' Marlin/Configuration_adv.h"
|
3
buildroot/bin/pins_set
Normal file
3
buildroot/bin/pins_set
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval "sed -i 's/\(#define *$2\) *.*$/\1 $3/g' Marlin/pins_$1.h"
|
5
buildroot/bin/restore_configs
Normal file
5
buildroot/bin/restore_configs
Normal file
@ -0,0 +1,5 @@
|
||||
#!/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_14.h.backup Marlin/pins_RAMPS_14.h
|
3
buildroot/bin/use_example_configs
Normal file
3
buildroot/bin/use_example_configs
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval "cp Marlin/example_configurations/$1/Configuration* Marlin/"
|
Reference in New Issue
Block a user