diff --git a/Makefile b/Makefile index 594491ef..560a607a 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,19 @@ UNAME := $(shell uname -s) SHLIB := libi2pd.so I2PD := i2p +include filelist.mk + ifeq ($(UNAME),Darwin) + DAEMON_SRC += DaemonLinux.cpp include Makefile.osx -else ifeq ($(UNAME), FreeBSD) +else ifeq ($(UNAME),FreeBSD) + DAEMON_SRC += DaemonLinux.cpp include Makefile.bsd -else +else ifeq ($(UNAME),Linux) + DAEMON_SRC += DaemonLinux.cpp include Makefile.linux +else # win32 + DAEMON_SRC += DaemonWin32.cpp endif all: obj $(SHLIB) $(I2PD) diff --git a/Makefile.bsd b/Makefile.bsd index 17f6ccd9..777e6a73 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -1,7 +1,6 @@ CXX = g++ CXXFLAGS = -O2 NEEDED_CXXFLAGS = -std=c++11 -include filelist.mk INCFLAGS = -I/usr/include/ -I/usr/local/include/ LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread diff --git a/Makefile.linux b/Makefile.linux index c9c72403..6e1987fa 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -18,7 +18,6 @@ endif LIBDIR := /usr/lib -include filelist.mk INCFLAGS = ifeq ($(STATIC),yes) LDLIBS += $(LIBDIR)/libcryptopp.a $(LIBDIR)/libboost_system.a @@ -31,7 +30,6 @@ LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_ endif LIBS = - ifeq ($(USE_AESNI),yes) ifeq ($(IS_64),1) #check if AES-NI is supported by CPU diff --git a/Makefile.osx b/Makefile.osx index f83dc3ff..d690e09c 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -1,6 +1,5 @@ CXX = clang++ CXXFLAGS = -g -Wall -std=c++11 -lstdc++ -I/usr/local/include -include filelist.mk INCFLAGS = -DCRYPTOPP_DISABLE_ASM LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread diff --git a/filelist.mk b/filelist.mk index 8f684be9..ccb79854 100644 --- a/filelist.mk +++ b/filelist.mk @@ -1,21 +1,14 @@ +COMMON_SRC = \ + AddressBook.cpp CryptoConst.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp \ + LeaseSet.cpp Log.cpp NTCPSession.cpp NetDb.cpp Reseed.cpp RouterContext.cpp \ + RouterInfo.cpp SSU.cpp SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp \ + TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \ + TunnelGateway.cpp Destination.cpp util.cpp aes.cpp base64.cpp +# also: Daemon{Linux,Win32}.cpp will be added later +DAEMON_SRC = $(COMMON_SRC) \ + BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp UPnP.cpp \ + HTTPServer.cpp HTTPProxy.cpp i2p.cpp -CPP_FILES := CryptoConst.cpp base64.cpp NTCPSession.cpp RouterInfo.cpp Transports.cpp \ - RouterContext.cpp NetDb.cpp LeaseSet.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelGateway.cpp \ - TransitTunnel.cpp I2NPProtocol.cpp Log.cpp Garlic.cpp HTTPServer.cpp Streaming.cpp \ - Destination.cpp Identity.cpp SSU.cpp SSUSession.cpp SSUData.cpp util.cpp Reseed.cpp \ - DaemonLinux.cpp SSUData.cpp aes.cpp SOCKS.cpp UPnP.cpp TunnelPool.cpp HTTPProxy.cpp \ - AddressBook.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp BOB.cpp ClientContext.cpp \ - Datagram.cpp i2p.cpp - - -H_FILES := CryptoConst.h base64.h NTCPSession.h RouterInfo.h Transports.h \ - RouterContext.h NetDb.h LeaseSet.h Tunnel.h TunnelEndpoint.h TunnelGateway.h \ - TransitTunnel.h I2NPProtocol.h Log.h Garlic.h HTTPServer.h Streaming.h Destination.h \ - Identity.h SSU.h SSUSession.h SSUData.h util.h Reseed.h DaemonLinux.h SSUData.h \ - aes.h SOCKS.h UPnP.h TunnelPool.h HTTPProxy.h AddressBook.h Daemon.h I2PTunnel.h \ - version.h Signature.h SAM.h BOB.h ClientContext.h TransportSession.h Datagram.h - - -OBJECTS = $(addprefix obj/, $(notdir $(CPP_FILES:.cpp=.o))) - +LIB_SRC := $(COMMON_SRC) \ + api.cpp