SubDir OBOS_TOP src tests add-ons kernel network ;

UsePrivateHeaders net ;

# the network stack tester app

SEARCH_SOURCE += [ FDirName $(OBOS_TOP) src kernel libroot os ] ;

SimpleTest net_stack_tester : 
	net_stack_tester.cpp 
	userland_ipc.c
	userland_modules.cpp
	: be
;

{
	# symlink the userland add-ons dir to the dir where the net_stack_tester
	# lives
	local dir = [ on net_stack_tester return $(LOCATE) ] ;
	MakeLocate <network-add-ons>userland : $(OBOS_ADDON_DIR) ;
	MakeLocate <network-add-ons>add-ons : $(dir) ;
	RelSymLink <network-add-ons>add-ons : <network-add-ons>userland : false ;
	
	# alias for the net_stack_tester the modules link against
	LOCATE on <installed>net_stack_tester = $(dir) ;
	Depends <installed>net_stack_tester
		: net_stack_tester <network-add-ons>add-ons ;
}

# for convenience: this target builds all userland modules
Depends net_stack_tester : userland_network_modules :

NotFile userland_network_modules ;
Depends userland_network_modules :
	# the stack main module
	<userland>core

	# interfaces modules
	<userland>loopback
	<userland>ethernet
	<userland>ppp

	# ppp modules
	<userland>ipcp
	<userland>modem
	<userland>pap
	<userland>pppoe

	# protocols modules
	<userland>raw
	<userland>route
	<userland>ipv4
	<userland>icmp
	<userland>udp
	<userland>tcp
;

SubInclude OBOS_TOP src tests add-ons kernel network core ;
SubInclude OBOS_TOP src tests add-ons kernel network interfaces ;
SubInclude OBOS_TOP src tests add-ons kernel network ppp ;
SubInclude OBOS_TOP src tests add-ons kernel network protocols ;
