2 # Jailhouse, a Linux-based partitioning hypervisor
4 # Copyright (c) Siemens AG, 2013, 2014
7 # Jan Kiszka <jan.kiszka@siemens.com>
9 # This work is licensed under the terms of the GNU GPL, version 2. See
10 # the COPYING file in the top-level directory.
13 CC = $(CROSS_COMPILE)gcc
15 CFLAGS = -g -O3 -I../driver -DLIBEXECDIR=\"$(libexecdir)\" \
16 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
17 -DJAILHOUSE_VERSION=\"$(shell cat ../VERSION)\" $(EXTRA_CFLAGS)
21 INST_TARGETS := $(TARGETS)
23 jailhouse-cell-linux \
25 jailhouse-cell-stats \
26 jailhouse-config-create \
27 jailhouse-hardware-check
28 TEMPLATES := jailhouse-config-collect.tmpl root-cell-config.c.tmpl
31 $(shell python -c "from mako.template import Template" 2>/dev/null \
34 ifeq ($(strip $(HAS_PYTHON_MAKO)), yes)
35 TARGETS += jailhouse-config-collect
36 HELPERS += jailhouse-config-collect
38 TARGETS += no_python_mako
42 sed -i 's|^$1 = None|$1 = "$($1)"|' $2
45 # no recipes above this one (also no includes)
48 # includes installation-related variables and definitions
49 include ../scripts/include.mk
51 jailhouse: jailhouse.c ../driver/jailhouse.h ../VERSION
52 $(CC) $(CFLAGS) -o $@ $<
54 jailhouse-config-collect: jailhouse-config-create jailhouse-config-collect.tmpl
58 install-bin: $(INST_TARGETS) $(DESTDIR)$(sbindir)
61 install-libexec: $(HELPERS) $(DESTDIR)$(libexecdir)/jailhouse
63 $(Q)$(call patch_dirvar,libexecdir,$(lastword $^)/jailhouse-cell-linux)
64 $(Q)$(call patch_dirvar,datadir,$(lastword $^)/jailhouse-config-create)
66 install-data: $(TEMPLATES) $(DESTDIR)$(datadir)/jailhouse
69 install: install-bin install-libexec install-data
75 @echo -ne "WARNING: Could not create the helper script to generate" \
76 "configurations on remote machines" \
77 "(\"jailhouse-conf-collect\"). You need Python and the" \
78 "Mako library for it.\n"
80 .PHONY: install install-bin install-libexec install-data clean no_python_mako