2014-07-16 20:59:17 +04:00
|
|
|
UNAME := $(shell uname -s)
|
2014-12-11 10:46:28 +03:00
|
|
|
SHLIB := libi2pd.so
|
|
|
|
I2PD := i2p
|
2013-12-10 17:05:42 +04:00
|
|
|
|
2014-12-12 10:38:51 +03:00
|
|
|
include filelist.mk
|
|
|
|
|
2014-12-12 11:22:03 +03:00
|
|
|
USE_AESNI := yes
|
|
|
|
USE_STATIC := no
|
|
|
|
|
2014-07-16 20:59:17 +04:00
|
|
|
ifeq ($(UNAME),Darwin)
|
2014-12-12 10:38:51 +03:00
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-07-16 20:59:17 +04:00
|
|
|
include Makefile.osx
|
2014-12-12 10:38:51 +03:00
|
|
|
else ifeq ($(UNAME),FreeBSD)
|
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-08-11 17:51:53 +04:00
|
|
|
include Makefile.bsd
|
2014-12-12 10:38:51 +03:00
|
|
|
else ifeq ($(UNAME),Linux)
|
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-07-16 20:59:17 +04:00
|
|
|
include Makefile.linux
|
2014-12-12 10:38:51 +03:00
|
|
|
else # win32
|
|
|
|
DAEMON_SRC += DaemonWin32.cpp
|
2014-06-02 18:05:04 +04:00
|
|
|
endif
|
|
|
|
|
2014-12-11 10:46:28 +03:00
|
|
|
all: obj $(SHLIB) $(I2PD)
|
2014-09-19 07:35:51 +04:00
|
|
|
|
2014-12-12 10:39:35 +03:00
|
|
|
obj:
|
|
|
|
mkdir -p obj
|
2014-09-19 07:35:51 +04:00
|
|
|
|
2014-12-12 10:39:35 +03:00
|
|
|
# weaker rule for building files without headers
|
2014-09-19 07:35:51 +04:00
|
|
|
obj/%.o : %.cpp
|
2014-12-12 10:58:01 +03:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
|
2014-09-19 07:35:51 +04:00
|
|
|
|
2014-12-12 10:39:35 +03:00
|
|
|
obj/%.o : %.cpp %.h
|
2014-12-12 10:58:01 +03:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
|
2014-09-19 07:35:51 +04:00
|
|
|
|
2014-12-12 10:39:35 +03:00
|
|
|
$(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
|
2014-12-12 11:01:43 +03:00
|
|
|
$(CXX) -o $@ $(LDLIBS) $(LDFLAGS) $^
|
2014-12-11 10:46:28 +03:00
|
|
|
|
2014-12-12 10:39:35 +03:00
|
|
|
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
|
2014-12-12 10:58:01 +03:00
|
|
|
$(CXX) -o $@ -shared $(CXXFLAGS) $(INCFLAGS) $^
|
2014-12-11 10:46:28 +03:00
|
|
|
|
2014-09-19 07:35:51 +04:00
|
|
|
clean:
|
2014-12-11 10:46:28 +03:00
|
|
|
rm -fr obj $(I2PD) $(SHLIB)
|
2014-09-19 07:35:51 +04:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
.PHONY: clean
|