From 1fdc150116cad39aae5c5da407c3312b47a59e3a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 17 Dec 2021 07:06:30 -0500 Subject: New upstream version 3.3.3+dfsg1. --- scripts/linux/compile.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 scripts/linux/compile.sh (limited to 'scripts/linux/compile.sh') diff --git a/scripts/linux/compile.sh b/scripts/linux/compile.sh new file mode 100755 index 0000000..eff0b04 --- /dev/null +++ b/scripts/linux/compile.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +set -e + +if [ "$1" == "" ]; then + QMAKE=`which qmake` + if [ "$QMAKE" == "" ]; then + echo "Cannot find qmake" + exit 1 + else + read -p "Is this correct qmake (y/N) $QMAKE : " yn + case $yn in + [Yy]* ) ;; + * ) echo "Please pass path to correct qmake as argument to this script."; exit;; + esac + fi +else + QMAKE=$1 +fi + +cdir=`pwd` +cpu_cores=`grep -c ^processor /proc/cpuinfo` +absolute_path=`realpath $0` +this_dir=`dirname $absolute_path` +this_dir=`dirname $this_dir` +parent_dir=`dirname $this_dir` + +if [ "$2" == "" ]; then + read -p "Number of CPU cores to use for compiling (hit enter to use $cpu_cores): " new_cpu_cores + case $new_cpu_cores in + "" ) ;; + * ) cpu_cores=$new_cpu_cores ;; + esac +else + cpu_cores=$2 +fi + +if [ -d $parent_dir/output ]; then + read -p "Directory $parent_dir/output already exists. The script will delete and recreate it. Is that okay? (y/N) : " yn + case $yn in + [Yy]* ) rm -rf $parent_dir/output ;; + * ) echo "Aborted."; exit;; + esac +fi + +cd $parent_dir +mkdir output output/build output/build/Plugins + +cd output/build +$QMAKE CONFIG+=portable ../../SQLiteStudio3 +make -j $cpu_cores + +cd Plugins +$QMAKE CONFIG+=portable ../../../Plugins +make -j $cpu_cores + +cd $cdir -- cgit v1.2.3