genode/ports-foc/mk/l4lx.mk
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +01:00

40 lines
1.4 KiB
Makefile

TARGET = vmlinux
VERBOSE_LX_MK ?= 0
REQUIRES += foc
INC_DIR += $(REP_DIR)/include
LIBS = l4lx l4sys
GENODE_LIBS := base base-common startup syscall cxx l4lx l4sys
GENODE_LIBS := $(foreach l,$(GENODE_LIBS),$(BUILD_BASE_DIR)/var/libcache/$l/$l.lib.a)
GENODE_LIBS_SORTED = $(sort $(wildcard $(GENODE_LIBS)))
GENODE_LIBS_SORTED += $(shell $(CC) $(CC_MARCH) -print-libgcc-file-name)
L4LX_BUILD = $(BUILD_BASE_DIR)/$(LX_TARGET)
L4LX_BINARY = $(L4LX_BUILD)/$(TARGET)
L4LX_SYMLINK = $(BUILD_BASE_DIR)/bin/$(LX_TARGET)
L4LX_CONFIG = $(L4LX_BUILD)/.config
$(TARGET): $(L4LX_BINARY)
$(L4LX_BINARY): $(L4LX_CONFIG)
$(VERBOSE_MK)$(MAKE) $(VERBOSE_DIR) \
-C $(REP_DIR)/contrib/$(LX_TARGET) \
O=$(L4LX_BUILD) \
CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
CC="$(CC)" \
KBUILD_VERBOSE=$(VERBOSE_LX_MK) \
V=$(VERBOSE_LX_MK) \
GENODE_INCLUDES="$(addprefix -I,$(INC_DIR))" \
GENODE_LIBS="$(GENODE_LIBS_SORTED)" \
L4ARCH="$(L4LX_L4ARCH)" || false
$(VERBOSE)ln -sf $@ $(L4LX_SYMLINK)
$(L4LX_CONFIG): $(SRC_L4LX_CONFIG)
$(VERBOSE)sed -e "s/CONFIG_L4_OBJ_TREE.*/CONFIG_L4_OBJ_TREE=\"$(subst /,\/,$(L4_BUILD_DIR))\"/" $< > $@
clean:
$(VERBOSE)rm -rf $(L4LX_BUILD)
.PHONY: $(L4LX_BINARY)