2014-07-16 16:59:17 +00:00
|
|
|
UNAME := $(shell uname -s)
|
2014-12-11 07:46:28 +00:00
|
|
|
SHLIB := libi2pd.so
|
|
|
|
I2PD := i2p
|
2013-12-10 13:05:42 +00:00
|
|
|
|
2014-12-12 07:38:51 +00:00
|
|
|
include filelist.mk
|
|
|
|
|
2014-12-12 08:22:03 +00:00
|
|
|
USE_AESNI := yes
|
|
|
|
USE_STATIC := no
|
|
|
|
|
2014-07-16 16:59:17 +00:00
|
|
|
ifeq ($(UNAME),Darwin)
|
2014-12-12 07:38:51 +00:00
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-07-16 16:59:17 +00:00
|
|
|
include Makefile.osx
|
2014-12-12 07:38:51 +00:00
|
|
|
else ifeq ($(UNAME),FreeBSD)
|
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-08-11 13:51:53 +00:00
|
|
|
include Makefile.bsd
|
2014-12-12 07:38:51 +00:00
|
|
|
else ifeq ($(UNAME),Linux)
|
|
|
|
DAEMON_SRC += DaemonLinux.cpp
|
2014-07-16 16:59:17 +00:00
|
|
|
include Makefile.linux
|
2014-12-12 07:38:51 +00:00
|
|
|
else # win32
|
|
|
|
DAEMON_SRC += DaemonWin32.cpp
|
2014-06-02 14:05:04 +00:00
|
|
|
endif
|
|
|
|
|
2014-12-11 07:46:28 +00:00
|
|
|
all: obj $(SHLIB) $(I2PD)
|
2014-09-19 03:35:51 +00:00
|
|
|
|
2014-12-12 07:39:35 +00:00
|
|
|
obj:
|
|
|
|
mkdir -p obj
|
2014-09-19 03:35:51 +00:00
|
|
|
|
2014-12-13 13:39:57 +00:00
|
|
|
obj/%.o : %.cpp %.h
|
2014-12-12 07:58:01 +00:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
|
2014-09-19 03:35:51 +00:00
|
|
|
|
2014-12-13 13:39:57 +00:00
|
|
|
# weaker rule for building files without headers
|
|
|
|
obj/%.o : %.cpp
|
2014-12-12 07:58:01 +00:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
|
2014-09-19 03:35:51 +00:00
|
|
|
|
2014-12-12 07:39:35 +00:00
|
|
|
$(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
|
2014-12-12 08:53:17 +00:00
|
|
|
$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
2014-12-11 07:46:28 +00:00
|
|
|
|
2014-12-12 07:39:35 +00:00
|
|
|
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
|
2014-12-13 19:45:44 +00:00
|
|
|
$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS) -shared
|
2014-12-11 07:46:28 +00:00
|
|
|
|
2014-09-19 03:35:51 +00:00
|
|
|
clean:
|
2014-12-11 07:46:28 +00:00
|
|
|
rm -fr obj $(I2PD) $(SHLIB)
|
2014-09-19 03:35:51 +00:00
|
|
|
|
2014-12-12 13:51:23 +00:00
|
|
|
LATEST_TAG=$(shell git describe --tags --abbrev=0 master)
|
|
|
|
dist:
|
|
|
|
git archive --format=tar.gz -9 --worktree-attributes \
|
|
|
|
--prefix=i2pd_$(LATEST_TAG)/ $(LATEST_TAG) -o i2pd_$(LATEST_TAG).tar.gz
|
|
|
|
|
|
|
|
|
2014-09-19 03:35:51 +00:00
|
|
|
.PHONY: all
|
|
|
|
.PHONY: clean
|
2014-12-12 13:51:23 +00:00
|
|
|
.PHONY: dist
|