]> git.karo-electronics.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 0b1ae1bb514d2960ae5cb2737c4a526346e4b849..37acba71e010f4c3a6b0198bd021f42bb8503aaf 100644 (file)
@@ -4,38 +4,16 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB    = $(obj)lib$(BOARD).o
-
-ifndef CONFIG_SPL_BUILD
-COBJS  += origen.o
-endif
-
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-ALL    +=$(obj).depend $(LIB)
-
 ifdef CONFIG_SPL_BUILD
-ALL    += $(OBJTREE)/tools/mk$(BOARD)spl
-endif
-
-all:   $(ALL)
+hostprogs-y := tools/mkorigenspl
+always := $(hostprogs-y)
 
-$(LIB):        $(OBJS)
-       $(call cmd_link_o_target, $(OBJS))
-
-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
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################