improved build script, automatic version fetch from source

new-codepages 2.1.0-beta2-real
Ondřej Hruška 7 years ago
parent 2796709624
commit 6c1ab28e75
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      front-end
  2. 14
      get_version.c
  3. 30
      ship.sh
  4. 5
      user/version.h

@ -1 +1 @@
Subproject commit 2bd167304c20f985a41f55cee55100283a6b7896
Subproject commit 01148465b71b640892a50ec825205ae581d6dca7

@ -0,0 +1,14 @@
//
// Created by MightyPork on 2017/10/03.
//
// helper for building release packages
//
// Run with `tcc -run`
//
#include "user/version.h"
#include <stdio.h>
void main() {
printf(FW_VERSION);
}

@ -1,16 +1,19 @@
#!/usr/bin/env bash
echo -n -e "\e[1;36m Version number (for file names): \e[0m"
read vers
echo
if [ -z "$vers" ]
then
echo -e "\e[0;31m Aborted.\e[0m"
echo
exit
if [ -z "$1" ]; then
vers=$(tcc -run get_version.c)
else
vers=$1
fi
git pull
echo -n -e "\e[1;36mBuilding packages for version $vers\e[0m"
cd front-end
git pull
cd ..
function buildlang() {
lang=$1
@ -20,8 +23,6 @@ function buildlang() {
ESP_LANG=${lang} make web
ESP_LANG=${lang} make actual_all -B -j4
cp firmware/0x00000.bin release/0x00000.bin
cp firmware/0x40000.bin release/0x40000.bin
cd release
destdir="$vers-$lang"
@ -56,12 +57,13 @@ function buildlang() {
[[ -e ${targetfile}.zip ]] && rm ${targetfile}.zip
pwd
zip -9 ${targetfile} ${destdir}/*
#rm -r ${destdir}
rm 0x00000.bin 0x40000.bin
cd ..
}
if [ -z "$ESP_LANG" ]; then
buildlang cs
buildlang en
buildlang de
else
buildlang ${ESP_LANG}
fi

@ -5,12 +5,13 @@
#ifndef ESP_VT100_FIRMWARE_VERSION_H
#define ESP_VT100_FIRMWARE_VERSION_H
#include "helpers.h"
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define FW_V_MAJOR 2
#define FW_V_MINOR 1
#define FW_V_PATCH 0
#define FW_V_SUFFIX "-beta2"
#define FW_V_SUFFIX "-beta3"
//#define FW_V_SUFFIX ""
#define FW_CODENAME "Anthill" // 2.1.0
#define FW_CODENAME_QUOTED "\""FW_CODENAME"\""

Loading…
Cancel
Save