Permalink
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (45 sloc) 1.49 KB
#
# Jailhouse, a Linux-based partitioning hypervisor
#
# Copyright (c) Siemens AG, 2013-2017
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
# Benjamin Block <bebl@mageta.org>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
INC_CONFIG_H = $(src)/include/jailhouse/config.h
export INC_CONFIG_H
define filechk_config_mk
( \
echo "\$$(foreach config,\$$(filter CONFIG_%, \$$(.VARIABLES)), \
\$$(eval undefine \$$(config)))"; \
if [ -f $(INC_CONFIG_H) ]; then \
sed -e "/^#define \([^[:space:]]*\)[[:space:]]*1/!d; \
s/^#define \([^[:space:]]*\)[[:space:]]*1/\1=y/"\
$(INC_CONFIG_H); \
fi \
)
endef
GEN_CONFIG_MK := $(obj)/hypervisor/include/generated/config.mk
export GEN_CONFIG_MK
$(GEN_CONFIG_MK): $(src)/Makefile FORCE
$(call filechk,config_mk)
define filechk_version
$(src)/scripts/gen_version_h $(src)/
endef
GEN_VERSION_H := $(obj)/hypervisor/include/generated/version.h
$(GEN_VERSION_H): $(src)/Makefile FORCE
$(call filechk,version)
subdir-y := driver hypervisor configs inmates tools
subdir-ccflags-y := -Werror
# Do not generate files by creating dependencies if we are cleaning up
ifeq ($(filter %/Makefile.clean,$(MAKEFILE_LIST)),)
$(addprefix $(obj)/,$(subdir-y)): $(GEN_CONFIG_MK)
$(obj)/driver $(obj)/hypervisor: $(GEN_VERSION_H)
endif
clean-files := pyjailhouse/*.pyc
clean-dirs := Documentation/generated hypervisor/include/generated \
pyjailhouse/__pycache__