-BUILD_SCRIPT = build.sh
-KERNEL = zen
-SHARE_OPTION = -b -c "zstd" -u "alter" -p "alter" -k "${KERNEL}"
-DEBUG_OPTION = -t '-Xcompression-level 1' -x -d
-ARCH_x86_64 = -a x86_64
-ARCH_i686 = -a i686
-
+ARGS :=
+BUILD_SCRIPT := build.sh
+KERNEL := zen
+SHARE_OPTION := --boot-splash --comp-type "xz" --user "alter" --password "alter" --kernel "${KERNEL}" --debug --noconfirm
+ARCH_x86_64 := --arch x86_64
+ARCH_i686 := --arch i686
+FULLBUILD := -d -g -e --noconfirm
+FULL_x86_64 := xfce cinnamon i3 plasma
+FULL_i686 := xfce lxde
+CURRENT_DIR := ${shell dirname $(dir $(abspath $(lastword $(MAKEFILE_LIST))))}/${shell basename $(dir $(abspath $(lastword $(MAKEFILE_LIST))))}
full:
- @sudo ./fullbuild.sh
+ sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m x86_64 ${FULL_x86_64}
+ sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m i686 ${FULL_i686}
@make clean
-xfce-64:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} xfce
+basic-64 basic-32 cinnamon-64 cinnamon-32 gnome-64 i3-64 i3-32 lxde-64 lxde-32 plasma-64 releng-32 releng-64 serene-64 serene-32 xfce-64 xfce-32 xfce-pro-64:
+ @$(eval ARCHITECTURE=${shell echo ${@} | rev | cut -d '-' -f 1 | rev })
+ @$(eval CHANNEL=${shell echo ${@} | sed "s/-${ARCHITECTURE}//g"})
+ @[[ -z "${CHANNEL}" ]] && echo "Empty Channel" && exit 1 || :
+ @case ${ARCHITECTURE} in\
+ "32") sudo ${CURRENT_DIR}/${BUILD_SCRIPT} ${ARGS} ${SHARE_OPTION} ${ARCH_i686} ${CHANNEL} ;;\
+ "64") sudo ${CURRENT_DIR}/${BUILD_SCRIPT} ${ARGS} ${SHARE_OPTION} ${ARCH_x86_64} ${CHANNEL};;\
+ * ) echo "Unknown Architecture"; exit 1 ;; \
+ esac
@make clean
-plasma-64:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} plasma
- @make clean
+menuconfig/build/mconf::
+ @mkdir -p menuconfig/build
+ (cd menuconfig/build ; cmake -GNinja .. ; ninja -j4 )
-releng-64:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} releng
- @make clean
+menuconfig:menuconfig/build/mconf menuconfig-script/kernel_choice menuconfig-script/channel_choice
+ @menuconfig/build/mconf menuconfig-script/rootconf
-lxde-64:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_x86_64} lxde
- @make clean
+menuconfig-script/kernel_choice:system/kernel-x86_64 system/kernel-i686
+ @${CURRENT_DIR}/tools/kernel-choice-conf-gen.sh
+menuconfig-script/channel_choice:
+ @${CURRENT_DIR}/tools/channel-choice-conf-gen.sh
-xfce-32:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} xfce
- @make clean
+build_option:
+ @if [ ! -f .config ]; then make menuconfig ; fi
+ ${CURRENT_DIR}/tools/menuconf-to-alterconf.sh ${CURRENT_DIR}/.build_option
-plasma-32:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} plasma
- @make clean
+clean:
+ @sudo ${CURRENT_DIR}/${BUILD_SCRIPT} --noconfirm clean
-releng-32:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} releng
- @make clean
+build:build_option
+ $(eval BUILD_OPTION := $(shell cat ${CURRENT_DIR}/.build_option))
+ @sudo ${CURRENT_DIR}/${BUILD_SCRIPT} ${BUILD_OPTION}
-lxde-32:
- @sudo ./${BUILD_SCRIPT} ${SHARE_OPTION} ${ARCH_i686} lxde
- @make clean
+keyring::
+ @sudo ${CURRENT_DIR}/tools/keyring.sh --alter-add --arch-add
-menuconfig/build/mconf::
- @if [ -d menuconfig/build ];\
- then \
- :;\
- else \
- mkdir menuconfig/build ;\
- fi
- (cd menuconfig/build ; cmake -GNinja .. ; ninja -j4 )
+wizard:
+ @sudo ${CURRENT_DIR}/tools/wizard.sh
-menuconfig:menuconfig/build/mconf menuconfig-script/kernel_choice
- menuconfig/build/mconf menuconfig-script/rootconf
-menuconfig-script/kernel_choice:system/kernel_list-x86_64 system/kernel_list-i686
- ./kernel-choice-conf-gen.sh
-build_option:
- if [ -f .config ];\
- then \
- :;\
- else \
- make menuconfig ;\
- fi
- ./menuconf-to-alterconf.sh ./.build_option
-clean:
- @sudo ./build.sh clean
- @rm -rf menuconfig/build
- @rm -f menuconfig-script/kernel_choice
- @rm -f .config
- @rm -f .build_option
-build:build_option
- $(eval BUILD_OPTION := $(shell cat ./.build_option))
- sudo ./build.sh ${BUILD_OPTION}
-keyring::
- sudo ./keyring.sh --alter-add --arch-add
+check:
+ @bash -c 'shopt -s globstar nullglob; shellcheck -s bash --exclude=SC2068 -S error **/*.{sh,ksh,bash}'
+ @bash -c 'shopt -s globstar nullglob; shellcheck -s bash --exclude=SC2068 -S error tools/*.{sh,ksh,bash}'