Skip to content

Commit

Permalink
[bugfix] makefile.mak: fixes compilation when a certain directory was…
Browse files Browse the repository at this point in the history
… not initially present
  • Loading branch information
vedaldi committed Jan 15, 2015
1 parent 04f16e0 commit a9cce01
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ endef
# inclued by make as auto-dependencies) and the list of files to be
# added to the binary distribution.

.PHONY: clean, archclean, distclean, info, help
no_dep_targets := clean archclean distclean info help

include make/dll.mak
include make/bin.mak
include make/matlab.mak
include make/octave.mak
include make/doc.mak
include make/dist.mak

.PHONY: clean, archclean, distclean, info, help
no_dep_targets += clean archclean distclean info help

clean:
rm -f `find . -name '*~'`
rm -f `find . -name '.DS_Store'`
Expand Down
2 changes: 1 addition & 1 deletion make/doc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ doc/index.html: $(webdoc_src) $(doc-dir) \
# --------------------------------------------------------------------

.PHONY: doc-clean, doc-archclean, doc-distclean
no_dep_targets := doc-clean doc-archclean doc-distclean
no_dep_targets += doc-clean doc-archclean doc-distclean

VERSION: vl/generic.h
echo "$(VER)" > VERSION
Expand Down
14 changes: 10 additions & 4 deletions make/matlab.mak
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,35 @@ endif

MEX_BINDIR := toolbox/mex/$(MEX_SUFFIX)

# generate the mex-dir target
$(eval $(call gendir, mex, $(MEX_BINDIR)))

# Cache an integer representing MATLAB's version
$(MEX_BINDIR)/matlabver.mak:
$(MEX_BINDIR)/matlabver.mak: $(mex-dir)
rm -f "$(MEX_BINDIR)/matlabver.mak"
$(MATLAB_EXE) -nodesktop -nosplash -nojvm \
-r \
"f=fopen('$(MEX_BINDIR)/matlabver.mak','w');"\
"fprintf(f,'MATLAB_VER=%d\n',[1e4 1e2 1]*sscanf(version,'%d.%d.%d'));fclose(f);exit();"

ifdef MATLAB_PATH
ifeq ($(filter $(no_dep_targets), $(MAKECMDGOALS)),)
-include $(MEX_BINDIR)/matlabver.mak
endif
endif

ifeq ($(call gt,$(MATLAB_VER),80300),)
# new style
$(info Detected MATLAB 2014a or greater: adjusting escape method for MEX)
escape =$(1)
else
ifeq ($(call gt,$(MATLAB_VER),1),)
# old style
$(info Detected MATLAB 2013b or earlier: adjusting escape method for MEX)
escape =$(subst $$,\\$$,$(1))
else
$(info The MALTAB version will be detected in the next phase of Make)
endif
endif

# --------------------------------------------------------------------
Expand Down Expand Up @@ -223,9 +232,6 @@ vpath vl_%.c $(mex_sub)

mex-all: $(mex_dll) $(mex_tgt)

# generate the mex-dir target
$(eval $(call gendir, mex, $(MEX_BINDIR)))

# Create a copy of the VLFeat DLL that links to MATLAB OpenMP library
# (Intel OMP 5) rather than the system one. The Intel library is
# binary compatible with GCC. This avoids running two OpenMP
Expand Down

0 comments on commit a9cce01

Please sign in to comment.