GENODE_DIR  := /home/parfait/git/genode1
BASE_DIR    := $(GENODE_DIR)/repos/base
CONTRIB_DIR := $(GENODE_DIR)/contrib

# enable parallel build
MAKE += -j4


##
## Run-tool configuration
##

# kernel to use (nova, hw, sel4, linux, or foc)
KERNEL ?= nova

# local variable for run-tool arguments used for running scenarios in Qemu
QEMU_RUN_OPT := --include power_on/qemu  --include log/qemu --include image/uefi

# local varible for run-tool arguments that depend on the used kernel
KERNEL_RUN_OPT(nova)  := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(hw)    := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(sel4)  := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(foc)   := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux

ifdef KERNEL
RUN_OPT += ${KERNEL_RUN_OPT(${KERNEL})} --include boot_dir/$(KERNEL)
endif


##
## Qemu arguments, effective when using the run tool's 'power_on/qemu' back end
##

# enable GDB stub
#QEMU_OPT += -s

# prevent Qemu from using KVM
QEMU_OPT += -no-kvm

# use time-tested graphics backend
QEMU_OPT += -display sdl

# use machine model that supports nested virtualization
QEMU_OPT(nova) += -cpu core2duo

# add kernel-specific Qemu arguments
QEMU_OPT += $(QEMU_OPT(${KERNEL}))


##
## Kernel-specific repository
##

ifdef KERNEL
REPOSITORIES += $(GENODE_DIR)/repos/base-$(KERNEL)
endif


##
## Repositories needed for the default demo scenario
##

REPOSITORIES += $(GENODE_DIR)/repos/base
REPOSITORIES += $(GENODE_DIR)/repos/os
REPOSITORIES += $(GENODE_DIR)/repos/demo


##
## Optional repositories
##

#
# Ports of popular open-source libraries and the C library.
#
# Make sure to execute 'make prepare' in 'libports' prior building.
#
REPOSITORIES += $(GENODE_DIR)/repos/libports

#
# Ports of popular 3rd-party applications
#
# The 'ports' repository depends on 'libc' and 'libports'.
# Make sure to execute 'make prepare' in 'ports' prior building.
#
REPOSITORIES += $(GENODE_DIR)/repos/ports

#
# Ports of the Linux TCP/IP stack and Linux drivers (USB) from the Linux kernel
#
REPOSITORIES += $(GENODE_DIR)/repos/dde_linux

#
# NetBSD file-system support
#
REPOSITORIES += $(GENODE_DIR)/repos/dde_rump

#
# High-level Genode-specific services and applications
#
# The 'gems' repository depends on 'libc' and 'libports'.
#
REPOSITORIES += $(GENODE_DIR)/repos/gems

#
# Collection of community-maintained components
#
# Please follow the instructions provided at:
#
#   https://github.com/genodelabs/genode-world
#
REPOSITORIES += $(GENODE_DIR)/repos/world

#
# Drivers ported from the OpenBSD
#
REPOSITORIES += $(GENODE_DIR)/repos/dde_bsd

#
# Drivers ported from iPXE
#
REPOSITORIES += $(GENODE_DIR)/repos/dde_ipxe

#
# Drivers ported from Zircon
#
REPOSITORIES += $(GENODE_DIR)/repos/dde_zircon

