mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 18:47:52 +00:00
Merge pull request #118 from hagen-i2p/make-deps
* new makefile target: deps
This commit is contained in:
commit
14e2c76799
14
Makefile
14
Makefile
@ -2,6 +2,7 @@ UNAME := $(shell uname -s)
|
|||||||
SHLIB := libi2pd.so
|
SHLIB := libi2pd.so
|
||||||
I2PD := i2p
|
I2PD := i2p
|
||||||
GREP := fgrep
|
GREP := fgrep
|
||||||
|
DEPS := obj/make.dep
|
||||||
|
|
||||||
include filelist.mk
|
include filelist.mk
|
||||||
|
|
||||||
@ -32,14 +33,17 @@ api: $(SHLIB)
|
|||||||
## -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.
|
||||||
|
|
||||||
# weaker rule for building files without headers
|
deps:
|
||||||
|
@test -d obj || mkdir obj
|
||||||
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS)
|
||||||
|
@sed -i -e '/\.o:/ s/^/obj\//' $(DEPS)
|
||||||
|
|
||||||
obj/%.o : %.cpp
|
obj/%.o : %.cpp
|
||||||
@test -d obj || mkdir obj
|
@test -d obj || mkdir obj
|
||||||
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
|
||||||
|
|
||||||
obj/%.o : %.cpp %.h
|
# '-' is 'ignore if missing' on first run
|
||||||
@test -d obj || mkdir obj
|
-include $(DEPS)
|
||||||
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
$(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
|
$(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
|
||||||
$(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS)
|
$(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS)
|
||||||
@ -58,8 +62,8 @@ dist:
|
|||||||
git archive --format=tar.gz -9 --worktree-attributes \
|
git archive --format=tar.gz -9 --worktree-attributes \
|
||||||
--prefix=i2pd_$(LATEST_TAG)/ $(LATEST_TAG) -o i2pd_$(LATEST_TAG).tar.gz
|
--prefix=i2pd_$(LATEST_TAG)/ $(LATEST_TAG) -o i2pd_$(LATEST_TAG).tar.gz
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
.PHONY: deps
|
||||||
.PHONY: dist
|
.PHONY: dist
|
||||||
.PHONY: api
|
.PHONY: api
|
||||||
|
Loading…
Reference in New Issue
Block a user