diff --git a/sleepyhead/scripts/build_number b/sleepyhead/scripts/build_number deleted file mode 100644 index abac1ea7..00000000 --- a/sleepyhead/scripts/build_number +++ /dev/null @@ -1 +0,0 @@ -47 diff --git a/sleepyhead/scripts/inc_build.sh b/sleepyhead/scripts/inc_build.sh index b0d3da14..11a33451 100755 --- a/sleepyhead/scripts/inc_build.sh +++ b/sleepyhead/scripts/inc_build.sh @@ -1,12 +1,24 @@ #!/bin/bash + MY_PATH="`dirname \"$0\"`" -if [ ! -f "$MY_PATH/ReleaseMode" ] +if [ -f "$MY_PATH/build_number" ] then - echo "Skipping build number update" - exit; -fi -echo "Updating build number" number=`cat $MY_PATH/build_number` -let number++ -echo "$number" > $MY_PATH/build_number -echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h +else +number=0 +fi + +if [ ! "$1" == "release" ] +then + echo "Updating build number" + let number++ + echo "$number" > $MY_PATH/build_number + echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h +else + echo "Skipping build number update" + # But create anyway if it doesn't exist + if [ ! -f $MY_PATH/../build_number.h ] + then + echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h + fi +fi diff --git a/sleepyhead/sleepyhead.pro b/sleepyhead/sleepyhead.pro index 1eb6ae3c..1776d323 100644 --- a/sleepyhead/sleepyhead.pro +++ b/sleepyhead/sleepyhead.pro @@ -100,15 +100,17 @@ win32 { } unix { - CONFIG(release, debug|release) { - # Update build number - build_nr.commands = $$PWD/scripts/inc_build.sh - build_nr.depends = FORCE - QMAKE_EXTRA_TARGETS += build_nr - PRE_TARGETDEPS += build_nr - - HEADERS += build_number.h + # Update build number + CONFIG(release, debug|release) { + build_nr.commands = $$PWD/scripts/inc_build.sh release + } else { + build_nr.commands = $$PWD/scripts/inc_build.sh debug } + build_nr.depends = FORCE + QMAKE_EXTRA_TARGETS += build_nr + PRE_TARGETDEPS += build_nr + + HEADERS += build_number.h } #include(..3rdparty/qextserialport/src/qextserialport.pri)