1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 08:14:15 +00:00
i2pd/Makefile

43 lines
848 B
Makefile
Raw Normal View History

UNAME := $(shell uname -s)
SHLIB := libi2pd.so
I2PD := i2p
2013-12-10 08:05:42 -05:00
include filelist.mk
ifeq ($(UNAME),Darwin)
DAEMON_SRC += DaemonLinux.cpp
include Makefile.osx
else ifeq ($(UNAME),FreeBSD)
DAEMON_SRC += DaemonLinux.cpp
2014-08-11 09: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 10:05:04 -04:00
endif
all: obj $(SHLIB) $(I2PD)
2014-12-12 07:39:35 +00:00
obj:
mkdir -p obj
2014-12-12 07:39:35 +00:00
# weaker rule for building files without headers
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
2014-12-12 07:39:35 +00:00
obj/%.o : %.cpp %.h
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
2014-12-12 07:39:35 +00:00
$(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
2014-12-12 08:01:43 +00:00
$(CXX) -o $@ $(LDLIBS) $(LDFLAGS) $^
2014-12-12 07:39:35 +00:00
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
$(CXX) -o $@ -shared $(CXXFLAGS) $(INCFLAGS) $^
clean:
rm -fr obj $(I2PD) $(SHLIB)
.PHONY: all
.PHONY: clean