|
|
@ -1,6 +1,8 @@ |
|
|
|
SYS := $(shell $(CXX) -dumpmachine) |
|
|
|
SYS := $(shell $(CXX) -dumpmachine) |
|
|
|
SHLIB := libi2pd.so |
|
|
|
SHLIB := libi2pd.so |
|
|
|
ARLIB := libi2pd.a |
|
|
|
ARLIB := libi2pd.a |
|
|
|
|
|
|
|
SHLIB_LANG := libi2pdlang.so |
|
|
|
|
|
|
|
ARLIB_LANG := libi2pdlang.a |
|
|
|
SHLIB_CLIENT := libi2pdclient.so |
|
|
|
SHLIB_CLIENT := libi2pdclient.so |
|
|
|
ARLIB_CLIENT := libi2pdclient.a |
|
|
|
ARLIB_CLIENT := libi2pdclient.a |
|
|
|
I2PD := i2pd |
|
|
|
I2PD := i2pd |
|
|
@ -26,6 +28,12 @@ else |
|
|
|
LD_DEBUG = -s |
|
|
|
LD_DEBUG = -s |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(USE_STATIC),yes) |
|
|
|
|
|
|
|
NEEDED_CXXFLAGS+= -static |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
ifneq (, $(findstring darwin, $(SYS))) |
|
|
|
ifneq (, $(findstring darwin, $(SYS))) |
|
|
|
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp |
|
|
|
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp |
|
|
|
ifeq ($(HOMEBREW),1) |
|
|
|
ifeq ($(HOMEBREW),1) |
|
|
@ -68,9 +76,10 @@ mk_obj_dir: |
|
|
|
@mkdir -p obj/$(LANG_SRC_DIR) |
|
|
|
@mkdir -p obj/$(LANG_SRC_DIR) |
|
|
|
@mkdir -p obj/$(DAEMON_SRC_DIR) |
|
|
|
@mkdir -p obj/$(DAEMON_SRC_DIR) |
|
|
|
|
|
|
|
|
|
|
|
api: mk_obj_dir $(SHLIB) $(ARLIB) |
|
|
|
api: mk_obj_dir $(SHLIB) $(ARLIB) |
|
|
|
client: mk_obj_dir $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
client: mk_obj_dir $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
|
|
|
|
langs: mk_obj_dir $(LANG_OBJS) $(SHLIB_LANG) $(ARLIB_LANG) |
|
|
|
|
|
|
|
|
|
|
|
## NOTE: The NEEDED_CXXFLAGS are here so that CXXFLAGS can be specified at build time
|
|
|
|
## NOTE: The NEEDED_CXXFLAGS are here so that CXXFLAGS can be specified at build time
|
|
|
|
## **without** overwriting the CXXFLAGS which we need in order to build.
|
|
|
|
## **without** overwriting the CXXFLAGS which we need in order to build.
|
|
|
@ -88,22 +97,31 @@ obj/%.o: %.cpp |
|
|
|
$(I2PD): $(LANG_OBJS) $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) |
|
|
|
$(I2PD): $(LANG_OBJS) $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) |
|
|
|
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) |
|
|
|
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) |
|
|
|
|
|
|
|
|
|
|
|
$(SHLIB): $(LIB_OBJS) |
|
|
|
$(SHLIB): $(LIB_OBJS) |
|
|
|
ifneq ($(USE_STATIC),yes) |
|
|
|
ifneq ($(USE_STATIC),yes) |
|
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) |
|
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
$(SHLIB_CLIENT): $(LIB_CLIENT_OBJS) |
|
|
|
$(SHLIB_CLIENT): $(LIB_CLIENT_OBJS) |
|
|
|
ifneq ($(USE_STATIC),yes) |
|
|
|
ifneq ($(USE_STATIC),yes) |
|
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) $(SHLIB) |
|
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) $(SHLIB) |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
$(ARLIB): $(LIB_OBJS) |
|
|
|
$(SHLIB_LANG): $(LANG_OBJS) |
|
|
|
|
|
|
|
ifneq ($(USE_STATIC),yes) |
|
|
|
|
|
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(ARLIB): $(LIB_OBJS) |
|
|
|
$(AR) -r $@ $^ |
|
|
|
$(AR) -r $@ $^ |
|
|
|
|
|
|
|
|
|
|
|
$(ARLIB_CLIENT): $(LIB_CLIENT_OBJS) |
|
|
|
$(ARLIB_CLIENT): $(LIB_CLIENT_OBJS) |
|
|
|
$(AR) -r $@ $^ |
|
|
|
$(AR) -r $@ $^ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(ARLIB_LANG): $(LANG_OBJS) |
|
|
|
|
|
|
|
$(AR) -r $@ $^ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean: |
|
|
|
clean: |
|
|
|
$(RM) -r obj |
|
|
|
$(RM) -r obj |
|
|
|
$(RM) -r docs/generated |
|
|
|
$(RM) -r docs/generated |
|
|
@ -151,9 +169,10 @@ flags: |
|
|
|
|
|
|
|
|
|
|
|
##TODO: delete this before a PR
|
|
|
|
##TODO: delete this before a PR
|
|
|
|
testc: api api_client |
|
|
|
testc: api api_client |
|
|
|
# g++ -Ii18n -c test.c -o test.o
|
|
|
|
g++ -Ii18n -c _test.c -o test.o |
|
|
|
# gcc -llibi2pd.so -c _test.c -o test.o
|
|
|
|
# gcc -llibi2pd.so -c _test.c -o test.o
|
|
|
|
$(CC) -g -Wall -o test.o _test.c libi2pd.a |
|
|
|
# $(CXX) $(LDFLAGS) $(LDLIBS) -static -Ii18n -Ilibi2pd -Ilibi2pd_client -g -Wall -o test.o _test.c libi2pd.a libi2pdclient.a #obj/libi2pd/*.o obj/i18n/*.o #libi2pd.so
|
|
|
|
|
|
|
|
# $(CXX) $(LDFLAGS) $(LDLIBS) -static -Ii18n -g -Wall -o test.o _test.c libi2pd.a libi2pdclient.a #obj/libi2pd/*.o obj/i18n/*.o #libi2pd.so
|
|
|
|
# gcc -o i2pd _test.c libi2pd.a -lstdc++ -llibi2pd -Llibi2pd
|
|
|
|
# gcc -o i2pd _test.c libi2pd.a -lstdc++ -llibi2pd -Llibi2pd
|
|
|
|
# gcc -Ii18n -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -llibi2pd.a -c test.c -o test.o
|
|
|
|
# gcc -Ii18n -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -llibi2pd.a -c test.c -o test.o
|
|
|
|
# g++ test.o libi2pd.so libi2pdclient.so -o test.main
|
|
|
|
g++ test.o libi2pd.a libi2pdclient.a libi2pdlang.a -o test.main |