Commit 0829ddfe authored by Sebastian Bøe's avatar Sebastian Bøe Committed by Anas Nashif
Browse files

kbuild: Removed KBuild

parent 7736df02
Loading
Loading
Loading
Loading

Kbuild

deleted100644 → 0
+0 −56
Original line number Diff line number Diff line
# vim: filetype=make

define filechk_configs.c
	(echo "/* file is auto-generated, do not modify ! */"; \
	echo; \
	echo "#include <toolchain.h>"; \
	echo; \
	echo "GEN_ABS_SYM_BEGIN (_ConfigAbsSyms)"; \
	echo; \
	cat $(CURDIR)/include/generated/autoconf.h | sed \
	's/".*"/1/' | awk  \
	'/#define/{printf "GEN_ABSOLUTE_SYM(%s, %s);\n", $$2, $$3}'; \
	echo; \
	echo "GEN_ABS_SYM_END";)
endef

misc/generated/configs.c: include/config/auto.conf FORCE
	$(call filechk,configs.c)

targets := misc/generated/configs.c
targets += include/generated/offsets.h


always := misc/generated/configs.c
always += include/generated/offsets.h

define rule_cc_o_c_1
	$(call echo-cmd,cc_o_c_1) $(cmd_cc_o_c_1);
endef

cmd_cc_o_c_1 = $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(ZEPHYRINCLUDE) -c -o $@ $<

arch/$(ARCH)/core/offsets/offsets.o: arch/$(ARCH)/core/offsets/offsets.c $(KCONFIG_CONFIG) \
				include/generated/generated_dts_board.h
	$(Q)mkdir -p $(dir $@)
	$(call if_changed,cc_o_c_1)


define offsetchk
	$(Q)set -e;                                                \
	$(kecho) '  CHK     $@';                                   \
	mkdir -p $(dir $@);                                        \
	$(srctree)/scripts/gen_offset_header.py -i $(1) -o $@.tmp; \
	if [ -r $@ ] && cmp -s $@ $@.tmp; then                     \
	rm -f $@.tmp;                                              \
	else                                                       \
	$(kecho) '  UPD     $@';                                   \
	mv -f $@.tmp $@;                                           \
	fi
endef

include/generated/offsets.h: arch/$(ARCH)/core/offsets/offsets.o \
			     include/config/auto.conf FORCE
	$(call offsetchk,arch/$(ARCH)/core/offsets/offsets.o)

Makefile

deleted100644 → 0
+0 −1460

File deleted.

Preview size limit exceeded, changes collapsed.

Makefile.inc

deleted100644 → 0
+0 −154
Original line number Diff line number Diff line
# vim: filetype=make
#

UNAME := $(shell uname)
ifeq (MINGW, $(findstring MINGW, $(UNAME)))
DQUOTE = '
# '
PROJECT_BASE ?= $(shell sh -c "pwd -W")
else
DQUOTE = "
# "
PROJECT_BASE ?= $(CURDIR)
endif

ifdef BOARD
KBUILD_DEFCONFIG_PATH=$(wildcard $(ZEPHYR_BASE)/boards/*/*/$(BOARD)_defconfig)
ifeq ($(KBUILD_DEFCONFIG_PATH),)
$(error Board $(BOARD) not found!)
endif
else
$(error BOARD is not defined!)
endif

# Choose a default output directory if one wasn't supplied.  Note that
# PRISTINE_O depends on whether this is default or not.  If building
# in-tree, we want to remove the whole outdir and not just the BOARD
# specified (thus "pristine").  Out of tree, we can obviously remove
# only what we were told to build.
ifndef O
PRISTINE_O = outdir
O = $(PROJECT_BASE)/outdir/$(BOARD)
else
PRISTINE_O = $(O)
endif

# Turn O into an absolute path; we call the main Kbuild with $(MAKE) -C
# which changes the working directory, relative paths don't work right.
# Need to create the directory first to make realpath happy

ifneq ($(MAKECMDGOALS),help)
$(shell mkdir -p $(O))
override O := $(realpath $(O))
endif

export ARCH QEMU_EXTRA_FLAGS PROJECT_BASE

override CONF_FILE := $(strip $(subst $(DQUOTE),,$(CONF_FILE)))

SOURCE_DIR ?= $(PROJECT_BASE)/src/
override SOURCE_DIR := $(realpath $(SOURCE_DIR))
override SOURCE_DIR := $(subst \,/,$(SOURCE_DIR))
override SOURCE_DIR_PARENT := $(patsubst %, %/.., $(SOURCE_DIR))
override SOURCE_DIR_PARENT := $(abspath $(SOURCE_DIR_PARENT))
override SOURCE_DIR_PARENT := $(subst \,/,$(SOURCE_DIR_PARENT))
export SOURCE_DIR SOURCE_DIR_PARENT

ifeq ("$(origin V)", "command line")
  KBUILD_VERBOSE = $(V)
endif
ifndef KBUILD_VERBOSE
  KBUILD_VERBOSE = 0
endif

ifeq ($(KBUILD_VERBOSE),1)
  Q =
  S =
else
  Q = @
  S = -s
endif

export CFLAGS

zephyrmake	= +$(MAKE) -C $(ZEPHYR_BASE)  O=$(1) \
			PROJECT=$(PROJECT_BASE) SOURCE_DIR=$(DQUOTE)$(SOURCE_DIR)$(DQUOTE) $(2)

BOARDCONFIG = $(O)/.board_$(BOARD)

DOTCONFIG = $(O)/.config

all: $(DOTCONFIG)
	$(Q)$(call zephyrmake,$(O),$@)

debug:	$(DOTCONFIG)
	$(Q)$(call zephyrmake,$(O),$@)

flash: $(DOTCONFIG)
	$(Q)$(call zephyrmake,$(O),$@)

run: $(DOTCONFIG)
	$(Q)$(call zephyrmake,$(O),$@)

ifeq ($(MAKECMDGOALS),debugserver)
ARCH = $(notdir $(subst /$(BOARD),,$(wildcard $(ZEPHYR_BASE)/boards/*/$(BOARD))))
BOARD_DIR = $(dir $(wildcard $(ZEPHYR_BASE)/boards/*/*/$(BOARD)_defconfig))
-include $(BOARD_DIR)/Makefile.board
-include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
BOARD_NAME = $(BOARD)
export BOARD_NAME
endif

ifneq ($(DEBUG_SCRIPT),)
debugserver: FORCE
	$(Q)$(ZEPHYR_BASE)/scripts/support/zephyr_flash_debug.py debugserver $(ZEPHYR_BASE)/scripts/support/$(DEBUG_SCRIPT)
else
debugserver: FORCE
	@echo Debugging not supported with this board.
	@echo Please check the documentation for alternate instructions.
endif

initconfig: $(DOTCONFIG)

$(BOARDCONFIG):
	@rm -f $(O)/.board_*
	@touch $@

ram_report: initconfig
	$(Q)$(call zephyrmake,$(O),$@)

rom_report: initconfig
	$(Q)$(call zephyrmake,$(O),$@)

outputexports: initconfig
	$(Q)$(call zephyrmake,$(O),$@)

dts: initconfig
	$(Q)$(call zephyrmake,$(O),$@)

config-sanitycheck: dts
	$(Q)$(call zephyrmake,$(O),$@)

menuconfig: initconfig
	$(Q)$(call zephyrmake,$(O),$@)

help:
	$(Q)$(MAKE) -s -C $(ZEPHYR_BASE) $@

# Catch all
%:
	$(Q)$(call zephyrmake,$(O),$@)

$(DOTCONFIG): $(BOARDCONFIG) $(KBUILD_DEFCONFIG_PATH) $(CONF_FILE)
	$(Q)$(CONFIG_SHELL) $(ZEPHYR_BASE)/scripts/kconfig/merge_config.sh \
		-q -m -O $(O) $(KBUILD_DEFCONFIG_PATH) $(OVERLAY_CONFIG) $(CONF_FILE) \
			      $(sort $(wildcard $(O)/*.conf))
	$(Q)$(MAKE) $(S) -C $(ZEPHYR_BASE) O=$(O) PROJECT=$(PROJECT_BASE) oldnoconfig

pristine:
	$(Q)rm -rf $(PRISTINE_O)

PHONY += FORCE initconfig
FORCE:

.PHONY: $(PHONY)

Makefile.test

deleted100644 → 0
+0 −4
Original line number Diff line number Diff line

OVERLAY_CONFIG += $(ZEPHYR_BASE)/tests/include/test.config

include ${ZEPHYR_BASE}/Makefile.inc

arch/Makefile

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
obj-y += common/ $(ARCH)/
Loading