1
0
mirror of https://github.com/PurpleI2P/i2pd-tools synced 2025-01-15 17:20:08 +00:00
i2pd-tools/Makefile

111 lines
2.9 KiB
Makefile
Raw Normal View History

2017-08-26 23:35:55 +03:00
UNAME = $(shell uname -s)
I2PD_PATH = i2pd
I2PD_LIB = libi2pd.a
2017-04-20 14:26:10 -04:00
LIBI2PD_PATH = $(I2PD_PATH)/libi2pd
LIBI2PD_CLIENT_PATH = $(I2PD_PATH)/libi2pd_client
2018-05-14 07:55:55 -04:00
CXX ?= g++
2017-08-17 10:50:44 +03:00
FLAGS = -Wall -std=c++11 -Wno-misleading-indentation
2017-08-24 09:47:57 -04:00
ifeq ($(UNAME),Linux)
FLAGS += -g
else ifeq ($(UNAME),Darwin)
FLAGS += -g
2018-05-14 07:30:27 -04:00
else ifeq ($(UNAME),FreeBSD)
FLAGS += -g
2017-08-24 09:47:57 -04:00
else
# Win32
2017-08-17 10:50:44 +03:00
FLAGS += -Os -D_MT -DWIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN
BOOST_SUFFIX = -mt
endif
INCFLAGS = -I$(LIBI2PD_PATH) -I$(LIBI2PD_CLIENT_PATH)
2017-08-17 10:50:44 +03:00
CXXFLAGS = $(FLAGS)
2018-05-14 07:30:27 -04:00
LDFLAGS =
LIBS = $(I2PD_PATH)/$(I2PD_LIB) -lboost_system$(BOOST_SUFFIX) -lboost_date_time$(BOOST_SUFFIX) -lboost_filesystem$(BOOST_SUFFIX) -lboost_program_options$(BOOST_SUFFIX) -lssl -lcrypto -lz
2017-08-17 10:50:44 +03:00
2017-08-24 09:47:57 -04:00
ifeq ($(UNAME),Linux)
2017-08-26 23:35:55 +03:00
LIBS += -lrt -lpthread
else ifeq ($(UNAME),Darwin)
LIBS += -lpthread
LDFLAGS += -L/usr/local/opt/openssl@1.1/lib -L/usr/local/lib
INCFLAGS += -I/usr/local/opt/openssl@1.1/include -I/usr/local/include
2018-05-14 07:30:27 -04:00
else ifeq ($(UNAME),FreeBSD)
2018-05-14 08:01:05 -04:00
LIBS += -lthr -lpthread
2018-05-14 07:59:39 -04:00
LDFLAGS += -L/usr/local/lib
INCFLAGS += -I/usr/local/include
2017-08-17 10:50:44 +03:00
else
2017-08-26 23:35:55 +03:00
# Win32
LIBS += -lws2_32 -lwsock32 -lgdi32 -liphlpapi -lstdc++ -lpthread
LDFLAGS += -s -Wl,-Bstatic -static-libgcc -static-libstdc++
2017-08-17 10:50:44 +03:00
endif
2016-09-16 11:28:01 -04:00
2021-05-16 13:43:34 -04:00
all: $(I2PD_LIB) keygen keyinfo famtool routerinfo regaddr regaddr_3ld vain i2pbase64 offlinekeys b33address regaddralias x25519
2016-11-25 09:55:22 -05:00
routerinfo: routerinfo.o $(I2PD_LIB)
$(CXX) -o routerinfo routerinfo.o $(LDFLAGS) $(LIBS)
2016-09-16 11:28:01 -04:00
keygen: keygen.o $(I2PD_LIB)
$(CXX) -o keygen keygen.o $(LDFLAGS) $(LIBS)
keyinfo: keyinfo.o $(I2PD_LIB)
$(CXX) -o keyinfo keyinfo.o $(LDFLAGS) $(LIBS)
famtool: famtool.o $(I2PD_LIB)
$(CXX) -o famtool famtool.o $(LDFLAGS) $(LIBS)
2016-10-24 13:19:33 -04:00
regaddr: regaddr.o $(I2PD_LIB)
$(CXX) -o regaddr regaddr.o $(LDFLAGS) $(LIBS)
2017-02-24 22:23:48 -05:00
regaddr_3ld: regaddr_3ld.o $(I2PD_LIB)
$(CXX) -o regaddr_3ld regaddr_3ld.o $(LDFLAGS) $(LIBS)
vain: vanitygen.o $(I2PD_LIB)
2018-04-26 23:35:07 +07:00
$(CXX) -o vain vanitygen.o $(LDFLAGS) $(LIBS)
2017-08-07 13:50:35 -04:00
i2pbase64: i2pbase64.o $(I2PD_LIB)
2018-05-14 08:03:34 -04:00
$(CXX) -o i2pbase64 i2pbase64.o $(LDFLAGS) $(LIBS)
2017-11-03 09:36:25 -04:00
offlinekeys: offlinekeys.o $(I2PD_LIB)
2019-02-08 14:53:58 -05:00
$(CXX) -o offlinekeys offlinekeys.o $(LDFLAGS) $(LIBS)
b33address: b33address.o $(I2PD_LIB)
2019-04-10 14:15:49 -04:00
$(CXX) -o b33address b33address.o $(LDFLAGS) $(LIBS)
regaddralias: regaddralias.o $(I2PD_LIB)
2020-11-14 21:39:53 -05:00
$(CXX) -o regaddralias regaddralias.o $(LDFLAGS) $(LIBS)
2021-05-16 13:43:34 -04:00
x25519: x25519.o $(I2PD_LIB)
$(CXX) -o x25519 x25519.o $(LDFLAGS) $(LIBS)
2020-11-14 21:39:53 -05:00
2016-09-16 11:28:01 -04:00
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
2016-09-16 11:28:01 -04:00
$(I2PD_LIB):
$(MAKE) -C $(I2PD_PATH) mk_obj_dir $(I2PD_LIB)
%.o: %.cpp $(I2PD_LIB)
2017-08-17 10:50:44 +03:00
$(CXX) -o $@ -c $(CXXFLAGS) $(INCFLAGS) $<
2016-09-16 11:28:01 -04:00
count:
wc *.c *.cc *.C *.cpp *.h *.hpp
clean-i2pd:
$(MAKE) -C $(I2PD_PATH) clean
clean-obj:
rm -f $(wildcard *.o)
clean-bin:
2021-05-16 13:43:34 -04:00
rm -f b33address famtool i2pbase64 keygen keyinfo offlinekeys regaddr regaddr_3ld regaddralias routerinfo vain x25519
clean: clean-i2pd clean-obj clean-bin
2016-09-16 11:28:01 -04:00
.PHONY: all
.PHONY: count
.PHONY: clean-i2pd
.PHONY: clean-obj
.PHONY: clean-bin
.PHONY: clean