Skip to content

Commit

Permalink
build: Move .config check to the top Makefile
Browse files Browse the repository at this point in the history
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 authored and Ouss4 committed May 20, 2020
1 parent 3c622db commit 1a95cce
Show file tree
Hide file tree
Showing 279 changed files with 305 additions and 342 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@
# make -f tools/Makefile.win
#

-include .config
ifeq ($(wildcard .config),)
.DEFAULT:
@echo "Nuttx has not been configured:"
@echo " tools/configure.sh <target>"

clean distclean:
@:
else
include .config
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
include tools/Makefile.win
else
include tools/Makefile.unix
endif
endif
4 changes: 2 additions & 2 deletions arch/arm/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip$(DELIM)Make.defs
include $(TOPDIR)/Make.defs
include chip$(DELIM)Make.defs

ifeq ($(CONFIG_ARCH_ARMV7A),y) # ARMv7-A
ARCH_SUBDIR = armv7-a
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/lpc43xx/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ CHIP_CSRCS += lpc43_usb0dev.c
endif
endif

-include chip/spifi/src/Make.defs
include chip/spifi/src/Make.defs
4 changes: 2 additions & 2 deletions arch/avr/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_FAMILY_AVR32),y)
ARCH_SUBDIR = avr32
Expand Down
4 changes: 2 additions & 2 deletions arch/hc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_HC12),y)
ARCH_SUBDIR = hc12
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_MIPS),y)
ARCH_SUBDIR = mips32
Expand Down
4 changes: 2 additions & 2 deletions arch/misoc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_CHIP_LM32),y)
ARCH_SUBDIR = lm32
Expand Down
4 changes: 2 additions & 2 deletions arch/or1k/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip$(DELIM)Make.defs
include $(TOPDIR)/Make.defs
include chip$(DELIM)Make.defs

ifeq ($(CONFIG_ARCH_MOR1KX),y) # OpenRISC mor1kx
ARCH_SUBDIR = mor1kx
Expand Down
4 changes: 2 additions & 2 deletions arch/renesas/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

CPPFLAGS += $(EXTRAFLAGS)
CFLAGS += $(EXTRAFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion arch/sim/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CPPFLAGS += -I$(ARCH_SRCDIR)/chip -I$(TOPDIR)/sched $(EXTRAFLAGS)
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_I486),y)
ARCH_SUBDIR = i486
Expand Down
4 changes: 2 additions & 2 deletions arch/x86_64/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_INTEL64),y)
ARCH_SUBDIR = intel64
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

ifeq ($(CONFIG_ARCH_FAMILY_LX6),y)
ARCH_SUBDIR = lx6
Expand Down
4 changes: 2 additions & 2 deletions arch/z16/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs

COMPILER = ${shell basename "$(CC)"}
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
Expand Down
6 changes: 3 additions & 3 deletions arch/z80/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

# Makefile fragments

-include $(TOPDIR)/Make.defs
-include chip/Make.defs
-include board/Make.defs
include $(TOPDIR)/Make.defs
include chip/Make.defs
include board/Make.defs

# Compiler-Dependent Make: SDCC or ZiLOG ZDS-II

Expand Down
2 changes: 1 addition & 1 deletion arch/z80/src/Makefile.zdsiil
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
############################################################################

-include $(TOPDIR)\Make.defs
include $(TOPDIR)\Make.defs

############################################################################
# Tools
Expand Down
2 changes: 1 addition & 1 deletion arch/z80/src/Makefile.zdsiiw
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
############################################################################

-include $(TOPDIR)\Make.defs
include $(TOPDIR)\Make.defs

# Tools

Expand Down
3 changes: 1 addition & 2 deletions audio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
include $(TOPDIR)/Make.defs

DEPPATH = --dep-path .
ASRCS =
Expand Down
3 changes: 1 addition & 2 deletions binfmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
include $(TOPDIR)/Make.defs

# Basic BINFMT source files

Expand Down
2 changes: 1 addition & 1 deletion boards/Board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ifneq ($(RCSRCS)$(RCRAWS),)
ETCDIR := etctmp
Expand Down
2 changes: 1 addition & 1 deletion boards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

# Determine if there is a Kconfig file for any custom board configuration

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/a1x/pcduino-a10/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = a1x_boot.c a1x_bringup.c a1x_leds.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/am335x/beaglebone-black/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = am335x_boot.c am335x_bringup.c am335x_leds.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/c5471/c5471evm/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = c5471_leds.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/cxd56xx/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

include board$(DELIM)Make.defs
include src$(DELIM)Make.defs
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/dm320/ntosd-dm320/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = dm320_leds.c dm320_network.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/efm32/efm32-g8xx-stk/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = efm32_boot.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/efm32/efm32gg-stk3700/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = efm32_boot.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/efm32/olimex-efm32g880f128-stk/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = efm32_boot.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imx6/sabre-6quad/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = imx_boardinit.c imx_bringup.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1020-evk/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = imxrt_flexspi_nor_flash.c imxrt_boot.c imxrt_flexspi_nor_boot.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1050-evk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

# This is the directory for the board-specific header files

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1050-evk/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = imxrt_boot.c imxrt_flexspi_nor_boot.c imxrt_flexspi_nor_flash.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1060-evk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

# This is the directory for the board-specific header files

Expand Down
2 changes: 1 addition & 1 deletion boards/arm/imxrt/imxrt1060-evk/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = imxrt_boot.c imxrt_flexspi_nor_boot.c imxrt_flexspi_nor_flash.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/kinetis/freedom-k28f/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = k28_boot.c k28_bringup.c k28_spi.c k28_i2c.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/kinetis/freedom-k64f/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = k64_boot.c k64_spi.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/kinetis/freedom-k66f/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = k66_boot.c k66_spi.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/kinetis/kwikstik-k40/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = k40_boot.c k40_lcd.c k40_spi.c
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/kinetis/teensy-3.x/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
include $(TOPDIR)/Make.defs

ASRCS =
CSRCS = k20_boot.c k20_spi.c k20_i2c.c
Expand Down
Loading

0 comments on commit 1a95cce

Please sign in to comment.