Add base-hw Tup rules

master
Emery Hemingway 3 years ago
parent e0b84beafa
commit 11ff9a1dc5
  1. 8
      repos/base-hw/Tuprules.tup
  2. 2
      repos/base-hw/src/Tuprules.tup
  3. 71
      repos/base-hw/src/core/Tuprules.tup
  4. 37
      repos/base-hw/src/core/pc/Tupfile
  5. 6
      repos/base-hw/src/core/spec/x86_64/Tupfile
  6. 6
      repos/base-hw/src/core/spec/x86_64/kernel/Tupfile
  7. 43
      repos/base-hw/src/lib/base-common/Tupfile
  8. 22
      repos/base-hw/src/lib/base/Tupfile
  9. 46
      repos/base-hw/src/lib/ld/Tupfile
  10. 2
      repos/base-hw/src/lib/startup/Tupfile
  11. 21
      repos/base-hw/src/lib/syscall-hw/Tupfile
  12. 12
      repos/base-hw/src/timer/hw/Tupfile

@ -0,0 +1,8 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/include/spec/x86_64
endif
CPPFLAGS += -I$(TUP_CWD)/include
include &(BASE_DIR)/Tuprules.tup
REP_DIR = $(TUP_CWD)

@ -0,0 +1,2 @@
CPPFLAGS += -I$(TUP_CWD)/include
CPPFLAGS += -I$(BASE_DIR)/src/include

@ -0,0 +1,71 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/spec/x86_64
NR_OF_CPUS = 32
CPPFLAGS += -DNR_OF_CPUS=$(NR_OF_CPUS)
LDFLAGS += --defsym NR_OF_CPUS=$(NR_OF_CPUS)
endif
GEN_CORE_DIR = $(BASE_DIR)/src/core
# add include paths
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/core
CPPFLAGS += -I$(GEN_CORE_DIR)/include
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/include
CPPFLAGS += -I$(BASE_DIR)/src/include
# add C++ sources
SRC_CC += $(GEN_CORE_DIR)/core_log.cc
SRC_CC += $(GEN_CORE_DIR)/core_mem_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/core_rpc_cap_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_thread_component.cc
SRC_CC += $(GEN_CORE_DIR)/dataspace_component.cc
SRC_CC += $(GEN_CORE_DIR)/default_log.cc
SRC_CC += $(GEN_CORE_DIR)/dump_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/heartbeat.cc
SRC_CC += $(GEN_CORE_DIR)/io_mem_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/main.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_support.cc
SRC_CC += $(GEN_CORE_DIR)/platform_rom_modules.cc
SRC_CC += $(GEN_CORE_DIR)/ram_dataspace_factory.cc
SRC_CC += $(GEN_CORE_DIR)/region_map_component.cc
SRC_CC += $(GEN_CORE_DIR)/rom_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/signal_receiver.cc
SRC_CC += $(GEN_CORE_DIR)/signal_transmitter_noinit.cc
SRC_CC += $(GEN_CORE_DIR)/stack_area.cc
SRC_CC += $(GEN_CORE_DIR)/trace_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/version.cc
CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
SRC_CC += $(TUP_CWD)/capability.cc
SRC_CC += $(TUP_CWD)/core_log_out.cc
SRC_CC += $(TUP_CWD)/core_region_map.cc
SRC_CC += $(TUP_CWD)/cpu_session_support.cc
SRC_CC += $(TUP_CWD)/env.cc
SRC_CC += $(TUP_CWD)/io_mem_session_support.cc
SRC_CC += $(TUP_CWD)/irq_session_component.cc
SRC_CC += $(TUP_CWD)/kernel_log.cc
SRC_CC += $(TUP_CWD)/native_pd_component.cc
SRC_CC += $(TUP_CWD)/native_utcb.cc
SRC_CC += $(TUP_CWD)/pager.cc
SRC_CC += $(TUP_CWD)/platform.cc
SRC_CC += $(TUP_CWD)/platform_pd.cc
SRC_CC += $(TUP_CWD)/platform_thread.cc
SRC_CC += $(TUP_CWD)/ram_dataspace_support.cc
SRC_CC += $(TUP_CWD)/region_map_support.cc
SRC_CC += $(TUP_CWD)/stack_area_addr.cc
SRC_CC += $(TUP_CWD)/thread_start.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu_scheduler.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/double_list.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/init.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/ipc_node.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/irq.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/kernel.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/object.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/signal_receiver.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/thread.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/timer.cc

@ -0,0 +1,37 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
GEN_CORE_DIR = $(BASE_DIR)/src/core
# add C++ sources
SRC_CC += $(REP_DIR)/src/lib/hw/spec/64bit/memory_map.cc
SRC_CC += ../kernel/cpu_mp.cc
SRC_CC += ../kernel/lock.cc
SRC_CC += ../kernel/vm_thread_off.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/io_port_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/io_port_session_support.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/platform_services.cc
SRC_CC += ../spec/x86_64/bios_data_area.cc
SRC_CC += ../spec/x86_64/cpu.cc
SRC_CC += ../spec/x86_64/pic.cc
SRC_CC += ../spec/x86_64/pit.cc
SRC_CC += ../spec/x86_64/platform_support.cc
SRC_CC += ../spec/x86_64/platform_support_common.cc
: foreach $(SRC_S) |> !asm |> {obj}
: foreach $(SRC_CC) |> !cxx |> {obj}
: foreach $(SRC_CC_KERNEL) |> !cxx |> ../kernel/%B.o {obj}
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(BASE_DIR)/<base-libs> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<core-obj> \
|> $(LD) $(LDFLAGS) -u _start -r \
--whole-archive --start-group %f %<core-obj> %<base-libs> %<base-common> $(PKG_LIBS) --no-whole-archive --end-group -o %o \
|> core.a $(REP_DIR)/<core> {core}
: {core} |> cp %f %o |> $(OUT_DIR)/lib/core-hw-pc.a
endif

@ -0,0 +1,6 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
: foreach *.s |> !asm |> | $(REP_DIR)/<core-obj>
endif

@ -0,0 +1,6 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
: foreach *.cc |> !cxx |> | $(REP_DIR)/<core-obj>
endif

@ -0,0 +1,43 @@
include_rules
BASE_COMMON_DIR = $(BASE_DIR)/src/lib/base-common
SRC_CC += $(BASE_COMMON_DIR)/allocator_avl.cc
SRC_CC += $(BASE_COMMON_DIR)/avl_tree.cc
SRC_CC += $(BASE_COMMON_DIR)/child.cc
SRC_CC += $(BASE_COMMON_DIR)/child_process.cc
SRC_CC += $(BASE_COMMON_DIR)/component.cc
SRC_CC += $(BASE_COMMON_DIR)/console.cc
SRC_CC += $(BASE_COMMON_DIR)/elf_binary.cc
SRC_CC += $(BASE_COMMON_DIR)/entrypoint.cc
SRC_CC += $(BASE_COMMON_DIR)/env_session_id_space.cc
SRC_CC += $(BASE_COMMON_DIR)/heap.cc
SRC_CC += $(BASE_COMMON_DIR)/lock.cc
SRC_CC += $(BASE_COMMON_DIR)/log.cc
SRC_CC += $(BASE_COMMON_DIR)/output.cc
SRC_CC += $(BASE_COMMON_DIR)/raw_output.cc
SRC_CC += $(BASE_COMMON_DIR)/region_map_client.cc
SRC_CC += $(BASE_COMMON_DIR)/registry.cc
SRC_CC += $(BASE_COMMON_DIR)/rm_session_client.cc
SRC_CC += $(BASE_COMMON_DIR)/root_proxy.cc
SRC_CC += $(BASE_COMMON_DIR)/rpc_dispatch_loop.cc
SRC_CC += $(BASE_COMMON_DIR)/rpc_entrypoint.cc
SRC_CC += $(BASE_COMMON_DIR)/session_state.cc
SRC_CC += $(BASE_COMMON_DIR)/signal_common.cc
SRC_CC += $(BASE_COMMON_DIR)/slab.cc
SRC_CC += $(BASE_COMMON_DIR)/sleep.cc
SRC_CC += $(BASE_COMMON_DIR)/sliced_heap.cc
SRC_CC += $(BASE_COMMON_DIR)/stack_allocator.cc
SRC_CC += $(BASE_COMMON_DIR)/stack_protector.cc
SRC_CC += $(BASE_COMMON_DIR)/thread.cc
SRC_CC += $(BASE_COMMON_DIR)/thread_myself.cc
SRC_CC += $(BASE_COMMON_DIR)/trace.cc
SRC_CC += $(BASE_COMMON_DIR)/vm_session.cc
SRC_CC += ipc.cc
SRC_CC += signal_transmitter.cc
SRC_CC += thread_bootstrap.cc
: foreach $(SRC_CC) |> !cxx |> {obj}
: {obj} |> !ar |> base-hw-common.lib.a | $(REP_DIR)/<base-hw-common>

@ -0,0 +1,22 @@
include_rules
BASE_LIB_DIR = $(BASE_DIR)/src/lib/base
SRC_CC += $(BASE_LIB_DIR)/default_log.cc
SRC_CC += $(BASE_LIB_DIR)/env_reinit.cc
SRC_CC += $(BASE_LIB_DIR)/heartbeat.cc
SRC_CC += $(BASE_LIB_DIR)/main_thread_cap.cc
SRC_CC += $(BASE_LIB_DIR)/rpc_cap_alloc.cc
SRC_CC += $(BASE_LIB_DIR)/stack_area.cc
SRC_CC += $(BASE_LIB_DIR)/stack_area_addr.cc
SRC_CC += cache.cc
SRC_CC += capability.cc
SRC_CC += env_deprecated.cc
SRC_CC += native_utcb.cc
SRC_CC += raw_write_string.cc
SRC_CC += signal_receiver.cc
SRC_CC += thread_start.cc
: foreach $(SRC_CC) |> !cxx |> {base-obj}
: {base-obj} |> !ar |> base-hw.lib.a | $(REP_DIR)/<base-hw>

@ -0,0 +1,46 @@
include_rules
include $(BASE_DIR)/src/lib/ldso/Tuprules.tup
: 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),i386)
LDFLAGS += -T$(LDSO_DIR)/linux-32.ld
else
LDFLAGS += -T$(LDSO_DIR)/linker.ld
LDFLAGS += --entry=_start
endif
LDFLAGS += -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
OUTPUT = ld-hw.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<base-hw> \
$(REP_DIR)/<startup> \
symbol.map \
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group $(PKG_LIBS) %<base-common> %<base-hw> %<startup> %f --end-group --no-whole-archive $(LIBGCC) \
|> $(OUTPUT) $(REP_DIR)/<ld> {lib}
: foreach {lib} |> !collect_shared |>

@ -0,0 +1,2 @@
include_rules
include &(BASE_DIR)/src/lib/startup/Tupfile.inc

@ -0,0 +1,21 @@
include_rules
ifeq (@(TUP_ARCH),arm)
SRC_CC += ../base-common/arm/kernel/*.cc
endif
ifeq (@(TUP_ARCH),aarch64)
SRC_CC += ../base-common/arm_64/kernel/*.cc
endif
ifeq (@(TUP_ARCH),riscv)
SRC_CC += ../base-common/riscv/kernel/*.cc
endif
ifeq (@(TUP_ARCH),x86_64)
SRC_CC += ../base-common/x86_64/kernel/*.cc
endif
: foreach $(SRC_CC) |> !cxx |> {obj}
: {obj} |> !ar |> syscall-hw.lib.a | $(REP_DIR)/<syscall-hw>

@ -0,0 +1,12 @@
LIBS += genode-base
include_rules
BASE_TIMER_DIR = $(BASE_DIR)/src/timer
CPPFLAGS += -I$(BASE_TIMER_DIR)/include
CPPFLAGS += -I.
#TODO: ^ FAIL
: foreach *.cc $(BASE_TIMER_DIR)/*.cc |> !cxx |> %B.hw.o {obj}
: {obj} | $(REP_DIR)/<syscall-hw> |> !prg %<syscall-hw> |> hw_timer_drv {bin}
: {bin} |> !collect_bin |>
Loading…
Cancel
Save