Skip to content

Commit

Permalink
Got rid of ANSI in the Makefile - not all shells+terminals provide that.
Browse files Browse the repository at this point in the history
  • Loading branch information
fingon committed Sep 17, 2014
1 parent 2a9b149 commit bd1cc0d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ default: help
.PHONY: help
help:
@echo
@echo -e "\e[1mAvailable targets are:\e[0m"
@echo "Available targets are:"
@echo
@echo -e " \e[1mkernel\e[0m Build a Netkit kernel. The current directory must contain"
@echo " kernel Build a Netkit kernel. The current directory must contain"
@echo " the source $(KERNEL_SUFFIX) package for vanilla kernel $(KERNEL_RELEASE)."
@echo " If no such package is available, the makefile will attempt"
@echo " to automatically download one. Other files required for the"
@echo " build will be automatically downloaded too."
@echo
@echo -e " \e[1mpackage\e[0m Create a distributable tarball of the Netkit kernel."
@echo " package Create a distributable tarball of the Netkit kernel."
@echo
@echo -e " \e[1mclean\e[0m Remove files from previous builds."
@echo " clean Remove files from previous builds."
@echo
@echo -e "\e[1mAvailable variables are:\e[0m"
@echo "Available variables are:"
@echo
@echo -e " \e[1mSUBARCH\e[0m Specifies the target architecture on which the kernel is"
@echo " SUBARCH Specifies the target architecture on which the kernel is"
@echo " supposed to run. Possible values are: i386, ia64, ppc, and"
@echo " x86_64 (default: $(SUBARCH))."
@echo
@echo -e " \e[1mKERNEL_RELEASE\e[0m Specifies the version of the kernel to be compiled"
@echo " KERNEL_RELEASE Specifies the version of the kernel to be compiled"
@echo " (default: $(KERNEL_RELEASE))."
@echo

Expand All @@ -72,7 +72,7 @@ kernel: netkit-kernel

.SILENT: netkit-kernel
netkit-kernel: $(BUILD_DIR)/$(KERNEL_DIR)/.config
echo -e "\n\e[1m\e[32m========= Compiling the kernel... ========\e[0m"
echo "\n========= Compiling the kernel... ========"
mkdir -p $(BUILD_DIR)/$(PACKAGE_DIR)/netkit/kernel
+$(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR)/ all ARCH=um SUBARCH=$(SUBARCH) INSTALL_MOD_PATH="../../$(BUILD_DIR)/$(PACKAGE_DIR)/netkit/kernel/$(MODULES_DIR)"
+$(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR)/ modules ARCH=um SUBARCH=$(SUBARCH) INSTALL_MOD_PATH="../../$(BUILD_DIR)/$(PACKAGE_DIR)/netkit/kernel/$(MODULES_DIR)"
Expand All @@ -83,28 +83,28 @@ netkit-kernel: $(BUILD_DIR)/$(KERNEL_DIR)/.config

.SILENT: $(BUILD_DIR)/$(KERNEL_DIR)/.patched
$(BUILD_DIR)/$(KERNEL_DIR)/.patched: $(BUILD_DIR)/$(KERNEL_DIR)/.unpacked
echo -e "\n\e[1m\e[32m========== Applying patches... ==========\e[0m"
echo "\n========== Applying patches... =========="
cd $(CURDIR)/$(BUILD_DIR)/$(KERNEL_DIR) && find "$(CURDIR)/$(PATCHES_DIR)" -name "*.diff" -type f -print0 | xargs -I '{}' -0 -n 1 /bin/sh -c "patch -p1 < '{}'"
: > $(BUILD_DIR)/$(KERNEL_DIR)/.patched

.SILENT: $(BUILD_DIR)/$(KERNEL_DIR)/.config
$(BUILD_DIR)/$(KERNEL_DIR)/.config: netkit-kernel-config-$(SUBARCH) $(BUILD_DIR)/$(KERNEL_DIR)/.patched
echo -e "\n\e[1m\e[32m======= Configuring the kernel... ========\e[0m"
echo "\n======= Configuring the kernel... ========"
ln -fs netkit-kernel-config-$(SUBARCH) netkit-kernel-config-$(SUBARCH)-$(KERNEL_RELEASE)-$(NK_KERNEL_RELEASE)
sed 's/CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION="-netkit-$(NK_KERNEL_RELEASE)"/' netkit-kernel-config-$(SUBARCH) > $(BUILD_DIR)/$(KERNEL_DIR)/.config
+$(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR)/ silentoldconfig ARCH=um SUBARCH=$(SUBARCH)

.SILENT: $(BUILD_DIR)/$(KERNEL_DIR)/.unpacked
$(BUILD_DIR)/$(KERNEL_DIR)/.unpacked: $(KERNEL_PACKAGE)
echo -e "\n\e[1m\e[32m======== Unpacking the kernel... =========\e[0m"
echo "\n======== Unpacking the kernel... ========="
mkdir -p $(BUILD_DIR)
unxz < $(KERNEL_PACKAGE) | tar -C $(BUILD_DIR) -xf -
: > $(BUILD_DIR)/$(KERNEL_DIR)/.unpacked

pull: $(KERNEL_PACKAGE)

$(KERNEL_PACKAGE):
echo -e "\n\e[1m\e[33m====== Retrieving kernel tarball... ======\e[0m"
echo "\n====== Retrieving kernel tarball... ======"
wget $(KERNEL_URL)

.PHONY: package
Expand Down

0 comments on commit bd1cc0d

Please sign in to comment.