Skip to content

Commit

Permalink
Makefile: fix dependency for buildinfo.h
Browse files Browse the repository at this point in the history
* Use .d files for CNTK binary
* Pre-declare dependency for CNTK.o on buildinfo.h
  • Loading branch information
mahilleb-msft committed Mar 29, 2016
1 parent 37268cb commit f443257
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,12 @@ CNTK_OBJ := $(patsubst %.cu, $(OBJDIR)/%.o, $(patsubst %.cpp, $(OBJDIR)/%.o, $(C
CNTK:=$(BINDIR)/cntk
ALL+=$(CNTK)
SRC+=$(CNTK_SRC)
$(CNTK): $(BUILDINFO) $(CNTK_OBJ) | $(CNTKMATH_LIB)
# Make sure buildinfo.h is generated even without dependency files
$(OBJDIR)/Source/CNTK/CNTK.o: $(BUILDINFO)
$(CNTK): $(CNTK_OBJ) | $(CNTKMATH_LIB)
@echo $(SEPARATOR)
@mkdir -p $(dir $@)
@echo building output for $(ARCH) with build type $(BUILDTYPE)
Expand Down Expand Up @@ -637,10 +641,7 @@ $(OBJDIR)/%.o : %.cpp Makefile
@mkdir -p $(dir $@)
$(CXX) -c $< -o $@ $(COMMON_FLAGS) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDEPATH:%=-I%) -MD -MP -MF ${@:.o=.d}
.PHONY: force clean buildall all
force: $(BUILDINFO)
.PHONY: $(BUILDINFO) clean buildall all
clean:
@echo $(SEPARATOR)
Expand Down

0 comments on commit f443257

Please sign in to comment.