Skip to content

Commit

Permalink
[DBUILD] Upgraded to support DBUILD with Kconfig support.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswalmsley committed Oct 3, 2013
1 parent 0a6f965 commit bbe5f1c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

include $(BASE).config

CONFIG_:=BT_CONFIG_

ARCH:=$(shell echo $(BT_CONFIG_ARCH))
SUBARCH:=$(shell echo $(BT_CONFIG_SUBARCH))
TOOLCHAIN:=$(shell echo $(BT_CONFIG_TOOLCHAIN))
Expand Down
29 changes: 27 additions & 2 deletions .dbuild/dbuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ all: dbuild_entry _all
# targets and subdirs as found in objects.mk and subdirs.mk
#
-include $(DBUILD_ROOT).config.mk
-include $(DBUILD_ROOT).config
-include objects.mk
-include targets.mk
-include subdirs.mk
Expand All @@ -63,10 +64,15 @@ OBJECTS += $(OBJECTS-y)
-include dbuild.config.mk
-include $(BUILD_ROOT)dbuild.config.mk

CONFIG_ ?= CONFIG_
CONFIG_PATH ?= $(DBUILD_ROOT)
CONFIG_HEADER_PATH ?= $(DBUILD_ROOT)
CONFIG_HEADER_NAME ?= "config.h"

#
# Defaults for compile/build toolchain
#
override TOOLCHAIN ?=
override TOOLCHAIN := $(shell echo $($(CONFIG_)TOOLCHAIN))
override AR = $(TOOLCHAIN)ar
override AS = $(TOOLCHAIN)as
override CC = $(TOOLCHAIN)gcc
Expand All @@ -76,6 +82,16 @@ override OBJCOPY = $(TOOLCHAIN)objcopy
override OBJDUMP = $(TOOLCHAIN)objdump
override SIZE = $(TOOLCHAIN)size

export TOOLCHAIN
export AR
export AS
export CC
export CXX
export LD
export OBJCOPY
export OBJDUMP
export SIZE

CFLAGS += -c

CFLAGS += $(ADD_CFLAGS)
Expand Down Expand Up @@ -129,7 +145,16 @@ else
@echo " Version ($(DBUILD_VERSION_MAJOR).$(DBUILD_VERSION_MINOR).$(DBUILD_VERSION_REVISION) - $(DBUILD_VERSION_NAME))"
endif

EXPORTS=CFLAGS
menuconfig: $(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig
$(Q)CONFIG_=$(CONFIG_) APP_DIR=$(APP_DIR) kconfig-mconf Kconfig
$(Q)$(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig ./ > $(CONFIG_HEADER_PATH)/$(CONFIG_HEADER_NAME)
ifneq ($(CONFIG_PATH),$(DBUILD_ROOT))
$(Q)cp .config $(CONFIG_PATH)/.config
endif

$(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig: $(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig.c
$(Q)gcc $(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig.c $(DBUILD_ROOT).dbuild/scripts/mkconfig/cfgparser.c $(DBUILD_ROOT).dbuild/scripts/mkconfig/cfgdefine.c -o $(DBUILD_ROOT).dbuild/scripts/mkconfig/mkconfig


#
# Finally provide an implementation of the silent target.
Expand Down
11 changes: 11 additions & 0 deletions .dbuild/info.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@

info.config:
@echo "CONFIG_ : " $(CONFIG_)
@echo "TOOLCHAIN: " $($(CONFIG_)TOOLCHAIN)

info.toolchain:
@echo "BUILD_ROOT: " $(DBUILD_ROOT)
@echo "TOOLCHAIN : " $(TOOLCHAIN)
@echo "CC : " $(CC)
@echo "CXX : " $(CXX)

info.subdirs:
@echo $(SUBDIRS)

0 comments on commit bbe5f1c

Please sign in to comment.