1
0
mirror of https://github.com/PurpleI2P/i2pd-tools synced 2025-01-11 23:37:53 +00:00
i2pd-tools/Makefile

92 lines
2.0 KiB
Makefile
Raw Normal View History

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