Implement a graph-based build system.
This commit is contained in:
Ehmry - 2019-03-02 15:23:50 +01:00
parent 4952b37e4c
commit 59ab4ef6bc
117 changed files with 1512 additions and 23 deletions

9
.gitignore vendored
View File

@ -8,4 +8,11 @@
/depot
/public
/repos/world
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
.tup
/.gitignore
/bin.dhall
/dev
/out

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "repos/base-nova/src/NOVA"]
path = repos/base-nova/src/NOVA
url = git://depot.h4ck.me/srv/git/NOVA

19
Tupfile Normal file
View File

@ -0,0 +1,19 @@
ifeq (@(TUP_ARCH),x86_64)
DEPOT_ARCH = x86_64
endif
ifeq ($(DEPOT_ARCH),)
error unhandled TUP_ARCH @(TUP_ARCH)
endif
include_rules
DEPOT_MANIFEST = $(OUTPUTS_OUT)/manifest.dhall
: $(OUTPUTS_OUT)/<bin> |> \
echo %<bin> \
| awk -F '/' --assign RS=' ' 'BEGIN { print "{=}"} {print "∧{"$3"={=}}" }' \
| dhall > %o\
|> bin.dhall {records}
: | {records} |> !dhall <<< '{bin = { $(DEPOT_ARCH) = ./bin.dhall } }' > %o |> $(DEPOT_MANIFEST)

159
Tuprules.tup Normal file
View File

@ -0,0 +1,159 @@
.gitignore
OUTPUTS_OUT=$(TUP_CWD)/out
OUTPUTS_DEV=$(TUP_CWD)/dev
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
TOOL_CHAIN_PREFIX=genode-x86-
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
OUT_BIN_DIR = $(OUTPUTS_OUT)/bin
GENODE_DIR = $(TUP_CWD)
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!prg = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> \
|> ^o LD %o^ \
$(LD) $(LD_MARCH) $(LDFLAGS) \
-L$(LIB_DIR) \
`$(PKG_CONFIG) --libs $(LIBS) genode-prg` \
%f \
$(LIBGCC) \
-o %o \
|> %d
!lib = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LD_MARCH) %f $(LDFLAGS) `$(PKG_CONFIG) --libs genode-lib $(LIBS)` -L$(LIB_DIR) -o %o |>
ifeq ($(BIN_NAME),)
BIN_NAME = $(TARGET_NAME)
endif
ifdef DEPOT_VERSION
DEPOT_VERSION = @(DEPOT_VERSION)
else
DEPOT_VERSION = current
endif
BIN_VERSION=$(DEPOT_VERSION)
BIN_DIR = $(OUT_BIN_DIR)/$(BIN_NAME)/$(DEPOT_VERSION)
# Destination for locally defined binary package
!bin = |> |>
# Macro invoked in BIN_RULES
&BIN_RULES = errata/bin.tup
# Rules for finalizing a locally defined binary package
!collect_bin = |> ^ COLLECT %b^ \
$STRIP -o %o %f \
|> $(OUT_BIN_DIR)/$(BIN_NAME)/%b $(OUTPUTS_OUT)/<bin>
export CC
export CXX
export LD
CC = $CC
CXX = $CXX
LD= $LD
OBJCOPY = $OBJCOPY
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wsystem-headers -Werror
#CXXFLAGS += -Wno-unused-command-line-argument
export NIX_PATH
NIX_BUILD = nix-build --option substitute no
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
LIB_DIR = $(OUTPUTS_DEV)/lib
PKG_CONFIG_DIR = $(OUTPUTS_DEV)/lib/pkgconfig
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR) pkg-config
DEFINES += -g
OLEVEL = -O0
!ir = | $(GENODE_DIR)/<pkg-config> |> clang $(OLEVEL) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(INCLUDES) -c %f -o %o |> %B.o
!cc = | $(GENODE_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` $(INCLUDES) -c -fPIC %f -o %o |> %B.o
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c -fPIC %f -o %o |> %B.o
!ld = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
export STRIP
!strip = |> $STRIP -o %o %f |>
!ln = |> ln -s %f %o |>
&LD_SCRIPT_SO = repos/base/src/ld/genode_rel.ld
ifeq (@(TUP_ARCH),x86_64)
ASM_SYM_DEPENDENCY = movq \1@GOTPCREL(%rip), %rax
else
ASM_SYM_DEPENDENCY = .long \1
endif
!abi_stub = |> ^ STUB %o^\
sed \
-e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%%object; \1:/" \
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%%function; \1:/" \
-e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/" \
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/" \
%f \
| $(CC) -x assembler -c - -o tmp.o; \
$(LD) -o %o \
-shared \
-T &(LD_SCRIPT_SO) \
tmp.o; \
rm tmp.o; \
|> $(OUTPUTS_DEV)/lib/%B.lib.so $(GENODE_DIR)/<lib>
!dhall = |> ^b dhall > %o^ dhall |>
ifeq (@(TUP_ARCH),i386)
AS_MARCH = -march=i686 --32
endif
BASE_DIR = $(GENODE_DIR)/repos/base
&BASE_DIR = repos/base
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %f | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o
export AR
!ar = |> ^ MERGE %o^ $AR -rcs %o %f |>
export TOOLCHAIN_DIR
SED_FLAGS += -e "s|@DEPOT_VERSION@|$(DEPOT_VERSION)|"
!sed_pkgconfig_file = |> ^o SED %B^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) < %f > %o; \
pkg-config --validate %o; \
|> $(PKG_CONFIG_DIR)/%B $(GENODE_DIR)/<pkg-config>
!sed_pkgconfig_flags = |> ^o SED %d.pc^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) > %o; \
pkg-config --validate %o; \
|> $(PKG_CONFIG_DIR)/%d.pc $(GENODE_DIR)/<pkg-config>

14
errata/bin.tup Normal file
View File

@ -0,0 +1,14 @@
ifeq ($(BIN_NAME),)
error BIN_NAME is empty
endif
ifeq ($(BIN_VERSION),)
error BIN_VERSION is empty
endif
: |> !bin |>
# Finalize the metadata with the macro defined in the
# ../Tuprules.tup. The macro cannot be defined here
# because the "include" directive is not available for
# relative paths during "include_rules" so this file
# cannot be included by intermediate Tuprules.tup.

0
errata/pkg.tup Normal file
View File

14
errata/raw.tup Normal file
View File

@ -0,0 +1,14 @@
ifeq ($(RAW_NAME),)
error RAW_NAME is empty
endif
ifeq ($(RAW_VERSION),)
error RAW_VERSION is empty
endif
: |> !raw |>
# Finalize the metadata with the macro defined in the
# ../Tuprules.tup. The macro cannot be defined here
# because the "include" directive is not available for
# relative paths during "include_rules" so this file
# cannot be included by intermediate Tuprules.tup.

View File

@ -0,0 +1,2 @@
include &(BASE_DIR)/Tuprules.tup
REP_DIR = $(TUP_CWD)

View File

@ -0,0 +1,63 @@
TARGET_NAME = core-linux
include_rules
GEN_CORE_DIR = $(BASE_DIR)/src/core
DEFINES += -D_GNU_SOURCE
INCLUDES += \
-I$(REP_DIR)/src/core/include \
-I$(GEN_CORE_DIR)/include \
-I$(REP_DIR)/src/platform \
-I$(REP_DIR)/src/include \
-I$(BASE_DIR)/src/include \
include $(REP_DIR)/src/lib/syscall/headers.tup
SRC_CC += \
*.cc \
$(REP_DIR)/src/lib/base/env_reinit.cc \
$(BASE_DIR)/src/lib/base/thread.cc \
$(BASE_DIR)/src/lib/base/thread_myself.cc \
$(GEN_CORE_DIR)/capability_space.cc \
$(GEN_CORE_DIR)/core_log.cc \
$(GEN_CORE_DIR)/core_rpc_cap_alloc.cc \
$(GEN_CORE_DIR)/cpu_session_component.cc \
$(GEN_CORE_DIR)/cpu_session_support.cc \
$(GEN_CORE_DIR)/cpu_thread_component.cc \
$(GEN_CORE_DIR)/default_log.cc \
$(GEN_CORE_DIR)/heartbeat.cc \
$(GEN_CORE_DIR)/main.cc \
$(GEN_CORE_DIR)/pd_session_component.cc \
$(GEN_CORE_DIR)/pd_session_support.cc \
$(GEN_CORE_DIR)/platform_services.cc \
$(GEN_CORE_DIR)/ram_dataspace_factory.cc \
$(GEN_CORE_DIR)/rpc_cap_factory_l4.cc \
$(GEN_CORE_DIR)/signal_receiver.cc \
$(GEN_CORE_DIR)/signal_source_component.cc \
$(GEN_CORE_DIR)/signal_transmitter_proxy.cc \
$(GEN_CORE_DIR)/trace_session_component.cc \
$(GEN_CORE_DIR)/version.cc \
CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
: foreach $(SRC_CC) |> !cxx |> {obj}
LDFLAGS += \
$(LD_MARCH) \
-gc-sections \
-z max-page-size=0x1000 \
-nostdlib \
-Ttext=0x01000000 \
-T$(BASE_DIR)/src/ld/genode.ld \
-T$(REP_DIR)/src/ld/stack_area.ld \
CORE_LIBS += \
$(BASE_DIR)/src/lib/cxx/cxx.lib.a \
$(BASE_DIR)/src/lib/startup/startup.lib.a \
$(REP_DIR)/src/lib/base/base-linux-common.lib.a \
$(REP_DIR)/src/lib/syscall/syscall-linux.lib.a \
: {obj} $(CORE_LIBS) |> !ld |> core-linux $(REP_DIR)/<core> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,74 @@
# DANGER: any source or header here may be ovelayed by $(BASE_DIR)
include_rules
INCLUDES += -I$(REP_DIR)/src/include
INCLUDES += -I$(REP_DIR)/src/lib/syscall
INCLUDES += -I$(BASE_DIR)/src/include
export HOST_LIBC
# an environmental variable set by nix-shell
INCLUDES += -I$HOST_LIBC/include
BASE_LIB_DIR = $(BASE_DIR)/src/lib/base
COMMON_SRC_CC += \
$(BASE_DIR)/src/lib/base/allocator_avl.cc \
$(BASE_DIR)/src/lib/base/avl_tree.cc \
$(BASE_DIR)/src/lib/base/child.cc \
$(BASE_DIR)/src/lib/base/component.cc \
$(BASE_DIR)/src/lib/base/console.cc \
$(BASE_DIR)/src/lib/base/elf_binary.cc \
$(BASE_DIR)/src/lib/base/entrypoint.cc \
$(BASE_DIR)/src/lib/base/env_session_id_space.cc \
$(BASE_DIR)/src/lib/base/heap.cc \
$(BASE_DIR)/src/lib/base/lock.cc \
$(BASE_DIR)/src/lib/base/log.cc \
$(BASE_DIR)/src/lib/base/output.cc \
$(BASE_DIR)/src/lib/base/raw_output.cc \
$(BASE_DIR)/src/lib/base/registry.cc \
$(BASE_DIR)/src/lib/base/root_proxy.cc \
$(BASE_DIR)/src/lib/base/session_state.cc \
$(BASE_DIR)/src/lib/base/signal_common.cc \
$(BASE_DIR)/src/lib/base/slab.cc \
$(BASE_DIR)/src/lib/base/sliced_heap.cc \
$(BASE_DIR)/src/lib/base/stack_allocator.cc \
$(BASE_DIR)/src/lib/base/stack_protector.cc \
$(BASE_LIB_DIR)/capability.cc \
$(BASE_LIB_DIR)/rpc_dispatch_loop.cc \
$(BASE_LIB_DIR)/rpc_entrypoint.cc \
$(BASE_LIB_DIR)/sleep.cc \
$(BASE_LIB_DIR)/trace.cc \
$(BASE_LIB_DIR)/vm_session.cc \
child_process.cc \
debug.cc \
ipc.cc \
region_map_client.cc \
region_map_mmap.cc \
rm_session_client.cc \
thread_env.cc \
: foreach $(COMMON_SRC_CC) |> !cxx |> %B.o {base-common-obj}
: {base-common-obj} |> !ar |> base-linux-common.lib.a
SRC_CC += \
$(BASE_LIB_DIR)/capability_space.cc \
$(BASE_LIB_DIR)/default_log.cc \
$(BASE_LIB_DIR)/env_deprecated.cc \
$(BASE_LIB_DIR)/heartbeat.cc \
$(BASE_LIB_DIR)/main_thread_cap.cc \
$(BASE_LIB_DIR)/rpc_cap_alloc.cc \
$(BASE_LIB_DIR)/signal.cc \
$(BASE_LIB_DIR)/signal_transmitter.cc \
$(BASE_LIB_DIR)/stack_area.cc \
$(BASE_LIB_DIR)/thread.cc \
$(BASE_LIB_DIR)/thread_myself.cc \
attach_stack_area.cc \
capability_raw.cc \
env_reinit.cc \
platform_env.cc \
thread_linux.cc \
: foreach $(SRC_CC) |> !cxx |> {base-obj}
: {base-obj} |> !ar |> base-linux.lib.a

View File

@ -0,0 +1,62 @@
TARGET_NAME = base-linux
include_rules
ifeq (@(TUP_ARCH),x86_64)
INCLUDES += -I$(BASE_DIR)/src/lib/ldso/spec/x86_64
endif
INCLUDES += -I$(BASE_DIR)/src/include
LDSO_DIR = $(BASE_DIR)/src/lib/ldso
ifeq (@(TUP_ARCH),x86_64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
endif
INCLUDES += -I$(LDSO_SPEC_DIR)
INCLUDES += -I$(LDSO_DIR)/include
DEFINES += -fPIC
: foreach $(LDSO_DIR)/*.cc |> !cxx |> {obj}
: foreach $(LDSO_SPEC_DIR)/*.s |> !asm |> {obj}
LDFLAGS += -shared --eh-frame-hdr
: $(BASE_DIR)/lib/symbols/ld \
|> \
echo -e '{\n\tglobal:' >> %o; \
sed -n "s/^\(\w\+\) .*/\t\t\1;/p" %f >> %o; \
echo -e "\tlocal: *;\n};" >> %o; \
|> symbol.map
LDFLAGS += -Bsymbolic-functions --version-script=symbol.map
LDFLAGS += -gc-sections -z max-page-size=0x1000
LDFLAGS += -T$(REP_DIR)/src/ld/stack_area.ld
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
LDFLAGS += --entry=_start_initial_stack
BASE_LIBS += \
$(BASE_DIR)/src/lib/alarm/alarm.lib.a \
$(REP_DIR)/src/lib/base/base-linux-common.lib.a \
$(REP_DIR)/src/lib/base/base-linux.lib.a \
$(BASE_DIR)/src/lib/cxx/cxx.lib.a \
$(BASE_DIR)/src/lib/ldso/startup/ldso-startup.lib.a \
$(BASE_DIR)/src/lib/startup/startup.lib.a \
$(REP_DIR)/src/lib/syscall/syscall-linux.lib.a \
$(BASE_DIR)/src/lib/timeout/timeout.lib.a \
: $(BASE_LIBS) {obj} | symbol.map \
|> \
$(LD) -o %o \
$(LD_MARCH) $(LDFLAGS) \
--whole-archive --start-group \
%f \
--end-group --no-whole-archive \
$(LIBGCC) ;\
printf "\x02" | dd of=%o bs=1 seek=16 count=1 conv=notrunc ; \
|> ld-linux.lib.so $(REP_DIR)/<ld> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,13 @@
include_rules
include $(REP_DIR)/src/lib/syscall/headers.tup
INCLUDES += -I$(REP_DIR)/src/include
INCLUDES += -I$(BASE_DIR)/src/include
STATIC_LIBS = \
../base/base-linux-common.lib.a \
$(BASE_DIR)/src/lib/timeout/timeout.lib.a \
: foreach *.cc $(BASE_DIR)/src/lib/cxx/new_delete.cc |> !cxx |> {obj}
: foreach *.c |> !cc |> {obj}
: {obj} $(STATIC_LIBS) |> !ar |> %d.lib.a

View File

@ -0,0 +1,22 @@
include_rules
SPEC_DIR=
ifeq (@(TUP_ARCH),i386)
SPEC_DIR = spec/x86_32
endif
ifeq (@(TUP_ARCH),x86_64)
SPEC_DIR = spec/x86_64
endif
ifeq (@(TUP_ARCH),arm)
SPEC_DIR = spec/arm
endif
ifeq ($(SPEC_DIR),)
error syscall library is missing rules for @(TUP_ARCH)
endif
: foreach $(SPEC_DIR)/*.S |> !asm |> {obj}
: {obj} |> !ar |> syscall-linux.lib.a

View File

@ -0,0 +1,5 @@
INCLUDES += -I$(REP_DIR)/src/lib/syscall
export HOST_LIBC
# an environmental variable set by nix-shell
INCLUDES += -I$HOST_LIBC/include

View File

@ -47,7 +47,7 @@
#include <linux/futex.h>
#include <unistd.h>
#include <signal.h>
#include <sched.h>
#include <linux/sched.h>
#include <sys/syscall.h>
#include <sys/un.h>
#include <sys/socket.h>

View File

@ -0,0 +1,22 @@
TARGET_NAME = linux_timer_drv
LIBS += genode-base
include_rules
BASE_TIMER_DIR = $(BASE_DIR)/src/timer
PERIODIC_DIR = $(BASE_TIMER_DIR)/periodic
INCLUDES += -I.
INCLUDES += -I$(BASE_TIMER_DIR)/include
INCLUDES += -I$(PERIODIC_DIR)
include $(REP_DIR)/src/lib/syscall/headers.tup
: foreach $(BASE_TIMER_DIR)/*.cc |> !cxx |> %B.linux.o {obj}
: foreach $(PERIODIC_DIR)/*.cc |> !cxx |> %B.linux.o {obj}
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} $(REP_DIR)/src/lib/syscall/syscall-linux.lib.a |> !prg |> timer {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,12 @@
ifeq (@(TUP_ARCH),x86_32)
INCLUDES += -I$(TUP_CWD)/include/spec/64bit
endif
ifeq (@(TUP_ARCH),x86_64)
INCLUDES += -I$(TUP_CWD)/include/spec/64bit
endif
INCLUDES += -I$(TUP_CWD)/include
include &(BASE_DIR)/Tuprules.tup
REP_DIR = $(TUP_CWD)

@ -0,0 +1 @@
Subproject commit fbb002d4d6e2b6eddae4d1f0990fe71307e8c7ca

View File

@ -0,0 +1 @@
INCLUDES += -I$(REP_DIR)/src/include

View File

@ -0,0 +1,59 @@
ifeq (@(BUILD_NOVA),y)
include_rules
GEN_CORE_DIR = $(BASE_DIR)/src/core
INCLUDES += \
-I$(REP_DIR)/src/core/include \
-I$(REP_DIR)/src/include \
-I$(BASE_DIR)/src/include \
-I$(GEN_CORE_DIR)/include \
-I$(BASE_DIR)/include \
ifeq (@(TUP_ARCH),i386)
SRC_CC += spec/x86_32/*.cc
endif
ifeq (@(TUP_ARCH),x86_64)
SRC_CC += spec/x86_64/*.cc
endif
SRC_CC += \
*.cc \
$(GEN_CORE_DIR)/core_log.cc \
$(GEN_CORE_DIR)/core_mem_alloc.cc \
$(GEN_CORE_DIR)/cpu_session_component.cc \
$(GEN_CORE_DIR)/cpu_session_support.cc \
$(GEN_CORE_DIR)/cpu_thread_component.cc \
$(GEN_CORE_DIR)/dataspace_component.cc \
$(GEN_CORE_DIR)/default_log.cc \
$(GEN_CORE_DIR)/dump_alloc.cc \
$(GEN_CORE_DIR)/heartbeat.cc \
$(GEN_CORE_DIR)/io_mem_session_component.cc \
$(GEN_CORE_DIR)/main.cc \
$(GEN_CORE_DIR)/pd_session_component.cc \
$(GEN_CORE_DIR)/platform_rom_modules.cc \
$(GEN_CORE_DIR)/ram_dataspace_factory.cc \
$(GEN_CORE_DIR)/region_map_component.cc \
$(GEN_CORE_DIR)/rom_session_component.cc \
$(GEN_CORE_DIR)/signal_receiver.cc \
$(GEN_CORE_DIR)/signal_transmitter_noinit.cc \
$(GEN_CORE_DIR)/spec/x86/io_port_session_component.cc \
$(GEN_CORE_DIR)/spec/x86/io_port_session_support.cc \
$(GEN_CORE_DIR)/stack_area.cc \
$(GEN_CORE_DIR)/trace_session_component.cc \
$(GEN_CORE_DIR)/vm_session_common.cc \
$(GEN_CORE_DIR)/version.cc \
CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
: foreach $(SRC_CC) |> !cxx |> {link-items}
: {link-items} |> !ar |> core-nova.lib.a
: core-nova.lib.a | $(REP_DIR)/<base-common> $(BASE_DIR)/<base-libs> \
|> $(LD) $(LD_MARCH) -u _start --whole-archive -r \
%<base-common> %<base-libs> %f -o %o \
|> core-nova.o $(REP_DIR)/<core>
endif

View File

@ -0,0 +1,46 @@
ifeq (@(BUILD_NOVA),y)
include_rules
INCLUDES += -I$(BASE_DIR)/src/include
BASE_LIB_DIR = $(BASE_DIR)/src/lib/base
include $(BASE_DIR)/src/lib/base/common.tup
COMMON_SRC_CC += \
$(BASE_DIR)/src/lib/base/child_process.cc \
$(BASE_DIR)/src/lib/base/thread.cc \
$(BASE_DIR)/src/lib/base/thread_myself.cc \
$(BASE_DIR)/src/lib/base/trace.cc \
capability.cc \
cap_map.cc \
ipc.cc \
region_map_client.cc \
rpc_entrypoint.cc \
signal_transmitter.cc \
sleep.cc \
stack_area_addr.cc \
stack.cc \
vm_session.cc \
: foreach $(COMMON_SRC_CC) |> !cxx |> nova-%B.o {base-common-obj}
: {base-common-obj} |> !ar |> base-nova-common.lib.a $(REP_DIR)/<base-common>
SRC_CC += \
rpc_cap_alloc.cc \
thread_start.cc \
$(BASE_LIB_DIR)/default_log.cc \
$(BASE_LIB_DIR)/env_deprecated.cc \
$(BASE_LIB_DIR)/stack_area.cc \
$(BASE_LIB_DIR)/env_reinit.cc \
$(BASE_LIB_DIR)/main_thread_cap.cc \
$(BASE_LIB_DIR)/heartbeat.cc \
$(BASE_LIB_DIR)/cache.cc \
$(BASE_LIB_DIR)/signal.cc \
: foreach $(SRC_CC) |> !cxx |> {base-obj}
: {base-obj} |> !ar |> base-nova.lib.a
endif

View File

@ -0,0 +1,64 @@
ifeq (@(BUILD_NOVA),y)
TARGET_NAME = base-nova
include_rules
INCLUDES += -I$(BASE_DIR)/src/include
LDSO_DIR = $(BASE_DIR)/src/lib/ldso
ifeq (@(TUP_ARCH),x86_64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
endif
INCLUDES += -I$(LDSO_SPEC_DIR)
INCLUDES += -I$(LDSO_DIR)/include
DEFINES += -fPIC
: foreach $(LDSO_DIR)/*.cc |> !cxx |> {obj}
: foreach $(LDSO_SPEC_DIR)/*.s |> !asm |> {obj}
LDFLAGS += -shared --eh-frame-hdr
: $(BASE_DIR)/lib/symbols/ld \
|> \
echo -e '{\n\tglobal:' >> %o; \
sed -n "s/^\(\w\+\) .*/\t\t\1;/p" %f >> %o; \
echo -e "\tlocal: *;\n};" >> %o; \
|> symbol.map
LDFLAGS += -Bsymbolic-functions --version-script=symbol.map
ifeq (@(TUP_ARCH),x86_32)
LDFLAGS += -T$(LDSO_DIR)/linux-32.ld
else
LDFLAGS += --entry=_start
LDFLAGS += -T$(LDSO_DIR)/linker.ld
endif
LDFLAGS += -gc-sections -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld \
BASE_LIBS += \
$(BASE_DIR)/src/lib/alarm/alarm.lib.a \
$(REP_DIR)/src/lib/base/base-nova-common.lib.a \
$(REP_DIR)/src/lib/base/base-nova.lib.a \
$(BASE_DIR)/src/lib/cxx/cxx.lib.a \
$(BASE_DIR)/src/lib/ldso/startup/ldso-startup.lib.a \
$(BASE_DIR)/src/lib/startup/startup.lib.a \
$(BASE_DIR)/src/lib/timeout/timeout.lib.a \
: $(BASE_LIBS) {obj} | symbol.map \
|> \
$(LD) -o %o \
$(LD_MARCH) $(LDFLAGS) \
--whole-archive --start-group \
%f \
--end-group --no-whole-archive \
$(LIBGCC) \
|> ld.lib.so $(REP_DIR)/<ld> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)
endif

View File

@ -0,0 +1,14 @@
TARGET_NAME = nova_timer_drv
LIBS += genode-base
include_rules
BASE_TIMER_DIR = $(BASE_DIR)/src/timer
INCLUDES += -I.
INCLUDES += -I$(BASE_TIMER_DIR)/include
: foreach *.cc $(BASE_TIMER_DIR)/*.cc |> !cxx |> %B.nova.o {obj}
: {obj} |> !prg |> timer {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

34
repos/base/Tupfile Normal file
View File

@ -0,0 +1,34 @@
include_rules
ifdef NIX_OUTPUTS_DEV
SED_FLAGS += -e "s|@includedir@|@(NIX_OUTPUTS_DEV)/include/base|"
SED_FLAGS += -e "s|@lddir@|@(NIX_OUTPUTS_DEV)/ld|"
else
SED_FLAGS += -e "s|@includedir@|`nix-store --add $(REP_DIR)/include`|"
SED_FLAGS += -e "s|@lddir@|`nix-store --add $(REP_DIR)/src/ld`|"
endif
SED_FLAGS += -e "s|@toolchainincludedir@|`$(CC) $(CC_MARCH) -print-file-name=include`|"
SED_FLAGS += -e "s|@libgcc@|`$(CC) $(CC_MARCH) -print-file-name=libgcc.a`|"
SED_FLAGS += -e "s|@cc@|$(CC)|"
SED_FLAGS += -e "s|@cxx@|$(CXX)|"
SED_FLAGS += -e "s|@ld@|$(LD)|"
SED_FLAGS += -e "s|@ar@|$(AR)|"
SED_FLAGS += -e "s|@ranlib@|$(RANLIB)|"
ifeq (@(TUP_ARCH),i386)
SED_FLAGS += -e 's|@spec_includes@|-I${includedir}/spec/x86_32 -I${includedir}/spec/x86 -I${includedir}/spec/32bit|'
endif
ifeq (@(TUP_ARCH),x86_64)
SED_FLAGS += -e 's|@spec_includes@|-I${includedir}/spec/x86_64 -I${includedir}/spec/x86 -I${includedir}/spec/64bit|'
endif
ifeq (@(TUP_ARCH),arm64)
SED_FLAGS += -e 's|@spec_includes@| -I${includedir}/spec/arm_64 -I${includedir}/spec/64bit|'
endif
: foreach *.pc.in |> !sed_pkgconfig_file |>
: |> ln -s genode-base.pc %o |> $(PKG_CONFIG_DIR)/base.pc $(GENODE_DIR)/<pkg-config>

52
repos/base/Tuprules.tup Normal file
View File

@ -0,0 +1,52 @@
REP_DIR = $(TUP_CWD)
ifeq (@(TUP_ARCH),i386)
INCLUDES += -I$(BASE_DIR)/include/spec/x86_32
INCLUDES += -I$(BASE_DIR)/include/spec/x86
INCLUDES += -I$(BASE_DIR)/include/spec/32bit
endif
ifeq (@(TUP_ARCH),x86_64)
INCLUDES += -I$(BASE_DIR)/include/spec/x86_64
INCLUDES += -I$(BASE_DIR)/include/spec/x86
INCLUDES += -I$(BASE_DIR)/include/spec/64bit
endif
ifeq (@(TUP_ARCH),arm64)
INCLUDES += -I$(BASE_DIR)/include/spec/arm_64
INCLUDES += -I$(BASE_DIR)/include/spec/64bit
endif
INCLUDES += -I$(BASE_DIR)/include
# Override base macros to bypass pkg-config
DEFINES += \
-ffunction-sections \
-fno-strict-aliasing \
-fPIC \
-g \
-nostdinc \
-Wall \
CXXFLAGS += \
-std=gnu++17 \
GCC_INCLUDE = -I`$(CC) -print-file-name=include`
!cc = |> ^ COMPILE %b^ \
@(CC_WRAPPER) $(CC) $(DEFINES) $(OLEVEL) \
$(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) \
$(INCLUDES) $(GCC_INCLUDE) $(CC_MARCH) \
-c %f -o %o \
|> %B.o
!cxx = |> ^ COMPILE %b^ \
@(CC_WRAPPER) $(CXX) $(DEFINES) $(OLEVEL) \
$(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) \
$(INCLUDES) $(GCC_INCLUDE) $(CC_MARCH) \
-c %f -o %o \
|> %B.o
!ld = |> ^ MERGE %o^ $(LD) \
$(LDFLAGS) --whole-archive --start-group %f --end-group --no-whole-archive -o %o |>

View File

@ -0,0 +1,12 @@
includedir=@includedir@
cc=@cc@
cxx=@cxx@
ld=@ld@
ar=@ar@
ranlib=@ranlib@
Name: base
Description: Genode base repository
URL: https://genode.org/
Version: @VERSION@
Cflags: -I${includedir} @spec_includes@ -I@toolchainincludedir@

View File

@ -0,0 +1,4 @@
Name: genode-lib
Description: Flags for linking Genode libraries
Version: @VERSION@
Libs: -shared --eh-frame-hdr -gc-sections -z max-page-size=0x1000 -T@lddir@/genode_rel.ld --entry=0x0 -l:ldso-startup.lib.a @libgcc@

View File

@ -0,0 +1,8 @@
lddir=@lddir@
Name: genode-prg
Description: Flags for dynamically-linked Genode programs
URL: https://genode.org/
Version: @VERSION@
Requires: ld
Libs: -gc-sections -z max-page-size=0x1000 --dynamic-list=${lddir}/genode_dyn.dl -nostdlib -Ttext=0x01000000 --dynamic-linker=ld.lib.so --eh-frame-hdr -rpath-link=. -T${lddir}/genode_dyn.ld

View File

@ -0,0 +1 @@
INCLUDES += -I$(REP_DIR)/src/include

View File

@ -0,0 +1,3 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !ar |> alarm.lib.a

View File

@ -0,0 +1,25 @@
# Portions of base library shared by core and non-core processes
COMMON_SRC_CC += \
$(BASE_DIR)/src/lib/base/allocator_avl.cc \
$(BASE_DIR)/src/lib/base/avl_tree.cc \
$(BASE_DIR)/src/lib/base/child.cc \
$(BASE_DIR)/src/lib/base/component.cc \
$(BASE_DIR)/src/lib/base/console.cc \
$(BASE_DIR)/src/lib/base/elf_binary.cc \
$(BASE_DIR)/src/lib/base/entrypoint.cc \
$(BASE_DIR)/src/lib/base/env_session_id_space.cc \
$(BASE_DIR)/src/lib/base/heap.cc \
$(BASE_DIR)/src/lib/base/lock.cc \
$(BASE_DIR)/src/lib/base/log.cc \
$(BASE_DIR)/src/lib/base/output.cc \
$(BASE_DIR)/src/lib/base/raw_output.cc \
$(BASE_DIR)/src/lib/base/registry.cc \
$(BASE_DIR)/src/lib/base/rm_session_client.cc \
$(BASE_DIR)/src/lib/base/root_proxy.cc \
$(BASE_DIR)/src/lib/base/session_state.cc \
$(BASE_DIR)/src/lib/base/signal_common.cc \
$(BASE_DIR)/src/lib/base/slab.cc \
$(BASE_DIR)/src/lib/base/sliced_heap.cc \
$(BASE_DIR)/src/lib/base/stack_allocator.cc \
$(BASE_DIR)/src/lib/base/stack_protector.cc \

View File

@ -0,0 +1,70 @@
include_rules
DEFINES = -ffunction-sections -fno-strict-aliasing -g -fPIC
# drop the standard defines to avoid -nostdinc
: foreach *.cc |> !cxx |> {supc++}
#
# Prevent symbols of the gcc support libs from being discarded during 'ld -r'
#
KEEP_SYMBOLS = \
-u __cxa_guard_acquire \
-u __dynamic_cast \
-u __cxa_throw_bad_array_new_length \
-u __cxa_current_exception_type \
-u _ZTVN10__cxxabiv116__enum_type_infoE \
-u _ZN10__cxxabiv121__vmi_class_type_infoD0Ev \
-u _ZTVN10__cxxabiv119__pointer_type_infoE \
-u _ZTSN10__cxxabiv120__function_type_infoE \
LIBCXX_GCC = \
`$(CXX) $(CC_MARCH) -print-file-name=libsupc++.a` \
`$(CXX) $(CC_MARCH) -print-file-name=libgcc_eh.a` \
: {supc++} |> $(LD) $(LD_MARCH) $(KEEP_SYMBOLS) -r %f $(LIBCXX_GCC) -o %o |> supc++.tmp
#
# Here we define all symbols we want to hide in libsupc++ and libgcc_eh
#
LOCAL_SYMBOLS = \
--localize-symbol=abort \
--localize-symbol=calloc \
--localize-symbol=fputc \
--localize-symbol=fputs \
--localize-symbol=free \
--localize-symbol=fwrite \
--localize-symbol=malloc \
--localize-symbol=memcmp \
--localize-symbol=realloc \
--localize-symbol=sprintf \
--localize-symbol=stderr \
--localize-symbol=__stderrp \
--localize-symbol=strcat \
--localize-symbol=strcmp \
--localize-symbol=strcpy \
--localize-symbol=strlen \
--localize-symbol=strncmp \
#
# Symbols we wrap (see unwind.cc)
#
EH_SYMBOLS = \
_Unwind_Resume \
_Unwind_Complete \
_Unwind_DeleteException \
#
# Additional functions for ARM
#
EH_SYMBOLS += \
__aeabi_unwind_cpp_pr0 \
__aeabi_unwind_cpp_pr1 \
REDEF_SYMBOLS = `echo $(EH_SYMBOLS) | awk -v RS=' ' '{ print "--redefine-sym "$1"=_cxx_"$1 }'`
: supc++.tmp |> $(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++.o {obj}
: foreach *.c |> !cc |> {obj}
: {obj} |> !ar |> cxx.lib.a $(BASE_DIR)/<base-libs>

View File

@ -0,0 +1,3 @@
include_rules
: $(REP_DIR)/lib/symbols/ld |> !abi_stub |>
: foreach *.pc.in |> !sed_pkgconfig_file |>

View File

@ -0,0 +1,5 @@
Name: ld
Description: Genode dynamic loader
URL: https://genode.org/
Version: @VERSION@
Libs: -l:ld.lib.so -l:ldso-startup.lib.a

View File

@ -0,0 +1,6 @@
LIBS += base
include_rules
: foreach startup.cc |> !cxx |> %B.o {obj}
: {obj} | |> !ar |> ldso-startup.lib.a
: {obj} | |> !ar |> $(LIB_DIR)/ldso-startup.lib.a $(GENODE_DIR)/<lib>

View File

@ -0,0 +1,15 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
ifeq (@(TUP_ARCH),i386)
: foreach spec/x86_32/*.s |> !asm |> {obj}
endif
ifeq (@(TUP_ARCH),x86_64)
: foreach spec/x86_64/*.s |> !asm |> {obj}
endif
ifeq (@(TUP_ARCH),arm64)
: foreach spec/arm_64/*.s |> !asm |> {obj}
endif
: {obj} |> !ar |> startup.lib.a $(BASE_DIR)/<base-libs>

View File

@ -1,20 +0,0 @@
/*
* \brief Copy a platform-capability to another protection domain.
* \author Stefan Kalkowski
* \date 2012-03-09
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <util/string.h>
#include <base/native_capability.h>
using namespace Genode;
void Cap_dst_policy::copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src) {
memcpy(dst, src, sizeof(Native_capability_tpl<Cap_dst_policy>)); }

View File

@ -0,0 +1,17 @@
include_rules
INCLUDES += $(REP_DIR)/src/include
SRC_CC += \
duration.cc \
timeout.cc \
timer_connection.cc \
timer_connection_timestamp.cc \
ifeq (@(TUP_ARCH),arm)
SRC_CC += arm/timer_connection_time.cc
else
SRC_CC += timer_connection_time.cc
endif
: foreach $(SRC_CC) |> !cxx |> {obj}
: {obj} |> !ar |> %d.lib.a

View File

@ -0,0 +1 @@
LIBS += base

View File

@ -0,0 +1,6 @@
TARGET_NAME = test-log
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> test-%d {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

9
repos/gems/Tupfile Normal file
View File

@ -0,0 +1,9 @@
include_rules
ifdef NIX_OUTPUTS_DEV
SED_FLAGS += -e "s|@includedir@|@(NIX_OUTPUTS_DEV)/include/gems|"
else
SED_FLAGS += -e "s|@includedir@|`nix-store --add $(REP_DIR)/include`|"
endif
: *.pc.in |> !sed_pkgconfig_file |>

2
repos/gems/Tuprules.tup Normal file
View File

@ -0,0 +1,2 @@
REP_DIR = $(TUP_CWD)
LIBS += genode-gems

View File

@ -0,0 +1,8 @@
includedir=@includedir@
Name: gems
Description: Genode gems repository
URL: https://genode.org/
Version: @VERSION@
Requires: genode-os
Cflags: -I${includedir}

View File

@ -0,0 +1,11 @@
TARGET_NAME = backdrop
LIBS += libpng libc
include_rules
BLIT = $(GENODE_DIR)/repos/os/src/lib/blit/blit.lib.a
: foreach *.cc $(REP_DIR)/src/lib/file/*.cc |> !cxx |> %B.o {obj}
: {obj} $(BLIT) |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,12 @@
TARGET_NAME = decorator
include_rules
INCLUDES += -I$(REP_DIR)/../demo/include
: $(REP_DIR)/../demo/src/app/scout/data/droidsansb10.tff |> !ln |> %b {font}
: foreach *.rgba {font} |> !incbin |> {obj}
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = depot_deploy
LIBS += vfs
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,6 @@
TARGET_NAME = depot_download_manager
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = depot_query
LIBS += vfs
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,6 @@
TARGET_NAME = driver_manager
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = fs_query
LIBS += vfs
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = fs_tool
LIBS += vfs
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,9 @@
TARGET_NAME = menu_view
LIBS += libpng libc
include_rules
INCLUDES += -I.
INCLUDES += -I$(REP_DIR)/../demo/include
: foreach *.cc $(REP_DIR)/src/lib/file/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = pipe
LIBS += posix
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,8 @@
TARGET_NAME = sculpt_manager
INCLUDES += -I.
INCLUDES += -I../depot_deploy
include_rules
: foreach *.cc view/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,8 @@
TARGET_NAME = themed_decorator
LIBS += libpng libc
include_rules
INCLUDES += -I$(REP_DIR)/../demo/include
: foreach *.cc $(REP_DIR)/src/lib/file/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = window_layouter
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = vfs_import
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !lib |> vfs_import.lib.so {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,8 @@
TARGET_NAME = file_terminal
LIBS += libc
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,12 @@
TARGET_NAME = nit_fader
include_rules
INCLUDES += -I.
INCLUDES += -I$(REP_DIR)/../demo/include
BLIT = $(GENODE_DIR)/repos/os/src/lib/blit/blit.lib.a
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} $(BLIT) |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = terminal
LIBS += vfs
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,8 @@
TARGET_NAME = wm
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

21
repos/os/Tupfile Normal file
View File

@ -0,0 +1,21 @@
include_rules
ifdef NIX_OUTPUTS_DEV
SED_FLAGS += -e "s|@includedir@|@(NIX_OUTPUTS_DEV)/include/os|"
else
SED_FLAGS += -e "s|@includedir@|`nix-store --add $(REP_DIR)/include`|"
endif
ifeq (@(TUP_ARCH),i386)
SED_FLAGS += -e 's|@spec_includes@|-I${includedir}/spec/x86_32 -I${includedir}/spec/x86|'
endif
ifeq (@(TUP_ARCH),x86_64)
SED_FLAGS += -e 's|@spec_includes@|-I${includedir}/spec/x86_64 -I${includedir}/spec/x86|'
endif
ifeq (@(TUP_ARCH),arm)
SED_FLAGS += -e 's|@spec_includes@| -I${includedir}/spec/arm|'
endif
: *.pc.in |> !sed_pkgconfig_file |>

2
repos/os/Tuprules.tup Normal file
View File

@ -0,0 +1,2 @@
REP_DIR = $(TUP_CWD)
LIBS += genode-os

8
repos/os/genode-os.pc.in Normal file
View File

@ -0,0 +1,8 @@
includedir=@includedir@
Name: os
Description: Genode os repository
URL: https://genode.org/
Version: @VERSION@
Requires: genode-base
Cflags: @spec_includes@ -I${includedir}

View File

@ -0,0 +1,7 @@
TARGET_NAME = global_keys_handler
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = log_core
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = nit_focus
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,10 @@
TARGET_NAME = ping
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: foreach ../../lib/net/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = pointer
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = rom_logger
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = rom_reporter
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = rom_to_file
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = sequence
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = usb_report_filter
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,2 @@
INCLUDES += -I$(TUP_CWD)
SRC_CC = $(TUP_CWD)/*.cc

View File

@ -0,0 +1,10 @@
ifdef x86
TARGET_NAME = ahci_drv
include_rules
: foreach $(SRC_CC) *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> $(TARGET_NAME) {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)
endif

View File

@ -0,0 +1 @@
INCLUDES += -I$(TUP_CWD)

View File

@ -0,0 +1,10 @@
ifdef x86
TARGET_NAME = ps2_drv
include_rules
: foreach $(SRC_CC) *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> $(TARGET_NAME) {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)
endif

View File

@ -0,0 +1,8 @@
TARGET_NAME = init
INCLUDES += -I./
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,27 @@
include_rules
BLIT_DIR = $(GENODE_DIR)/repos/os/src/lib/blit
ifeq (@(TUP_ARCH),i386)
BLIT_INCLUDES += -Ispec/x86_32
BLIT_INCLUDES += -Ispec/x86
endif
ifeq (@(TUP_ARCH),x86_64)
BLIT_INCLUDES += -Ispec/x86_64
BLIT_INCLUDES += -Ispec/x86
endif
ifeq (@(TUP_ARCH),arm)
BLIT_INCLUDES += -Ispec/arm
endif
ifeq ($(BLIT_INCLUDES),)
error blit library not yet ported to @(TUP_ARCH)
endif
INCLUDES += $(BLIT_INCLUDES)
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !ar |> %d.lib.a

View File

@ -0,0 +1,6 @@
Name: blit
Description: Genode blitting library
URL: https://genode.org/
Version: @VERSION@
Requires: genode-os
Libs: -l:blit.lib.a

View File

@ -0,0 +1,17 @@
TARGET_NAME = vfs
INCLUDES += -I./
include_rules
: $(REP_DIR)/lib/symbols/vfs |> !abi_stub |>
: vfs.pc.in |> !sed_pkgconfig_file |>
: foreach *.cc |> !cxx |> %B.o {lib-obj}
: {lib-obj} |> !lib |> %d.lib.so {lib}
: foreach ../../server/vfs/*.cc |> !cxx |> %B.o {server-obj}
: {server-obj} {lib} |> !prg |> server/vfs {server}
# Link the server to the immediate vfs.lib.so
: foreach {lib} {server} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,4 @@
Name: VFS
Description: Genode Virtual File-System library
Version: @VERSION@
Libs: -l:vfs.lib.so

View File

@ -0,0 +1,8 @@
TARGET_NAME = cached_fs_rom
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = chroot
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = clipboard
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = dynamic_rom
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = fs_log
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = fs_report
include_rules
LIBS += vfs
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = fs_rom
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> %d {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,8 @@
TARGET_NAME = input_filter
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = input_merger
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = iso9660
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = log_report
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,7 @@
TARGET_NAME = mixer
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,10 @@
TARGET_NAME = nic_bridge
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: foreach ../../lib/net/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,10 @@
TARGET_NAME = nic_dump
INCLUDES += -I.
include_rules
: foreach *.cc |> !cxx |> %B.o {obj}
: foreach ../../lib/net/*.cc |> !cxx |> %B.o {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

Some files were not shown because too many files have changed in this diff Show More