From 0074d63962f54372dc718074481231d7bf7db174 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:32:44 -0400 Subject: [PATCH] Vendor version override (#14189) Co-Authored-By: InsanityAutomation --- .circleci/config.yml | 4 +- .travis.yml | 4 +- Marlin/Configuration.h | 1 + Marlin/Version.h | 76 ++++++++++ Marlin/src/HAL/HAL_DUE/usb/conf_usb.h | 15 +- Marlin/src/inc/Conditionals_post.h | 34 ++--- Marlin/src/inc/MarlinConfigPre.h | 14 +- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/inc/Version.h | 135 +++++++++++------- buildroot/bin/generate_version | 101 +++++++++++-- config/default/Configuration.h | 1 + .../examples/3DFabXYZ/Migbot/Configuration.h | 1 + .../ADIMLab/Gantry v1/Configuration.h | 1 + .../ADIMLab/Gantry v2/Configuration.h | 1 + .../AlephObjects/TAZ4/Configuration.h | 1 + .../Alfawise/U20-bltouch/Configuration.h | 1 + config/examples/Alfawise/U20/Configuration.h | 1 + .../AliExpress/CL-260/Configuration.h | 1 + .../AliExpress/UM2pExt/Configuration.h | 1 + config/examples/Anet/A2/Configuration.h | 1 + config/examples/Anet/A2plus/Configuration.h | 1 + config/examples/Anet/A6/Configuration.h | 1 + config/examples/Anet/A8/Configuration.h | 1 + config/examples/Anet/A8plus/Configuration.h | 1 + config/examples/Anet/E16/Configuration.h | 1 + config/examples/AnyCubic/i3/Configuration.h | 1 + config/examples/ArmEd/Configuration.h | 1 + config/examples/Azteeg/X5GT/Configuration.h | 1 + .../BIBO/TouchX/cyclops/Configuration.h | 1 + .../BIBO/TouchX/default/Configuration.h | 1 + config/examples/BQ/Hephestos/Configuration.h | 1 + .../examples/BQ/Hephestos_2/Configuration.h | 1 + config/examples/BQ/WITBOX/Configuration.h | 1 + config/examples/Cartesio/Configuration.h | 1 + .../examples/Creality/CR-10/Configuration.h | 1 + .../examples/Creality/CR-10S/Configuration.h | 1 + .../Creality/CR-10_5S/Configuration.h | 1 + .../Creality/CR-10mini/Configuration.h | 1 + .../Creality/CR-20 Pro/Configuration.h | 1 + .../examples/Creality/CR-20/Configuration.h | 1 + config/examples/Creality/CR-8/Configuration.h | 1 + .../examples/Creality/Ender-2/Configuration.h | 1 + .../examples/Creality/Ender-3/Configuration.h | 1 + .../examples/Creality/Ender-4/Configuration.h | 1 + .../examples/Creality/Ender-5/Configuration.h | 1 + .../Dagoma/Disco Ultimate/Configuration.h | 1 + .../Sidewinder X1/Configuration.h | 1 + config/examples/Einstart-S/Configuration.h | 1 + config/examples/FYSETC/AIO_II/Configuration.h | 1 + .../Cheetah 1.2/BLTouch/Configuration.h | 1 + .../FYSETC/Cheetah 1.2/base/Configuration.h | 1 + .../FYSETC/Cheetah/BLTouch/Configuration.h | 1 + .../FYSETC/Cheetah/base/Configuration.h | 1 + config/examples/FYSETC/F6_13/Configuration.h | 1 + config/examples/Felix/DUAL/Configuration.h | 1 + config/examples/Felix/Single/Configuration.h | 1 + .../FlashForge/CreatorPro/Configuration.h | 1 + .../FolgerTech/i3-2020/Configuration.h | 1 + .../examples/Formbot/Raptor/Configuration.h | 1 + .../examples/Formbot/T_Rex_2+/Configuration.h | 1 + .../examples/Formbot/T_Rex_3/Configuration.h | 1 + config/examples/Geeetech/A10/Configuration.h | 1 + config/examples/Geeetech/A10M/Configuration.h | 1 + config/examples/Geeetech/A20M/Configuration.h | 1 + .../examples/Geeetech/GT2560/Configuration.h | 1 + .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 1 + .../Geeetech/MeCreator2/Configuration.h | 1 + .../Prusa i3 Pro B/bltouch/Configuration.h | 1 + .../Prusa i3 Pro B/noprobe/Configuration.h | 1 + .../Geeetech/Prusa i3 Pro C/Configuration.h | 1 + .../Geeetech/Prusa i3 Pro W/Configuration.h | 1 + config/examples/HMS434/Configuration.h | 1 + .../examples/Infitary/i3-M508/Configuration.h | 1 + config/examples/JGAurora/A1/Configuration.h | 1 + config/examples/JGAurora/A5/Configuration.h | 1 + config/examples/JGAurora/A5S/Configuration.h | 1 + config/examples/MakerParts/Configuration.h | 1 + config/examples/Malyan/M150/Configuration.h | 1 + config/examples/Malyan/M200/Configuration.h | 1 + .../Micromake/C1/basic/Configuration.h | 1 + .../Micromake/C1/enhanced/Configuration.h | 1 + config/examples/Mks/Robin/Configuration.h | 1 + config/examples/Mks/Sbase/Configuration.h | 1 + .../Printrbot/PrintrboardG2/Configuration.h | 1 + .../examples/RapideLite/RL200/Configuration.h | 3 +- .../examples/RepRapPro/Huxley/Configuration.h | 1 + .../RepRapWorld/Megatronics/Configuration.h | 1 + config/examples/RigidBot/Configuration.h | 1 + config/examples/SCARA/Configuration.h | 1 + .../STM32/Black_STM32F407VET6/Configuration.h | 1 + .../STM32/STM32F103RE/Configuration.h | 1 + config/examples/STM32/STM32F4/Configuration.h | 1 + .../STM32/stm32f103ret6/Configuration.h | 1 + config/examples/Sanguinololu/Configuration.h | 1 + .../Tevo/Michelangelo/Configuration.h | 1 + .../Tevo/Tarantula Pro/Configuration.h | 1 + .../Tornado/V1 (MKS Base)/Configuration.h | 1 + .../Tornado/V2 (MKS GEN-L)/Configuration.h | 1 + config/examples/TheBorg/Configuration.h | 1 + config/examples/TinyBoy2/Configuration.h | 1 + config/examples/Tronxy/X1/Configuration.h | 1 + config/examples/Tronxy/X3A/Configuration.h | 1 + config/examples/Tronxy/X5S-2E/Configuration.h | 1 + config/examples/Tronxy/X5S/Configuration.h | 1 + config/examples/Tronxy/XY100/Configuration.h | 1 + .../UltiMachine/Archim1/Configuration.h | 1 + .../UltiMachine/Archim2/Configuration.h | 1 + config/examples/VORONDesign/Configuration.h | 1 + .../examples/Velleman/K8200/Configuration.h | 1 + .../Velleman/K8400/Dual-head/Configuration.h | 1 + .../K8400/Single-head/Configuration.h | 1 + .../examples/WASP/PowerWASP/Configuration.h | 1 + .../Wanhao/Duplicator 6/Configuration.h | 1 + .../Wanhao/Duplicator i3 2.1/Configuration.h | 1 + .../Wanhao/Duplicator i3 Mini/Configuration.h | 1 + .../examples/adafruit/ST7565/Configuration.h | 1 + .../delta/Anycubic/Kossel/Configuration.h | 1 + .../delta/Dreammaker/Overlord/Configuration.h | 1 + .../Dreammaker/Overlord_Pro/Configuration.h | 1 + .../FLSUN/auto_calibrate/Configuration.h | 1 + .../delta/FLSUN/kossel/Configuration.h | 1 + .../delta/FLSUN/kossel_mini/Configuration.h | 1 + .../Geeetech/Rostock 301/Configuration.h | 1 + .../delta/Hatchbox_Alpha/Configuration.h | 1 + .../examples/delta/MKS/SBASE/Configuration.h | 1 + .../delta/Tevo Little Monster/Configuration.h | 1 + config/examples/delta/generic/Configuration.h | 1 + .../delta/kossel_mini/Configuration.h | 1 + .../examples/delta/kossel_pro/Configuration.h | 1 + .../examples/delta/kossel_xl/Configuration.h | 1 + .../examples/gCreate/gMax1.5+/Configuration.h | 1 + config/examples/makibox/Configuration.h | 1 + config/examples/tvrrug/Round2/Configuration.h | 1 + config/examples/wt150/Configuration.h | 1 + 134 files changed, 410 insertions(+), 104 deletions(-) create mode 100644 Marlin/Version.h mode change 100755 => 100644 config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h diff --git a/.circleci/config.yml b/.circleci/config.yml index 5369e2f4d..d474f034b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,8 +51,8 @@ jobs: export PATH=`pwd`/buildroot/bin/:${PATH} # Generate custom version include - generate_version ./Marlin/src/inc - cat ./Marlin/src/inc/_Version.h + generate_version ./Marlin/ + cat ./Marlin/Version.h # # Back up pins_RAMPS.h # diff --git a/.travis.yml b/.travis.yml index 16e48856e..d3acf40cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,8 +75,8 @@ before_script: - cd ${TRAVIS_BUILD_DIR} # # Generate custom version include - - generate_version ${TRAVIS_BUILD_DIR}/Marlin/src/inc - - cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h + - generate_version ${TRAVIS_BUILD_DIR}/Marlin/ + - cat ${TRAVIS_BUILD_DIR}/Marlin/Version.h # script: - run_tests ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e682f132e..155605f60 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -72,6 +72,7 @@ // Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** diff --git a/Marlin/Version.h b/Marlin/Version.h new file mode 100644 index 000000000..d18176f27 --- /dev/null +++ b/Marlin/Version.h @@ -0,0 +1,76 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//////////////////////////// +// VENDOR VERSION EXAMPLE // +//////////////////////////// + +/** + * Marlin release version identifier + */ +//#define SHORT_BUILD_VERSION "bugfix-2.0.x" + +/** + * Verbose version identifier which should contain a reference to the location + * from where the binary was downloaded or the source code was compiled. + */ +//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" + +/** + * The STRING_DISTRIBUTION_DATE represents when the binary file was built, + * here we define this default string as the date where the latest release + * version was tagged. + */ +//#define STRING_DISTRIBUTION_DATE "2019-07-10" + +/** + * Defines a generic printer name to be output to the LCD after booting Marlin. + */ +//#define MACHINE_NAME "3D Printer" + +/** + * The SOURCE_CODE_URL is the location where users will find the Marlin Source + * Code which is installed on the device. In most cases —unless the manufacturer + * has a distinct Github fork— the Source Code URL should just be the main + * Marlin repository. + */ +//#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" + +/** + * Default generic printer UUID. + */ +//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" + +/** + * The WEBSITE_URL is the location where users can get more information such as + * documentation about a specific Marlin release. + */ +//#define WEBSITE_URL "http://marlinfw.org" + +/** + * Set the vendor info the serial USB interface, if changable + * Currently only supported by DUE platform + */ +//#define USB_DEVICE_VENDOR_ID 0x0000 +//#define USB_DEVICE_PRODUCT_ID 0x0000 +//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL diff --git a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h index 6934494e5..8d5924d37 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h @@ -48,9 +48,7 @@ #define _CONF_USB_H_ #undef UNUSED /* To avoid a macro clash as macros.h already defines it */ -#include "../../../core/macros.h" /* For ENABLED()/DISABLED() */ -#include "../../../core/boards.h" /* For MB() */ -#include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */ +#include "../../../inc/MarlinConfigPre.h" #include "compiler.h" /** @@ -59,8 +57,6 @@ */ //! Device definition (mandatory) -#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */ -#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */ #define USB_DEVICE_MAJOR_VERSION 1 #define USB_DEVICE_MINOR_VERSION 0 #define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA) @@ -70,15 +66,6 @@ // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) -//! USB Device string definitions (Optional) -#define USB_DEVICE_MANUFACTURE_NAME "marlinfw.org" -#ifdef CUSTOM_MACHINE_NAME - #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME -#else - #define USB_DEVICE_PRODUCT_NAME "3D Printer" -#endif -#define USB_DEVICE_SERIAL_NAME "123985739853" - /** * Device speeds support * Low speed not supported by CDC and MSC diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index fcc361ad4..5214ac607 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1768,23 +1768,25 @@ #define Z_STEPPER_COUNT 1 #endif -// Get LCD character width/height, which may be overridden by pins, configs, etc. -#ifndef LCD_WIDTH - #if HAS_GRAPHICAL_LCD - #define LCD_WIDTH 21 - #elif ENABLED(ULTIPANEL) - #define LCD_WIDTH 20 - #elif HAS_SPI_LCD - #define LCD_WIDTH 16 +#if HAS_SPI_LCD + // Get LCD character width/height, which may be overridden by pins, configs, etc. + #ifndef LCD_WIDTH + #if HAS_GRAPHICAL_LCD + #define LCD_WIDTH 21 + #elif ENABLED(ULTIPANEL) + #define LCD_WIDTH 20 + #else + #define LCD_WIDTH 16 + #endif #endif -#endif -#ifndef LCD_HEIGHT - #if HAS_GRAPHICAL_LCD - #define LCD_HEIGHT 5 - #elif ENABLED(ULTIPANEL) - #define LCD_HEIGHT 4 - #elif HAS_SPI_LCD - #define LCD_HEIGHT 2 + #ifndef LCD_HEIGHT + #if HAS_GRAPHICAL_LCD + #define LCD_HEIGHT 5 + #elif ENABLED(ULTIPANEL) + #define LCD_HEIGHT 4 + #else + #define LCD_HEIGHT 2 + #endif #endif #endif diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index e34b70376..a7dea37a9 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -34,9 +34,21 @@ #include "../core/boards.h" #include "../core/macros.h" -#include "Version.h" #include "../../Configuration.h" + +#ifdef CUSTOM_VERSION_FILE + #if defined(__has_include) + #if __has_include(CUSTOM_VERSION_FILE) + #include XSTR(../../CUSTOM_VERSION_FILE) + #endif + #else + #include XSTR(../../CUSTOM_VERSION_FILE) + #endif +#endif + +#include "Version.h" + #include "Conditionals_LCD.h" #include HAL_PATH(../HAL, inc/Conditionals_LCD.h) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 5aa0cd6f7..d4dcf13f5 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -74,7 +74,9 @@ #elif defined(CUSTOM_MENDEL_NAME) #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." #elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." + #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." +#elif defined(USE_AUTOMATIC_VERSIONING) + #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." #elif defined(SDSLOW) #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." #elif defined(SDEXTRASLOW) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0e02b0be3..259d7a02c 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -21,77 +21,102 @@ */ #pragma once -#include "../core/macros.h" // for ENABLED +/** + * Release version. Leave the Marlin version or apply a custom scheme. + */ +#ifndef SHORT_BUILD_VERSION + #define SHORT_BUILD_VERSION "bugfix-2.0.x" +#endif /** - * This file is the standard Marlin version identifier file. - * Use -DUSE_AUTOMATIC_VERSIONING=1 and a custom _Version.h - * to override these values. + * Verbose version identifier containing a unique identifier, such as the + * vendor name, download location, GitHub account, etc. + */ +#ifndef DETAILED_BUILD_VERSION + #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (GitHub)" +#endif + +/** + * The STRING_DISTRIBUTION_DATE represents when the binary file was built, + * here we define this default string as the date where the latest release + * version was tagged. + */ +#ifndef STRING_DISTRIBUTION_DATE + #define STRING_DISTRIBUTION_DATE "2019-10-10" +#endif + +/** + * Minimum Configuration.h and Configuration_adv.h file versions. + * Set based on the release version number. Used to catch an attempt to use + * older configurations. Override these if using a custom versioning scheme + * to alert users to major changes. */ -#if ENABLED(USE_AUTOMATIC_VERSIONING) +#define MARLIN_HEX_VERSION 020000 +#ifndef REQUIRED_CONFIGURATION_H_VERSION + #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION +#endif +#ifndef REQUIRED_CONFIGURATION_ADV_H_VERSION + #define REQUIRED_CONFIGURATION_ADV_H_VERSION MARLIN_HEX_VERSION +#endif - #include "_Version.h" - -#else - - /** - * Marlin release version identifier - */ - #define SHORT_BUILD_VERSION "bugfix-2.0.x" - - /** - * Verbose version identifier which should contain a reference to the location - * from where the binary was downloaded or the source code was compiled. - */ - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" - - /** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ - #define STRING_DISTRIBUTION_DATE "2019-10-10" - - /** - * Required minimum Configuration.h and Configuration_adv.h file versions. - * - * You must increment this version number for every significant change such as, - * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on - * the configuration files. - */ - #define REQUIRED_CONFIGURATION_H_VERSION 020000 - #define REQUIRED_CONFIGURATION_ADV_H_VERSION 020000 - - /** - * The protocol for communication to the host. Protocol indicates communication - * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. - * (Other behaviors are given by the firmware version and capabilities report.) - */ +/** + * The protocol for communication to the host. Protocol indicates communication + * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. + * (Other behaviors are given by the firmware version and capabilities report.) + */ +#ifndef PROTOCOL_VERSION #define PROTOCOL_VERSION "1.0" +#endif - /** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ +/** + * Define a generic printer name to be output to the LCD after booting Marlin. + */ +#ifndef MACHINE_NAME #define MACHINE_NAME "3D Printer" +#endif - /** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ +/** + * Website where users can find Marlin source code for the binary installed on the + * device. Override this if you provide public source code download. (GPLv3 requires + * providing the source code to your customers.) + */ +#ifndef SOURCE_CODE_URL #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" +#endif - /** - * Default generic printer UUID. - */ +/** + * Default generic printer UUID. + */ +#ifndef DEFAULT_MACHINE_UUID #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" +#endif /** * The WEBSITE_URL is the location where users can get more information such as * documentation about a specific Marlin release. Displayed in the Info Menu. */ +#ifndef WEBSITE_URL #define WEBSITE_URL "http://marlinfw.org" +#endif -#endif // USE_AUTOMATIC_VERSIONING +/** + * Set the vendor info the serial USB interface, if changable + * Currently only supported by DUE platform + */ +#ifndef USB_DEVICE_VENDOR_ID + #define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */ +#endif +#ifndef USB_DEVICE_PRODUCT_ID + #define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */ +#endif +//! USB Device string definitions (Optional) +#ifndef USB_DEVICE_MANUFACTURE_NAME + #define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL +#endif +#ifdef CUSTOM_MACHINE_NAME + #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME +#else + #define USB_DEVICE_PRODUCT_NAME MACHINE_NAME +#endif +#define USB_DEVICE_SERIAL_NAME "123985739853" diff --git a/buildroot/bin/generate_version b/buildroot/bin/generate_version index 5a07ef5b1..c2bcbdc75 100755 --- a/buildroot/bin/generate_version +++ b/buildroot/bin/generate_version @@ -2,10 +2,10 @@ # # generate_version # -# Make a _Version.h file +# Make a Version.h file to accompany CUSTOM_VERSION_FILE # -DIR=${1:-"Marlin/src/inc"} +DIR=${1:-"Marlin"} # MRCC3=$( git merge-base HEAD upstream/bugfix-2.0.x 2>/dev/null ) # MRCC2=$( git merge-base HEAD upstream/bugfix-1.1.x 2>/dev/null ) @@ -44,7 +44,30 @@ SOURCE_CODE_URL=$(awk -F'"' \ WEBSITE_URL=$(awk -F'"' \ '/#define WEBSITE_URL/{ print $2 }' < "${DIR}/Version.h") -cat > "${DIR}/_Version.h" < "${DIR}/Version.h" <. + * + */ +#pragma once + /** * THIS FILE IS AUTOMATICALLY GENERATED DO NOT MANUALLY EDIT IT. * IT DOES NOT GET COMMITTED TO THE REPOSITORY. @@ -53,15 +76,69 @@ cat > "${DIR}/_Version.h" <