]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/samsung/origen/Makefile
kbuild: change out-of-tree build
[karo-tx-uboot.git] / board / samsung / origen / Makefile
index e8818bf9b11f18a6a855bcc685d61c1a12a5c184..37acba71e010f4c3a6b0198bd021f42bb8503aaf 100644 (file)
@@ -4,16 +4,16 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y  += origen.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
+hostprogs-y := tools/mkorigenspl
+always := $(hostprogs-y)
 
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:        tools/mkv310_image.c
-       $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+# omit -O2 option to suppress
+#   warning: dereferencing type-punned pointer will break strict-aliasing rules
+#
+# TODO:
+# Fix the root cause in tools/mkorigenspl.c and delete the following work-around
+$(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
+else
+obj-y  += origen.o
 endif