mirror of
https://github.com/KeithDHedger/LFSDesktopProject.git
synced 2026-01-13 05:42:05 +00:00
156 lines
5.4 KiB
Bash
Executable File
156 lines
5.4 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
#©K. D. Hedger. Tue 31 Jul 13:33:01 BST 2018 keithdhedger@gmail.com
|
|
#
|
|
#This file (makeall) is part of LFSDesktopProject.
|
|
#
|
|
#LFSDesktopProject 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.
|
|
#
|
|
#LFSDesktopProject 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 LFSDesktopProject. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
#
|
|
#Debug stuff
|
|
#CPPFLAGS="-Wunused -Wunreachable-code -Werror -ffunction-sections -fdata-sections -Wno-error=int-to-pointer-cast -Wno-error=sign-compare -Wno-error=unused-function -Wno-error=write-strings" LDFLAGS=" -Wl,--gc-sections,--print-gc-sections " ./configure --prefix=/usr
|
|
#CPPFLAGS="-Wunused -Wunreachable-code -Werror -ffunction-sections -fdata-sections -Wno-error=int-to-pointer-cast" LDFLAGS=" -Wl,--gc-sections,--print-gc-sections " ./configure --prefix=/usr
|
|
#make 2>&1|grep -i "Removing unused section"|grep -i "/src/"
|
|
#
|
|
|
|
action="$@"
|
|
RED='\e[0;31m'
|
|
GREEN='\e[0;32m'
|
|
BLACK='\e[0;30m'
|
|
BLUE='\e[0;34m'
|
|
NORMAL="\e[0;0m"
|
|
|
|
MAKEFLAGS=${MAKEFLAGS:-"-j$(($(nproc)-1))"}
|
|
export MAKEFLAGS
|
|
export PATH
|
|
BUILDOLDWM=0
|
|
CWD=$(pwd)
|
|
ONERROR=true
|
|
unset CFLAGS CXXFLAGS
|
|
|
|
if [ $BUILDOLDWM -eq 1 ];then
|
|
BUILDLFSWMANAGER="LFSWManager"
|
|
else
|
|
BUILDLFSWMANAGER=""
|
|
fi
|
|
|
|
#Set this to your own user name
|
|
CHANGEUSER=${CHANGEUSER:-$(logname)}
|
|
#Set this if needed.
|
|
LIBDIRSUFFIX=64
|
|
BUILDFOR=${BUILDFOR:-"LFSToolKit $BUILDLFSWMANAGER LFSWM2 LFSDesktop LFSSetWallpaper LFSApplications LFSPanel LFSDock LFSTray"}
|
|
COLMAKE="make $MAKEFLAGS|GREP_COLORS='mt=1;32' grep -P --line-buffered --color=always '(\-D[^ ]*)'|GREP_COLORS='mt=1;37;41' grep -P --line-buffered --color=always '^[^ ]*'|GREP_COLORS='mt=1;33' grep -P --line-buffered --color=always '([[:alnum:]_/\.]+?(\.c+|\..p+|\.h)\b)'|GREP_COLORS='mt=1;36' grep -P --line-buffered --color=always -- '\s-(I|L)/.*?\s'|sed G"
|
|
|
|
|
|
runCommand ()
|
|
{
|
|
echo -e "${RED}Running $1 in ${GREEN}$app${RED} ... ${NORMAL}"
|
|
eval "$1"||$ONERROR
|
|
}
|
|
|
|
help ()
|
|
{
|
|
echo "Usage:"
|
|
echo " makeall OPTION"
|
|
echo
|
|
echo "OPTIONS:"
|
|
echo -e "${RED}distcleanup${NORMAL}\n\trun 'make distclean' on all project folders"
|
|
echo -e "${RED}cleanup\n\t${NORMAL}run 'make clean' on all project folders"
|
|
echo -e "${RED}uninstall\n\t${NORMAL}run 'make distclean;./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX};make uninstall' on all project folders"
|
|
echo -e "${RED}deploy\n\t${NORMAL}run 'make distclean;./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX};make $MAKEFLAGS;make install' on all project folders"
|
|
echo -e "${RED}deploytest\n\t${NORMAL}run 'make distclean;./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX};make $MAKEFLAGS;make install DESTDIR=/tmp/lfsdesktop-deploy' on all project folders"
|
|
echo -e "${RED}makeit\n\t${NORMAL}run './autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX};make $MAKEFLAGS' on all project folders"
|
|
echo -e "${RED}makelocal\n\t${NORMAL}run './autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} on LFSToolkit and\nCFLAGS=\"-Wfatal-errors -I/media/LinuxData/Development/Projects/LFSDesktopProject/LFSToolKit/LFSToolKit/lfstk -L/media/LinuxData/Development/Projects/LFSDesktopProject/LFSToolKit/LFSToolKit/app/.libs\" CXXFLAGS=\"\$CFLAGS\" ./configure --prefix=/usr;make $MAKEFLAGS' on all ther project folders"
|
|
echo -e "${RED}ownit\n\t${NORMAL}run 'chown -vR $CHANGEUSER:$CHANGEUSER .;find -mindepth 1 -exec touch {} ;' on all project folders"
|
|
}
|
|
|
|
distcleanup ()
|
|
{
|
|
runCommand "make distclean"
|
|
}
|
|
|
|
cleanup ()
|
|
{
|
|
runCommand "make clean"||true
|
|
}
|
|
|
|
uninstall ()
|
|
{
|
|
runCommand "make distclean"||true
|
|
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
|
|
runCommand "make uninstall"
|
|
}
|
|
|
|
deploy ()
|
|
{
|
|
runCommand "make distclean"||true
|
|
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
|
|
runCommand "$COLMAKE"
|
|
runCommand "make install --output-sync"
|
|
}
|
|
|
|
deploytest ()
|
|
{
|
|
runCommand "make distclean"||true
|
|
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
|
|
runCommand "$COLMAKE"
|
|
runCommand "make install DESTDIR=/tmp/lfsdesktop-deploy --output-sync"
|
|
}
|
|
|
|
makeit ()
|
|
{
|
|
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
|
|
runCommand "$COLMAKE"
|
|
}
|
|
|
|
makelocal ()
|
|
{
|
|
unset CFLAGS CXXFLAGS
|
|
if [[ "$(basename "$(pwd)")" = "LFSToolKit" ]];then
|
|
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
|
|
else
|
|
ONERROR=false
|
|
CFLAGS="-O0 -g -Wfatal-errors -I${CWD}/LFSToolKit/LFSToolKit/lfstk/ -L${CWD}/LFSToolKit/LFSToolKit/app/.libs"
|
|
CXXFLAGS="$CFLAGS"
|
|
export CFLAGS CXXFLAGS
|
|
runCommand "./autogen.sh --prefix=/usr"
|
|
fi
|
|
runCommand "$COLMAKE"
|
|
}
|
|
|
|
ownit ()
|
|
{
|
|
echo -e "${RED}Owning and touching files in ${GREEN}$(basename $(pwd))${RED} ... ${NORMAL}"
|
|
runCommand "chown -vR $CHANGEUSER:$CHANGEUSER ."
|
|
runCommand "find -mindepth 1 -exec touch {} ;"
|
|
}
|
|
|
|
if [[ $action = "help" ]];then
|
|
help
|
|
exit
|
|
fi
|
|
|
|
if [ $1 = "uninstall" ];then
|
|
BUILDFOR="$BUILDLFSWMANAGER LFSWM2 LFSDesktop LFSSetWallpaper LFSApplications LFSPanel LFSDock LFSToolKit LFSTray"
|
|
fi
|
|
|
|
for app in $BUILDFOR
|
|
do
|
|
pushd $app
|
|
echo -e "${RED}Running $action in ${GREEN}$app${RED} ... ${NORMAL}"
|
|
$action
|
|
popd
|
|
done
|