[][openwrt][mt7988][tops][refactor tops-tool and add logger suuport]

[Description]
Refactor tops-tool and add logger support

add menu config for tops-tool
move common code into common part

save log cmd will open log relayfs and save
its data(log) as file in the filesystem

log relayfs path :
/sys/kernel/debug/tops/log-mgmt0
/sys/kernel/debug/tops/log-offload0

log file path :
<LOG_DIR>/log-mgmt-<time>
<LOG_DIR>/log-offload-<time>

[Release-log]
N/A

Change-Id: I1c563efbb584540eeb1b78c2a438c0173c4cdbba
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7988095
diff --git a/feed/app/tops-tool/src/Makefile b/feed/app/tops-tool/src/Makefile
index b125bdb..3d03c51 100644
--- a/feed/app/tops-tool/src/Makefile
+++ b/feed/app/tops-tool/src/Makefile
@@ -5,15 +5,18 @@
 # Author: Alvin Kuo <Alvin.Kuo@mediatek.com>
 #
 
-PROJECT := tops-tool
-OBJECTS := tops-tool.o dump.o
+PROJECT:= tops-tool
+
+OBJECTS-$(CONFIG_MTK_TOPS_TOOL_SAVE_LOG)+= logger.o
+
+OBJECTS:= tops-tool.o common.o dump.o $(OBJECTS-y)
 
 all: $(PROJECT)
 
 $(PROJECT): $(OBJECTS) Makefile
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
 
-%.o: %.c %.h Makefile
+%.o: %.c inc/%.h Makefile
 	$(CC) $(CFLAGS) -c $< -o $@
 
 .PHONY : clean