|
|
@ -23,21 +23,17 @@ else ifeq ($(UNAME),Linux) |
|
|
|
include Makefile.linux |
|
|
|
include Makefile.linux |
|
|
|
else # win32 mingw
|
|
|
|
else # win32 mingw
|
|
|
|
DAEMON_SRC += DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp |
|
|
|
DAEMON_SRC += DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp |
|
|
|
DAEMON_RC += Win32/Resource.rc |
|
|
|
|
|
|
|
WINDIR := True |
|
|
|
|
|
|
|
include Makefile.mingw |
|
|
|
include Makefile.mingw |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
all: mk_build_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD) |
|
|
|
all: mk_obj_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD) |
|
|
|
|
|
|
|
|
|
|
|
mk_build_dir: |
|
|
|
mk_obj_dir: |
|
|
|
mkdir -p obj |
|
|
|
@mkdir -p obj |
|
|
|
ifeq ($(WINDIR),True) |
|
|
|
@mkdir -p obj/Win32 |
|
|
|
mkdir -p obj/Win32 |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api: mk_build_dir $(SHLIB) $(ARLIB) |
|
|
|
api: mk_obj_dir $(SHLIB) $(ARLIB) |
|
|
|
api_client: mk_build_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
|
|
|
|
|
|
|
|
## 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.
|
|
|
@ -46,24 +42,18 @@ api_client: mk_build_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) |
|
|
|
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
|
|
|
|
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
|
|
|
|
## custom FLAGS to work at build-time.
|
|
|
|
## custom FLAGS to work at build-time.
|
|
|
|
|
|
|
|
|
|
|
|
deps: |
|
|
|
deps: mk_obj_dir |
|
|
|
@mkdir -p obj |
|
|
|
|
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS) |
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS) |
|
|
|
@sed -i -e '/\.o:/ s/^/obj\//' $(DEPS) |
|
|
|
@sed -i -e '/\.o:/ s/^/obj\//' $(DEPS) |
|
|
|
|
|
|
|
|
|
|
|
obj/%.o: %.cpp |
|
|
|
obj/%.o: %.cpp |
|
|
|
@mkdir -p obj |
|
|
|
|
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $< |
|
|
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $< |
|
|
|
|
|
|
|
|
|
|
|
obj/%.o : %.rc |
|
|
|
|
|
|
|
$(WINDRES) -i $< -o $@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# '-' is 'ignore if missing' on first run
|
|
|
|
# '-' is 'ignore if missing' on first run
|
|
|
|
-include $(DEPS) |
|
|
|
-include $(DEPS) |
|
|
|
|
|
|
|
|
|
|
|
DAEMON_OBJS = $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC)) |
|
|
|
DAEMON_OBJS += $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC)) |
|
|
|
DAEMON_RES_OBJS = $(patsubst %.rc,obj/%.o,$(DAEMON_RC)) |
|
|
|
$(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) |
|
|
|
$(I2PD): $(DAEMON_OBJS) $(DAEMON_RES_OBJS) $(ARLIB) $(ARLIB_CLIENT) |
|
|
|
|
|
|
|
$(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS) |
|
|
|
$(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS) |
|
|
|
|
|
|
|
|
|
|
|
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC)) |
|
|
|
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC)) |
|
|
@ -98,4 +88,4 @@ dist: |
|
|
|
.PHONY: dist |
|
|
|
.PHONY: dist |
|
|
|
.PHONY: api |
|
|
|
.PHONY: api |
|
|
|
.PHONY: api_client |
|
|
|
.PHONY: api_client |
|
|
|
.PHONY: mk_build_dir |
|
|
|
.PHONY: mk_obj_dir |
|
|
|