From 1cdd4ffb124f936c499a751ffc750790244148fd Mon Sep 17 00:00:00 2001
From: George Oikonomou <george@contiki-ng.org>
Date: Sun, 14 Oct 2018 17:00:40 +0100
Subject: [PATCH] Move the help and usage targets to a separate Makefile

---
 Makefile.help    | 29 +++++++++++++++++++++++++++++
 Makefile.include | 29 +----------------------------
 2 files changed, 30 insertions(+), 28 deletions(-)
 create mode 100644 Makefile.help

diff --git a/Makefile.help b/Makefile.help
new file mode 100644
index 0000000000..d8de20c00b
--- /dev/null
+++ b/Makefile.help
@@ -0,0 +1,29 @@
+usage:
+	@echo "Usage:"
+	@echo "    make [TARGET=(TARGET)] [BOARD=(BOARD)] [DEFINES=(DEFINES)] [PORT=(PORT)] [target]"
+	@echo ""
+	@echo "Typical usage:"
+	@echo "    make [TARGET=(TARGET)] [BOARD=(BOARD)] [all]"
+	@echo ""
+	@echo "    Will build Contiki-NG firmware(s) from the current example dir"
+	@echo "    for platform TARGET, board BOARD."
+	@echo ""
+	@echo "Miscellaneous targets:"
+	@echo "    targets         Prints list of supported platforms"
+	@echo "    boards          Prints a list of supported boards for TARGET"
+	@echo "    savetarget      Saves TARGET and BOARD for future invocations of make"
+	@echo "    savedefines     Saves DEFINES for future invocations of make"
+	@echo "    clean           Removes all compiled files for TARGET"
+	@echo "    distclean       Removes all compiled files for all TARGETs"
+	@echo "    viewconf        Prints Contiki-NG build configuration for TARGET"
+	@echo "    %.flashprof     Shows a Flash/ROM profile of a given firmware (e.g. hello-world.flashprof)"
+	@echo "    %.ramprof       Shows a RAM profile of a given firmware (e.g. hello-world.ramprof)"
+	@echo "    %.o             Produces an object file from a given source file (e.g. hello-world.o)"
+	@echo "    %.e             Produces the pre-processed version of a given source file (e.g. hello-world.e)"
+	@echo "    %.s             Produces an assembly file from a given source file (e.g. hello-world.s)"
+	@echo "    login           View the serial output of the device connected to PORT"
+	@echo "    serialview      Same as login, but prepend serial output with a unix timestamp"
+	@echo "    serialdump      same as serialview, but also save the output to a file"
+	@echo "    motelist-all    Prints a list of connected devices"
+
+help: usage
diff --git a/Makefile.include b/Makefile.include
index 3578730eb7..a194274bd5 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -395,34 +395,7 @@ endif
 %.flashprof: %.$(TARGET)
 	$(NM) -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4
 
-usage:
-	@echo "Usage:"
-	@echo "    make [TARGET=(TARGET)] [BOARD=(BOARD)] [DEFINES=(DEFINES)] [PORT=(PORT)] [target]"
-	@echo ""
-	@echo "Typical usage:"
-	@echo "    make [TARGET=(TARGET)] [BOARD=(BOARD)] [all]"
-	@echo ""
-	@echo "    Will build Contiki-NG firmware(s) from the current example dir"
-	@echo "    for platform TARGET, board BOARD."
-	@echo ""
-	@echo "Miscellaneous targets:"
-	@echo "    targets         Prints list of supported platforms"
-	@echo "    boards          Prints a list of supported boards for TARGET"
-	@echo "    savetarget      Saves TARGET and BOARD for future invocations of make"
-	@echo "    savedefines     Saves DEFINES for future invocations of make"
-	@echo "    clean           Removes all compiled files for TARGET"
-	@echo "    distclean       Removes all compiled files for all TARGETs"
-	@echo "    viewconf        Prints Contiki-NG build configuration for TARGET"
-	@echo "    %.flashprof     Shows a Flash/ROM profile of a given firmware (e.g. hello-world.flashprof)"
-	@echo "    %.ramprof       Shows a RAM profile of a given firmware (e.g. hello-world.ramprof)"
-	@echo "    %.o             Produces an object file from a given source file (e.g. hello-world.o)"
-	@echo "    %.e             Produces the pre-processed version of a given source file (e.g. hello-world.e)"
-	@echo "    %.s             Produces an assembly file from a given source file (e.g. hello-world.s)"
-	@echo "    login           View the serial output of the device connected to PORT"
-	@echo "    serialview      Same as login, but prepend serial output with a unix timestamp"
-	@echo "    serialdump      same as serialview, but also save the output to a file"
-
-help: usage
+include $(CONTIKI)/Makefile.help
 
 targets:
 	@ls $(CONTIKI)/arch/platform $(TARGETDIRS)
-- 
GitLab