diff --git a/tools/Unix.mk b/tools/Unix.mk index bd8384c03a..2207e9f28b 100644 --- a/tools/Unix.mk +++ b/tools/Unix.mk @@ -24,12 +24,6 @@ ifeq ($(V),) MAKE := $(MAKE) -s --no-print-directory endif -# Build any necessary tools needed early in the build. -# incdir - Is needed immediately by all Make.defs file. - -DUMMY := ${shell $(MAKE) -C tools -f Makefile.host incdir \ - INCDIR="$(TOPDIR)/tools/incdir.sh"} - include $(TOPDIR)/Make.defs # GIT directory present @@ -222,6 +216,13 @@ include/setjmp.h: include/nuttx/lib/setjmp.h $(Q) cp -f include/nuttx/lib/setjmp.h include/setjmp.h endif +# Targets used to generate compiler-specific include paths +# Build this tools needed early in the build +# so we define it as a dependency of `context` target + +tools/incdir$(HOSTEXEEXT): + $(Q) $(MAKE) -C tools -f Makefile.host incdir INCDIR="$(TOPDIR)/tools/incdir.sh" + # Targets used to build include/nuttx/version.h. Creation of version.h is # part of the overall NuttX configuration sequence. Notice that the # tools/mkversion tool is built and used to create include/nuttx/version.h @@ -440,7 +441,7 @@ endif CONTEXTDIRS_DEPS = $(patsubst %,%/.context,$(CONTEXTDIRS)) -context: include/nuttx/config.h include/nuttx/version.h .dirlinks $(CONTEXTDIRS_DEPS) | staging +context: tools/incdir$(HOSTEXEEXT) include/nuttx/config.h include/nuttx/version.h .dirlinks $(CONTEXTDIRS_DEPS) | staging staging: $(Q) mkdir -p $@ diff --git a/tools/Win.mk b/tools/Win.mk index bf14b01caf..05d54b7ace 100644 --- a/tools/Win.mk +++ b/tools/Win.mk @@ -22,12 +22,6 @@ export SHELL=cmd export TOPDIR := ${shell echo %CD%} -# Build any necessary tools needed early in the build. -# incdir - Is needed immediately by all Make.defs file. - -DUMMY := ${shell $(MAKE) -C tools -f Makefile.host incdir \ - INCDIR="$(TOPDIR)\tools\incdir.bat"} - include $(TOPDIR)\Make.defs -include $(TOPDIR)\.version @@ -210,6 +204,13 @@ else include\setjmp.h: endif +# Targets used to generate compiler-specific include paths +# Build this tools needed early in the build +# so we define it as a dependency of `context` target + +tools\incdir$(HOSTEXEEXT): + $(Q) $(MAKE) -C tools -f Makefile.host incdir INCDIR="$(TOPDIR)\tools\incdir.bat" + # Targets used to build include\nuttx\version.h. Creation of version.h is # part of the overall NuttX configuration sequence. Notice that the # tools\mkversion tool is built and used to create include\nuttx\version.h @@ -424,7 +425,7 @@ endif CONTEXTDIRS_DEPS = $(patsubst %,%\.context,$(CONTEXTDIRS)) -context: include\nuttx\config.h include\nuttx\version.h $(CONTEXTDIRS_DEPS) .dirlinks | staging +context: tools\incdir$(HOSTEXEEXT) include\nuttx\config.h include\nuttx\version.h $(CONTEXTDIRS_DEPS) .dirlinks | staging ifeq ($(NEED_MATH_H),y) context: include\math.h