Tup refactor

unify
Emery Hemingway 2019-06-28 23:09:13 +02:00
parent 9a8eb788d7
commit 1ca3fd65c2
8 changed files with 48 additions and 25 deletions

4
.gitignore vendored
View File

@ -1,7 +1,3 @@
/toolchain-*
/sdk-*
/.gitignore
result
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.

View File

@ -12,6 +12,22 @@ endif
GENODE_DIR = $(TUP_CWD)/upstream
&STUB_DIR = upstream/stub
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!prg = | $(GENODE_DIR)/<stub> $(GENODE_DIR)/<pkg-config> \
|> ^o LD %o^ \
$(LD) $(LD_MARCH) $(LDFLAGS) \
-L&(STUB_DIR) \
`$(PKG_CONFIG) --libs $(LIBS) genode-prg` \
%f \
$(LIBGCC) \
-o %o \
|>
!lib = | $(GENODE_DIR)/<stub> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LD_MARCH) %f $(LDFLAGS) `$(PKG_CONFIG) --libs genode-lib $(LIBS)` -L&(STUB_DIR) -o %o |>
ifeq ($(RAW_NAME),)
RAW_NAME = $(TARGET_NAME)
endif
@ -112,7 +128,7 @@ SDK_INCLUDE = $(TUP_CWD)/sdk.tup
ERRATA_DIR = $(TUP_CWD)/errata
export PKG_CONFIG_PATH
PKG_CONFIG = PKG_CONFIG_PATH=$(GENODE_DIR)/pkg-config:$PKG_CONFIG_PATH pkg-config
PKG_CONFIG = PKG_CONFIG_PATH=$(GENODE_DIR)/upstream:pkg-config:$PKG_CONFIG_PATH pkg-config
ifndef TOOL_CHAIN_PREFIX
error TOOL_CHAIN_PREFIX not configured
@ -124,6 +140,19 @@ LD= @(TOOL_CHAIN_PREFIX)ld
AR = @(TOOL_CHAIN_PREFIX)ar
OBJCOPY = @(TOOL_CHAIN_PREFIX)objcopy
!cc = |> ^ CC %f^ $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -c %f -o %o |>
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^ CC %f^ $(CC) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) -c %f -o %o |>
!ld = |> ^ LD %o^ $(LD) $(LDFLAGS) %f -o %o |>
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
PKG_CONFIG_DIR = $(TUP_CWD)/pkg-config
PKG_CONFIG_PATH = $(PKG_CONFIG_DIR)
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(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) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` $(INCLUDES) -c %f -o %o |> %B.o
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^o CC %b^ @(CC_WRAPPER) $(CXX) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c %f -o %o |> %B.o
!ld = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) -L$(LIB_DIR) `$(PKG_CONFIG) --libs $(LIBS)` %f -o %o |>
!strip = |> strip -o %o %f |>

0
pkg-config/.keep Normal file
View File

1
src/Tuprules.tup Normal file
View File

@ -0,0 +1 @@
LDFLAGS += -L$(GENODE_DIR)/stub

View File

@ -1,20 +1,20 @@
TARGET_NAME = show_input
include_rules
PKG_CONFIGS = vfs genode-gems genode-os genode-prg
CXXFLAGS += `$(PKG_CONFIG) -cflags $(PKG_CONFIGS)`
LDFLAGS += `$(PKG_CONFIG) -libs $(PKG_CONFIGS)`
PKG_CONFIGS = vfs genode-gems genode-os genode-base genode-prg
CXXFLAGS += `$(PKG_CONFIG) --cflags $(PKG_CONFIGS)`
LDFLAGS += `$(PKG_CONFIG) --libs $(PKG_CONFIGS)`
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> !ld |> %d {binary}
: {binary} |> !collect_bin |>
include $(BIN_RULES)
include &(BIN_RULES)
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/$(BIN_NAME) \
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)
include &(PKG_RULES)

View File

@ -1,4 +1,4 @@
ifndef SKIP_INCOMPATIBLE
ifdef BUILD_BROKEN
TARGET_NAME = fs_block
include_rules

View File

@ -1,17 +1,14 @@
TARGET_NAME = nic_bus
PKG_DEPENDS += _/src/$(TARGET_NAME)
include_rules
PKGS = genode-os genode-prg
CXXFLAGS += `$(PKG_CONFIG) --cflags $(PKGS)`
LIBS = genode-os genode-prg
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> ^o LD %o^ \
$(LD) `$(PKG_CONFIG) --libs $(PKGS)` %f -o %o |> %d {binary}
: {objs} |> !ld |> %d {binary}
: {binary} |> !collect_bin |>
include $(BIN_RULES)
PKG_DEPENDS += _/src/$(TARGET_NAME)
: runtime |> !collect_pkg_runtime |>
include &(BIN_RULES)
include &(PKG_RULES)

@ -1 +1 @@
Subproject commit a7c2ad872dd1f58377d667a37bc85893fab7bdf4
Subproject commit b6422c3dcc20b30a652557dca97ccd8a73f3111e