From 7b07a2e3aca52467da9ae3e3865f77f85965178d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Fri, 24 Jul 2020 08:24:12 +0200 Subject: [PATCH] [username] Change USERNAME to OMEGA_USERNAME --- README.md | 14 +++++++------- apps/Makefile | 2 +- apps/settings/main_controller.cpp | 2 +- apps/settings/main_controller.h | 2 +- apps/settings/sub_menu/about_controller.cpp | 2 +- apps/settings/sub_menu/about_controller.h | 2 +- build/config.mak | 2 +- build/defaults.mak | 4 ++-- docker/build | 4 ++-- ion/Makefile | 2 +- ion/include/ion.h | 2 +- ion/src/shared/platform_info.cpp | 8 ++++---- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3d3a57b3bfc..cff8b3a2c2d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ git clone --recursive https://github.com/Omega-Numworks/Omega.git cd Omega git checkout omega-master make MODEL=n0100 clean -make MODEL=n0100 USERNAME="{Your name, max 15 characters}" -j4 +make MODEL=n0100 OMEGA_USERNAME="{Your name, max 15 characters}" -j4 make MODEL=n0100 epsilon_flash ``` @@ -58,7 +58,7 @@ git clone --recursive https://github.com/Omega-Numworks/Omega.git cd Omega git checkout omega-master make clean -make USERNAME="{Your name, max 15 characters}" -j4 +make OMEGA_USERNAME="{Your name, max 15 characters}" -j4 make epsilon_flash ``` @@ -77,10 +77,10 @@ git clone --recursive https://github.com/Omega-Numworks/Omega.git cd Omega git checkout omega-master make clean -make MODEL=n0100 USERNAME="" -j8 -make MODEL=n0100 USERNAME="" binpack -j8 -make USERNAME="" -j8 -make USERNAME="" binpack -j8 +make MODEL=n0100 OMEGA_USERNAME="" -j8 +make MODEL=n0100 OMEGA_USERNAME="" binpack -j8 +make OMEGA_USERNAME="" -j8 +make OMEGA_USERNAME="" binpack -j8 ``` Important: Don't forget the `--recursive` tag, because Omega relies on submodules. @@ -108,7 +108,7 @@ git clone --recursive https://github.com/Omega-Numworks/Omega.git cd Omega git checkout omega-master make clean -make PLATFORM=simulator TARGET=web USERNAME="{Your name, max 15 characters}" -j4 +make PLATFORM=simulator TARGET=web OMEGA_USERNAME="{Your name, max 15 characters}" -j4 ``` The simulator is now in `output/release/simulator/web/simulator.zip` diff --git a/apps/Makefile b/apps/Makefile index 381c0d7d277..cc6c6ff70d4 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -51,7 +51,7 @@ snapshots_count = $(words $(apps)) snapshot_includes = $(foreach i,$(app_headers),-include $(i) ) epsilon_app_names = '$(foreach i,${apps_list},"$(i)", )' -$(call object_for,apps/apps_container_storage.cpp apps/apps_container.cpp apps/main.cpp): CXXFLAGS += $(snapshot_includes) -DAPPS_CONTAINER_APPS_DECLARATION="$(apps_declaration)" -DAPPS_CONTAINER_SNAPSHOT_DECLARATIONS="$(snapshots_declaration)" -DAPPS_CONTAINER_SNAPSHOT_CONSTRUCTORS="$(snapshots_construction)" -DAPPS_CONTAINER_SNAPSHOT_LIST="$(snapshots_list)" -DAPPS_CONTAINER_SNAPSHOT_COUNT=$(snapshots_count) -DEPSILON_APPS_NAMES=$(epsilon_app_names) -DUSERNAME="$(USERNAME)" +$(call object_for,apps/apps_container_storage.cpp apps/apps_container.cpp apps/main.cpp): CXXFLAGS += $(snapshot_includes) -DAPPS_CONTAINER_APPS_DECLARATION="$(apps_declaration)" -DAPPS_CONTAINER_SNAPSHOT_DECLARATIONS="$(snapshots_declaration)" -DAPPS_CONTAINER_SNAPSHOT_CONSTRUCTORS="$(snapshots_construction)" -DAPPS_CONTAINER_SNAPSHOT_LIST="$(snapshots_list)" -DAPPS_CONTAINER_SNAPSHOT_COUNT=$(snapshots_count) -DEPSILON_APPS_NAMES=$(epsilon_app_names) -DOMEGA_USERNAME="$(OMEGA_USERNAME)" # I18n file generation diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index 02f17f1ddca..b9f51cdc1f8 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -19,7 +19,7 @@ constexpr SettingsMessageTree s_modelMathOptionsChildren[6] = {SettingsMessageTr constexpr SettingsMessageTree s_modelFontChildren[2] = {SettingsMessageTree(I18n::Message::LargeFont), SettingsMessageTree(I18n::Message::SmallFont)}; constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)}; constexpr SettingsMessageTree s_contributorsChildren[20] = {SettingsMessageTree(I18n::Message::Developers), SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::SandraSimmons), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::David), SettingsMessageTree(I18n::Message::DamienNicolet), SettingsMessageTree(I18n::Message::EvannDreumont), SettingsMessageTree(I18n::Message::SzaboLevente), SettingsMessageTree(I18n::Message::VenceslasDuet), SettingsMessageTree(I18n::Message::CharlotteThomas), SettingsMessageTree(I18n::Message::AntoninLoubiere), SettingsMessageTree(I18n::Message::BetaTesters), SettingsMessageTree(I18n::Message::CyprienMejat), SettingsMessageTree(I18n::Message::TimeoArnouts), SettingsMessageTree(I18n::Message::JulieC), SettingsMessageTree(I18n::Message::LelahelHideux), SettingsMessageTree(I18n::Message::Madil), SettingsMessageTree(I18n::Message::HilaireLeRoux)}; -#ifdef USERNAME +#ifdef OMEGA_USERNAME constexpr SettingsMessageTree s_modelAboutChildren[8] = {SettingsMessageTree(I18n::Message::Username), SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::OmegaVersion), SettingsMessageTree(I18n::Message::MicroPythonVersion), SettingsMessageTree(I18n::Message::MemUse), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId), SettingsMessageTree(I18n::Message::Contributors, s_contributorsChildren)}; #else constexpr SettingsMessageTree s_modelAboutChildren[7] = {SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::OmegaVersion), SettingsMessageTree(I18n::Message::MicroPythonVersion), SettingsMessageTree(I18n::Message::MemUse), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId), SettingsMessageTree(I18n::Message::Contributors, s_contributorsChildren)}; diff --git a/apps/settings/main_controller.h b/apps/settings/main_controller.h index 62f1d3c363a..25c30cf9cb8 100644 --- a/apps/settings/main_controller.h +++ b/apps/settings/main_controller.h @@ -23,7 +23,7 @@ extern const Shared::SettingsMessageTree s_modelMathOptionsChildren[6]; extern const Shared::SettingsMessageTree s_modelFontChildren[2]; extern const Shared::SettingsMessageTree s_accessibilityChildren[6]; extern const Shared::SettingsMessageTree s_contributorsChildren[20]; -#ifdef USERNAME +#ifdef OMEGA_USERNAME extern const Shared::SettingsMessageTree s_modelAboutChildren[8]; #else extern const Shared::SettingsMessageTree s_modelAboutChildren[7]; diff --git a/apps/settings/sub_menu/about_controller.cpp b/apps/settings/sub_menu/about_controller.cpp index fe64d7453cc..54162bfe5e6 100644 --- a/apps/settings/sub_menu/about_controller.cpp +++ b/apps/settings/sub_menu/about_controller.cpp @@ -142,7 +142,7 @@ void AboutController::willDisplayCellForIndex(HighlightCell * cell, int index) { MessageTableCellWithBuffer * myCell = (MessageTableCellWithBuffer *)cell; static const char * mpVersion = MICROPY_VERSION_STRING; static const char * messages[] = { -#ifdef USERNAME +#ifdef OMEGA_USERNAME Ion::username(), #endif Ion::softwareVersion(), diff --git a/apps/settings/sub_menu/about_controller.h b/apps/settings/sub_menu/about_controller.h index 5824432bc0b..e94a6e2aa67 100644 --- a/apps/settings/sub_menu/about_controller.h +++ b/apps/settings/sub_menu/about_controller.h @@ -21,7 +21,7 @@ class AboutController : public GenericSubController { void willDisplayCellForIndex(HighlightCell * cell, int index) override; int typeAtLocation(int i, int j) override; private: -#ifdef USERNAME +#ifdef OMEGA_USERNAME constexpr static int k_totalNumberOfCell = 8; #else constexpr static int k_totalNumberOfCell = 7; diff --git a/build/config.mak b/build/config.mak index df389866fa2..5b10a4b3b07 100644 --- a/build/config.mak +++ b/build/config.mak @@ -6,7 +6,7 @@ DEBUG ?= 0 HOME_DISPLAY_EXTERNALS ?= 1 EPSILON_VERSION ?= 14.4.1 OMEGA_VERSION ?= 1.20.1 -# USERNAME ?= N/A +# OMEGA_USERNAME ?= N/A EPSILON_APPS ?= calculation rpn graph code statistics probability solver atom sequence regression settings external EPSILON_I18N ?= en fr nl pt it de es hu EPSILON_GETOPT ?= 0 diff --git a/build/defaults.mak b/build/defaults.mak index 0a77defd2b1..11a7f9edd20 100644 --- a/build/defaults.mak +++ b/build/defaults.mak @@ -2,8 +2,8 @@ HOSTCC = gcc HOSTCXX = g++ PYTHON = python3 -ifdef USERNAME - SFLAGS += -DUSERNAME="$(USERNAME)" +ifdef OMEGA_USERNAME + SFLAGS += -DOMEGA_USERNAME="$(OMEGA_USERNAME)" endif SFLAGS += -DEPSILON_GETOPT=$(EPSILON_GETOPT) SFLAGS += -DEPSILON_TELEMETRY=$(EPSILON_TELEMETRY) diff --git a/docker/build b/docker/build index e5f0b1510e7..e46c7cfd71b 100644 --- a/docker/build +++ b/docker/build @@ -4,10 +4,10 @@ set -e REPO="${1:-https://github.com/Omega-Numworks/Omega.git}" BRANCH="${2:-master}" MODEL="${3:-MODEL=n0110}" -USERNAME="${4:- }" +OMEGA_USERNAME="${4:- }" OPTIONS="${5:-epsilon_flash}" echo Building ${REPO} branch ${BRANCH} for ${MODEL} with options ${OPTIONS} ! git clone --recurse-submodules -j $(nproc) --depth 1 --branch ${BRANCH} ${REPO} omega -time make cleanall && time make -j $(nproc) -C omega ${MODEL} ${USERNAME} ${OPTIONS} \ No newline at end of file +time make cleanall && time make -j $(nproc) -C omega ${MODEL} ${OMEGA_USERNAME} ${OPTIONS} \ No newline at end of file diff --git a/ion/Makefile b/ion/Makefile index 4900217e98c..2722be3e4f6 100644 --- a/ion/Makefile +++ b/ion/Makefile @@ -20,7 +20,7 @@ include ion/src/shared/tools/Makefile # char test[4]= "ab"; is valid and should initialize test to 'a','b',0,0). # Older versions of GCC are not conformant so we resort to an initializer list. initializer_list = $(shell echo $(1) | sed "s/\(.\)/'\1',/g")0 -$(call object_for,ion/src/shared/platform_info.cpp): SFLAGS += -DPATCH_LEVEL="$(call initializer_list,$(PATCH_LEVEL))" -DEPSILON_VERSION="$(call initializer_list,$(EPSILON_VERSION))" -DOMEGA_VERSION="$(call initializer_list,$(OMEGA_VERSION))" -DUSERNAME="$(call initializer_list,$(USERNAME))" +$(call object_for,ion/src/shared/platform_info.cpp): SFLAGS += -DPATCH_LEVEL="$(call initializer_list,$(PATCH_LEVEL))" -DEPSILON_VERSION="$(call initializer_list,$(EPSILON_VERSION))" -DOMEGA_VERSION="$(call initializer_list,$(OMEGA_VERSION))" -DOMEGA_USERNAME="$(call initializer_list,$(OMEGA_USERNAME))" ion_src += $(addprefix ion/src/shared/, \ console_display.cpp:+consoledisplay \ diff --git a/ion/include/ion.h b/ion/include/ion.h index 9541b6777b2..2921da4a425 100644 --- a/ion/include/ion.h +++ b/ion/include/ion.h @@ -30,7 +30,7 @@ void ion_main(int argc, const char * const argv[]); namespace Ion { const char * serialNumber(); -#ifdef USERNAME +#ifdef OMEGA_USERNAME const char * username(); #endif const char * softwareVersion(); diff --git a/ion/src/shared/platform_info.cpp b/ion/src/shared/platform_info.cpp index 053f60d7372..84d5937ca29 100644 --- a/ion/src/shared/platform_info.cpp +++ b/ion/src/shared/platform_info.cpp @@ -33,8 +33,8 @@ class PlatformInfo { m_footer(Magic), m_ohm_header(OmegaMagic), m_omegaVersion{OMEGA_VERSION}, -#ifdef USERNAME - m_username{USERNAME}, +#ifdef OMEGA_USERNAME + m_username{OMEGA_USERNAME}, #else m_username{"\0"}, #endif @@ -57,7 +57,7 @@ class PlatformInfo { assert(m_ohm_footer == OmegaMagic); return m_omegaVersion; } -#ifdef USERNAME +#ifdef OMEGA_USERNAME const char * username() const { assert(m_storageAddress != nullptr); assert(m_storageSize != 0); @@ -102,7 +102,7 @@ const char * Ion::omegaVersion() { return platform_infos.omegaVersion(); } -#ifdef USERNAME +#ifdef OMEGA_USERNAME const char * Ion::username() { return platform_infos.username(); }