bin_PROGRAMS = utun noinst_LIBRARIES = libutun.a # Sources that are always compiled utun_CORE_SOURCES = \ utun.c \ utun_instance.c \ config_parser.c \ config_updater.c \ routing_layer/route_lib.c \ routing_layer/route6_lib.c \ routing_layer/topo_group.c \ routing_layer/route_ping.c \ routing_layer/nat_detection.c \ routing_layer/topo_node.c \ routing_layer/topo_node_sqlite.c \ routing_layer/route_connectivity.c \ routing_layer/conn_mgr_core.c \ routing_layer/conn_mgr_indirect.c \ routing_layer/conn_mgr_monitor.c \ routing_layer/topo_recovery.c \ routing_layer/topo_group_connect.c \ chat/db_sync.c \ routing_layer/routing.c \ tun_if.c \ tun_route.c \ tun_linux.c \ tun_freebsd.c \ tun_windows.c \ transport_layer/etcp.c \ transport_layer/etcp_connections.c \ transport_layer/etcp_bbr.c \ transport_layer/etcp_loadbalancer.c \ transport_layer/etcp_debug.c \ transport_layer/etcp_dump.c \ transport_layer/secure_channel.c \ transport_layer/crc32.c \ transport_layer/stcp_link.c \ transport_layer/stcp.c \ transport_layer/stcp_server.c \ transport_layer/stcp_client.c \ transport_layer/pkt_normalizer.c \ transport_layer/packet_dump.c \ transport_layer/etcp_api.c \ transport_layer/etcp_connect.c \ transport_layer/node_conn_direct.c \ control_server.c \ firewall.c \ eim_nat.c \ nat_transport.c \ media_delivery/media_delivery.c \ media_delivery/media_download.c \ media_delivery/media_index.c \ media_async/media_async.c \ transport_layer/dummynet.c \ ntp_time.c \ ntp_node_time.c \ proxy/tcp_proxy_client.c \ routing_layer/etcp_router.c \ proxy/tcp_proxy_server.c \ proxy/udp_proxy.c \ proxy/socks_proxy.c \ proxy/icmp_proxy.c \ lwip_tcp/lwip_pbuf.c \ lwip_tcp/lwip_tcp.c \ lwip_tcp/lwip_tcp_in.c \ lwip_tcp/lwip_tcp_out.c \ chat/chat_event.c \ chat/chat_setting.c \ chat/chat_core.c \ chat/chat_msg.c \ chat/chat_channel.c \ chat/chat_profile.c \ chat/chat_status.c \ chat/chat_sync.c \ chat/member_sync.c \ chat/merkle_sync.c # libutun: all core sources except main() libutun_a_SOURCES = \ utun_instance.c \ config_parser.c \ config_updater.c \ routing_layer/route_lib.c \ routing_layer/route6_lib.c \ routing_layer/topo_group.c \ routing_layer/route_ping.c \ routing_layer/nat_detection.c \ routing_layer/topo_node.c \ routing_layer/topo_node_sqlite.c \ routing_layer/route_connectivity.c \ routing_layer/conn_mgr_core.c \ routing_layer/conn_mgr_indirect.c \ routing_layer/conn_mgr_monitor.c \ routing_layer/topo_recovery.c \ routing_layer/topo_group_connect.c \ chat/db_sync.c \ routing_layer/routing.c \ tun_if.c \ tun_route.c \ tun_linux.c \ tun_freebsd.c \ tun_windows.c \ transport_layer/etcp.c \ transport_layer/etcp_connections.c \ transport_layer/etcp_bbr.c \ transport_layer/etcp_loadbalancer.c \ transport_layer/etcp_debug.c \ transport_layer/etcp_dump.c \ transport_layer/secure_channel.c \ transport_layer/crc32.c \ transport_layer/stcp_link.c \ transport_layer/stcp.c \ transport_layer/stcp_server.c \ transport_layer/stcp_client.c \ transport_layer/pkt_normalizer.c \ transport_layer/packet_dump.c \ transport_layer/etcp_api.c \ transport_layer/etcp_connect.c \ transport_layer/node_conn_direct.c \ control_server.c \ firewall.c \ eim_nat.c \ nat_transport.c \ media_delivery/media_delivery.c \ media_delivery/media_download.c \ media_delivery/media_index.c \ media_async/media_async.c \ transport_layer/dummynet.c \ ntp_time.c \ ntp_node_time.c \ proxy/tcp_proxy_client.c \ routing_layer/etcp_router.c \ proxy/tcp_proxy_server.c \ proxy/udp_proxy.c \ proxy/socks_proxy.c \ proxy/icmp_proxy.c \ lwip_tcp/lwip_pbuf.c \ lwip_tcp/lwip_tcp.c \ lwip_tcp/lwip_tcp_in.c \ lwip_tcp/lwip_tcp_out.c \ chat/chat_event.c \ chat/chat_setting.c \ chat/chat_core.c \ chat/chat_msg.c \ chat/chat_channel.c \ chat/chat_profile.c \ chat/chat_status.c \ chat/chat_sync.c \ chat/member_sync.c \ chat/merkle_sync.c libutun_a_CFLAGS = $(utun_CFLAGS) # Platform-specific TUN libs (Windows only) utun_TUN_LIBS = @TUN_LIBS@ utun_SOURCES = utun.c # Include paths utun_CFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/transport_layer \ -I$(top_srcdir)/src/routing_layer \ -I$(top_srcdir)/src/media_delivery \ -I$(top_srcdir)/src/media_async \ -I$(top_srcdir)/src/uip \ -g \ -DUSE_SQLITE \ -DSQLITE_THREADSAFE=1 \ $(DEBUG_FLAGS) # Libraries utun_LDADD = \ libutun.a \ $(top_builddir)/lib/libuasync.a \ $(top_builddir)/lib/libopus/libopus_internal.a \ -lpthread \ -lm \ -lcrypto \ $(utun_TUN_LIBS) # Copy binary to project root after building all-local: copy-to-root copy-to-root: utun$(EXEEXT) @cp -f utun$(EXEEXT) $(top_srcdir)/ @cp -f $(top_srcdir)/lib/wintun.dll $(top_srcdir)/ 2>/dev/null || echo "Warning: wintun.dll not found in lib/" if OS_WINDOWS @cp -f $(srcdir)/utun.manifest $(top_srcdir)/utun.exe.manifest 2>/dev/null || true endif # Clean clean-local: @true # Install directories install-exec-hook: $(MKDIR_P) $(DESTDIR)$(bindir) $(MKDIR_P) $(DESTDIR)$(sysconfdir)/utun