Files
LFSDesktopProject/makeall
2023-08-21 14:43:31 +01:00

110 lines
2.9 KiB
Bash
Executable File

#!/bin/bash -e
#
#©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:-"-j3"}
export MAKEFLAGS
export PATH
BUILDOLDWM=0
if [ $BUILDOLDWM -eq 1 ];then
BUILDLFSWMANAGER="LFSWManager"
else
BUILDLFSWMANAGER=""
fi
#Set this to your own user name
CHANGEUSER=keithhedger
#Set this if needed.
LIBDIRSUFFIX=64
runCommand ()
{
echo -e "${RED}Running $1 in ${GREEN}$app${RED} ... ${NORMAL}"
$1||true
}
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 "make $MAKEFLAGS"
runCommand "make install"
}
deploytest ()
{
runCommand "make distclean"||true
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
runCommand "make $MAKEFLAGS"
runCommand "make install DESTDIR=/tmp/lfsdesktop-deploy"
}
makeit ()
{
runCommand "./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX}"
runCommand "make $MAKEFLAGS"
}
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 {} ;"
}
for app in "LFSToolKit" $BUILDLFSWMANAGER "LFSWM2" "LFSDesktop" "LFSSetWallpaper" "LFSApplications" "LFSPanel"
do
pushd $app
echo -e "${RED}Running $action in ${GREEN}$app${RED} ... ${NORMAL}"
$action
popd
done