i2pd/Makefile

53 lines
1.1 KiB
Makefile
Raw Normal View History

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