From b27df02b486ffb8eb71021675e1962e3e69311de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 28 Jul 2016 10:36:28 -0600 Subject: [PATCH] Top-Level Makefiles. Fix a chicken-and-egg problem. In the menuconfig target, the context dependency was executed before kconfig-mconf. That was necessary because the link at apps/platform/board needed to be set up before creating the apps/Kconfig file. Otherwise, the platform Kconfig files would not be included. But this introduces the chicken-and-egg problem in some configurations. In particular: (1) An NX graphics configuration is used that requires auto-generation of source files using cpp, (2) the configuration is set for Linux, but (3) we are running under Cygwin with (4) a Windows native toolchain. In this case, POSIX-style symbolic links are set up but the Windows native toolchain cannot follow them. The reason we are running 'make menuconfig' is to change from Linux to Cygwin, but the target fails. During the context phase, NX runs CPP to generate source files but that fails because the Windows native toolchain cannot follow the links. Checkmate. This was fixed by changing all of the make menuconfig (and related) targets. They no long depend on context being run. Instead, they depend only on the dirlinks target. The dirlinks target only sets up the directory links but does not try to run all of the context setup; the compiler is never invoked; no code is autogeneraed; and things work. --- Makefile.unix | 12 ++++++------ Makefile.win | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile.unix b/Makefile.unix index bb249788974..75c9a849d79 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -470,32 +470,32 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT) # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # README.txt file in the NuttX tools GIT repository for additional information. -do_config: context apps_preconfig +do_config: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf Kconfig config: do_config clean_context -do_oldconfig: context apps_preconfig +do_oldconfig: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --oldconfig Kconfig oldconfig: do_oldconfig clean_context -do_olddefconfig: context apps_preconfig +do_olddefconfig: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --olddefconfig Kconfig olddefconfig: do_olddefconfig clean_context -do_menuconfig: context apps_preconfig +do_menuconfig: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-mconf Kconfig menuconfig: do_menuconfig clean_context -do_qconfig: context apps_preconfig +do_qconfig: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-qconf Kconfig qconfig: do_qconfig clean_context -gconfig: context apps_preconfig +gconfig: dirlinks apps_preconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-gconf Kconfig gconfig: do_gconfig clean_context diff --git a/Makefile.win b/Makefile.win index 1f30310525e..87b263b020f 100644 --- a/Makefile.win +++ b/Makefile.win @@ -466,22 +466,22 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT) # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # misc\tools\README.txt for additional information. -do_config: context apps_preconfig +do_config: dirlinks apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf Kconfig config: do_config clean_context -do_oldconfig: context apps_preconfig +do_oldconfig: dirlinks apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig oldconfig: do_oldconfig clean_context -do_olddefconfig: context apps_preconfig +do_olddefconfig: dirlinks apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --olddefconfig Kconfig olddefconfig: do_olddefconfig clean_context -do_menuconfig: context configenv apps_preconfig +do_menuconfig: dirlinks configenv apps_preconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-mconf Kconfig menuconfig: do_menuconfig clean_context