wireguard: generic target.mk

Introduce an arch-specific wireguard lib that contains all code from the
former arch-specific target.mk files. This allows us to create a generic
target.mk that merely depends on the library and a dummy.cc file. The latter
ensures that building/linking of the target isn't skipped by the build system.

Ref #4519
This commit is contained in:
Martin Stein 2022-05-23 13:10:21 +02:00 committed by Christian Helmuth
parent 83408ef35c
commit 520742cf3e
9 changed files with 36 additions and 35 deletions

View File

@ -0,0 +1,3 @@
INC_DIR += $(REP_DIR)/src/include/spec/arm_64
include $(REP_DIR)/lib/mk/wireguard.inc

View File

@ -0,0 +1,3 @@
INC_DIR += $(REP_DIR)/src/include/spec/x86_64
include $(REP_DIR)/lib/mk/wireguard.inc

View File

@ -0,0 +1,22 @@
LIBS += base net jitterentropy wireguard_lx_inc_dirs
INC_DIR += $(REP_DIR)/src/app/wireguard
INC_DIR += $(REP_DIR)/src/include
SRC_CC += arp_cache.cc
SRC_CC += arp_waiter.cc
SRC_CC += base64.cc
SRC_CC += config_model.cc
SRC_CC += dhcp_client.cc
SRC_CC += ipv4_address_prefix.cc
SRC_CC += ipv4_config.cc
SRC_CC += irq.cc
SRC_CC += main.cc
SRC_CC += nic_connection.cc
SRC_CC += lx_emul/random.cc
SRC_CC += uplink_connection.cc
vpath %.cc $(REP_DIR)/src/app/wireguard
vpath %.cc $(REP_DIR)/src/lib
CC_CXX_WARN_STRICT_CONVERSION =

View File

@ -1,12 +1,12 @@
#
# This library is for avoiding clashes between Linux and Genode includes.
# If we were to compile all the *.c files of this library directly with the
# WireGuard target there would be only one INC_DIR applied to *.cc files as
# well as to *.c files. Some Genode headers, however (e.g. 'net/udp.h' or
# WireGuard library, there would be only one INC_DIR applied to *.cc files as
# well as to *.c files. Some Genode headers, however, (e.g. 'net/udp.h' or
# 'net/dhcp.h') exist with the same include identifier in both Linux and
# Genode, and we would have the problem that we want the Linux variant in *.c
# files and the Genode variant in *.cc files. Therefore, we create two
# dedicated INC_DIR settings (that of the library and that of the target).
# dedicated INC_DIR settings through separate libraries.
#
GEN_PRG_DIR := $(PRG_DIR)/../..

View File

@ -1,5 +0,0 @@
REQUIRES = arm_64
INC_DIR += $(REP_DIR)/src/include/spec/arm_64
include $(PRG_DIR)/../../target.inc

View File

@ -1,5 +0,0 @@
REQUIRES = x86_64
INC_DIR += $(REP_DIR)/src/include/spec/x86_64
include $(PRG_DIR)/../../target.inc

View File

@ -1,22 +0,0 @@
TARGET = wireguard
LIBS += base net jitterentropy wireguard_lx_inc_dirs
GEN_DIR := $(PRG_DIR)/../..
INC_DIR += $(GEN_DIR)
INC_DIR += $(REP_DIR)/src/include
SRC_CC += arp_cache.cc
SRC_CC += arp_waiter.cc
SRC_CC += base64.cc
SRC_CC += config_model.cc
SRC_CC += dhcp_client.cc
SRC_CC += ipv4_address_prefix.cc
SRC_CC += ipv4_config.cc
SRC_CC += irq.cc
SRC_CC += main.cc
SRC_CC += nic_connection.cc
SRC_CC += lx_emul/random.cc
SRC_CC += uplink_connection.cc
vpath %.cc $(GEN_DIR)
vpath %.cc $(REP_DIR)/src/lib
CC_CXX_WARN_STRICT_CONVERSION =

View File

@ -0,0 +1,5 @@
TARGET = wireguard
SRC_CC += dummy.cc
LIBS += wireguard