Files
mckernel/kernel/Makefile.in
Dominique Martinet 516ab87ab9 Copyrights: fujitsu 2018 bump
Separate copyright bumps in a different commit.
A lot of files only had the copyright change at this point; these
were probably changes I added separatly in other patches but just
split these in a different commit instead to simplify git stats

Change-Id: I93cf3fc1c0fa04ee743a79c3fe9768933e6bd0d2
2019-02-01 13:18:52 +09:00

55 lines
1.3 KiB
Makefile

# Makefile.in COPYRIGHT FUJITSU LIMITED 2013-2018
BUILD_TARGET ?= @TARGET@
KERNDIR=@KERNDIR@
VPATH=@abs_srcdir@
ARCH ?= @ARCH@
ifeq ($(ARCH), arm64)
vdsodir=@abs_builddir@/../arch/$(ARCH)/kernel/vdso
endif
IHKBASE ?= $(VPATH)/../../ihk/cokernel
O ?= $(CURDIR)/build
V ?= $(VERBOSE)
KERNEL = kernel.img
KERNELS = $(addsuffix /$(KERNEL),$(addprefix $(O)/,$(BUILD_TARGET)))
SUBCMD_OPTS = V='$(V)' BUILD_IHK_COKERNEL=@abs_builddir@/../../ihk/cokernel
$(if $(O),,$(error Specify the compilation target directory))
#$(if $(shell ls $(IHKBASE)/Makefile),,\
# $(error IHK is not found in $(IHKBASE)))
.PHONY: all clean depend install
all: $(O) $(KERNELS)
$(O):
mkdir -p $(O)
%/kernel.img: %/Makefile $(KERNELS)
@echo 'Building for' $(dir $@)
+@make --no-print-directory -C $(dir $@) $(SUBCMD_OPTS)
%/Makefile: Makefile.build FORCE
@mkdir -p $(dir $@)
@echo 'SRC = $(SRC)' > $@
@echo 'IHKBASE = $(IHKBASE)' >> $@
@echo 'TARGET = $(notdir $(patsubst %/,%,$(dir $@)))' >> $@
@echo 'TARGETDIR = smp/$(ARCH)' >> $@
@cat Makefile.build >> $@
@rm -f $(dir $@)/Makefile.dep
clean:
rm -rf $(O)
ifeq ($(ARCH), arm64)
@rm -f $(vdsodir)/*.o $(vdsodir)/vdso.* $(vdsodir)/Makefile.dep -r $(vdsodir)/../include
endif
install:
mkdir -p -m 755 $(KERNDIR)
install -m 755 $(O)/$(BUILD_TARGET)/kernel.img $(KERNDIR)/mckernel.img
FORCE: