KERNEL_VERSION:=$(shell [ -f mkkernel.sh ] && sed -n -e 's/^default_version=//p' mkkernel.sh) KERNEL_DIR:=/project/fli4l/kernel REPO:=$(shell pwd)/../../.. FLI4L_VER_FILE:=$(REPO)/base/version.txt ifeq ($(FLI4L_VER),) FLI4L_VER:=$(shell if [ -f $(FLI4L_VER_FILE) ]; then cat $(FLI4L_VER_FILE); fi) endif PATH:=$(REPO)/toolchain:$(PATH) export PATH # MKKERNEL:=sh mkkernel.sh -t $(KERNEL_DIR)/ MKKERNEL:=sh mkkernel.sh -t $(KERNEL_DIR)/ UPDATE:=update-kernel-svn.sh -c $(REPO) CHECK:=check-kernel.sh -c $(REPO) ifneq (,$(findstring local,$(MAKECMDGOALS))) MK_LOC:= CHK_LOC:=out-$(KERNEL_VERSION) else MK_LOC:=-d $(KERNEL_DIR) -i $(KERNEL_DIR)/$(FLI4L_VER)-$(KERNEL_VERSION) CHK_LOC:=$(KERNEL_DIR)/$(FLI4L_VER)-$(KERNEL_VERSION) endif all: kernel smp-kernel kernel: check_version $(MKKERNEL) $(MK_LOC) $(MKKERNEL_OPT) -all >kernel.log 2>&1 smp-kernel: check_version $(MKKERNEL) $(MK_LOC)-smp -f smp $(MKKERNEL_OPT) -all >smp-kernel.log 2>&1 check: check-kernel check-smp-kernel check-kernel: check_repo $(CHECK) -k $(CHK_LOC) check-smp-kernel: check_repo $(CHECK) -k $(CHK_LOC)-smp update: update-kernel update-smp-kernel update-kernel: check_repo $(UPDATE) -k $(CHK_LOC) -s update-kernel.sh $(FORCE) update-smp-kernel: check_repo $(UPDATE) -k $(CHK_LOC)-smp -s update-smp-kernel $(FORCE) check_version: @if [ ! "$(FLI4L_VER)" ]; then \ echo "invalid fli4l version, specify one in FLI4L_VER"; \ false; \ else \ true; \ fi check_repo: check_version @if [ ! -f $(REPO)/files.txt ]; then \ echo "invalid fli4l repository in REPO='$(REPO)'" ; \ false ; \ else \ true ; \ fi version: @echo "Building kernel version $(KERNEL_VERSION)" help: @cat Makefile.help local: @echo "building local kernel" .PHONY: local