[][Add tool to support embed dm-verity bootargs into fdt]

[Description]
Add tool to support embed dm-verity bootargs into fdt

[Release-log]
N/A

Change-Id: I65ef262484ecc48efc513b0ef1a0cb96e5440011
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5850557
diff --git a/tools/fdt-patch-dm-verify/src/Makefile b/tools/fdt-patch-dm-verify/src/Makefile
new file mode 100644
index 0000000..233cf55
--- /dev/null
+++ b/tools/fdt-patch-dm-verify/src/Makefile
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2022 MediaTek Inc. All rights reserved.
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include libfdt/Makefile.libfdt
+
+OBJS := main.o $(LIBFDT_SRCS:%.c=libfdt/%.o)
+DEPS := $(OBJS:%.o=%.d)
+
+CC ?= gcc
+CFLAGS ?= -O2 -ffunction-sections
+LDFLAGS ?= -Wl,--gc-sections
+OPTFLAGS ?= -ggdb
+
+all: fdt-patch-dm-verify
+
+fdt-patch-dm-verify: $(OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+
+$(OBJS): %.o: %.c
+	$(CC) $(CFLAGS) $(OPTFLAGS) -Ilibfdt -MD -c -o $@ $<
+
+clean: libfdt_clean
+	rm -f fdt-patch-dm-verify $(OBJS) $(DEPS)
+
+.PHONY: clean
+
+-include $(DEPS)