mirror of
https://github.com/KeithDHedger/LFSDesktopProject.git
synced 2026-01-13 05:42:05 +00:00
130 lines
4.0 KiB
Bash
Executable File
130 lines
4.0 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
|
|
}
|
|
|
|
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}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 "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 {} ;"
|
|
}
|
|
|
|
if [[ $action = "help" ]];then
|
|
help
|
|
exit
|
|
fi
|
|
|
|
for app in "LFSToolKit" $BUILDLFSWMANAGER "LFSWM2" "LFSDesktop" "LFSSetWallpaper" "LFSApplications" "LFSPanel" "LFSDock"
|
|
do
|
|
pushd $app
|
|
echo -e "${RED}Running $action in ${GREEN}$app${RED} ... ${NORMAL}"
|
|
$action
|
|
popd
|
|
done
|