@@ -81,3 +81,9 @@ cscope.*
# spl ais files
/spl/*.ais
+
+# new things
+modules.order
+*.o.cmd
+.config
+*.cmd
@@ -21,6 +21,9 @@
# MA 02111-1307 USA
#
+# Skip this entire file if using Kconfig
+ifeq ($(KCONFIG_CONFIG),)
+
#########################################################################
# Set shell to bash if possible, otherwise fall back to sh
@@ -362,3 +365,5 @@ cmd_link_o_target = $(if $(strip $1),\
rm -f $@; $(AR) rcs $@ )
#########################################################################
+
+endif # Kconfig skip
new file mode 100644
@@ -0,0 +1,21 @@
+#
+# Makefile for the linux kernel.
+#
+
+obj-y := main.o #version.o
+
+# dependencies on generated files need to be listed explicitly
+$(obj)/version.o: include/generated/compile.h
+
+# compile.h changes depending on hostname, generation number, etc,
+# so we regenerate it always.
+# mkcompile_h will make sure to only update the
+# actual file if its content has changed.
+
+ chk_compile.h = :
+ quiet_chk_compile.h = echo ' CHK $@'
+silent_chk_compile.h = :
+include/generated/compile.h: FORCE
+ @$($(quiet)chk_compile.h)
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
new file mode 100644
@@ -21,6 +21,9 @@
# MA 02111-1307 USA
#
+# For Kconfig we do something completely different
+ifeq ($(KCONFIG_CONFIG),)
+
#########################################################################
_depend: $(obj).depend
@@ -66,3 +69,25 @@ $(NOPEDOBJS): $(obj)%.o: %.c
$(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
#########################################################################
+
+else
+# Kconfig implementaiton
+
+# Pick up any object files that ended up in COBJS
+obj-y += $(COBJS)
+
+# Assembler files also
+obj-y += $(SOBJS)
+
+# File containing start of U-Boot
+obj-y += $(STARTOBJS)
+
+# ARM has some library files we want
+obj-y += $(GLSOBJS) $(GLCOBJS)
+
+# Mark those in COBJS- as missing (available but not to be linked)
+# Otherwise kbuild will fail to create an empty built-in.o in this
+# directory.
+obj- += $(COBJS-)
+
+endif
To use this, do make -f Makefile.kbuild when building U-Boot, instead of just make Signed-off-by: Simon Glass <sjg@chromium.org> --- .gitignore | 6 ++++++ config.mk | 5 +++++ init/Makefile | 21 +++++++++++++++++++++ init/main.c | 0 rules.mk | 25 +++++++++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 init/Makefile create mode 100644 init/main.c