From a60a0a2cf7189d21879753f1823ae1ebf0cfd855 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Mon, 13 Jan 2014 11:05:52 +0100 Subject: [PATCH 1/3] Use dist Makefile style in examples Makefiles --- examples/ccn-lite-client/Makefile | 27 +++++++++++++++------- examples/ccn-lite-relay/Makefile | 27 +++++++++++++++------- examples/default/Makefile | 27 ++++++++++++++++------ examples/hello-world/Makefile | 13 +++++------ examples/ipc_pingpong/Makefile | 13 ++++++----- examples/rpl_udp/Makefile | 38 ++++++++++++++++++++++++------- 6 files changed, 101 insertions(+), 44 deletions(-) diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile index b006331443..b0f53ae99f 100644 --- a/examples/ccn-lite-client/Makefile +++ b/examples/ccn-lite-client/Makefile @@ -1,15 +1,18 @@ # name of your project export PROJECT = ccn-lite-client -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE = $(CURDIR)/../.. +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ -# uncomment this to enable scheduler statistics for ps +# Uncomment these lines if you want to use platform support from external +# repositories: +#export RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu +#export RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards + +# Uncomment this to enable scheduler statistics for ps: #CFLAGS += -DSCHEDSTATISTICS # If you want to use valgrind, you should recompile native with either @@ -20,7 +23,15 @@ export RIOTBASE = $(CURDIR)/../.. #CFLAGS += -DHAVE_VALGRIND_VALGRIND_H #CFLAGS += -DHAVE_VALGRIND_H -## Modules to include. +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +#CFLAGS += -DDEVELHELP + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 + +## Modules to include: USEMODULE += config USEMODULE += shell diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index cc1c700895..9909381aeb 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/examples/ccn-lite-relay/Makefile @@ -1,15 +1,18 @@ # name of your project export PROJECT = ccn-lite-relay -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE = $(CURDIR)/../.. +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ -# uncomment this to enable scheduler statistics for ps +# Uncomment these lines if you want to use platform support from external +# repositories: +#export RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu +#export RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards + +# Uncomment this to enable scheduler statistics for ps: #CFLAGS += -DSCHEDSTATISTICS # If you want to use valgrind, you should recompile native with either @@ -20,7 +23,15 @@ export RIOTBASE = $(CURDIR)/../.. #CFLAGS += -DHAVE_VALGRIND_VALGRIND_H #CFLAGS += -DHAVE_VALGRIND_H -## Modules to include. +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +#CFLAGS += -DDEVELHELP + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 + +## Modules to include: USEMODULE += config USEMODULE += uart0 diff --git a/examples/default/Makefile b/examples/default/Makefile index 1059db4777..32c4fabfca 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -1,15 +1,18 @@ # name of your project export PROJECT = default -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE = $(CURDIR)/../.. +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ -# uncomment this to enable scheduler statistics for ps +# Uncomment these lines if you want to use platform support from external +# repositories: +#export RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu +#export RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards + +# Uncomment this to enable scheduler statistics for ps: #CFLAGS += -DSCHEDSTATISTICS # If you want to use valgrind, you should recompile native with either @@ -20,6 +23,16 @@ export RIOTBASE = $(CURDIR)/../.. #CFLAGS += -DHAVE_VALGRIND_VALGRIND_H #CFLAGS += -DHAVE_VALGRIND_H +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +#CFLAGS += -DDEVELHELP + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 + +## Modules to include: + USEMODULE += posix USEMODULE += uart0 USEMODULE += shell diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile index 79c42307a6..f426dc9935 100644 --- a/examples/hello-world/Makefile +++ b/examples/hello-world/Makefile @@ -1,14 +1,13 @@ # name of your project export PROJECT = hello-world -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE = $(CURDIR)/../.. +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ -export QUIET := 1 +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 include $(RIOTBASE)/Makefile.include diff --git a/examples/ipc_pingpong/Makefile b/examples/ipc_pingpong/Makefile index a65c53e7ef..a3c630de89 100644 --- a/examples/ipc_pingpong/Makefile +++ b/examples/ipc_pingpong/Makefile @@ -1,12 +1,13 @@ # name of your project export PROJECT = ipc_pingpong -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE = $(CURDIR)/../.. +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 include $(RIOTBASE)/Makefile.include diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile index 1040d5b781..dec4d235ed 100644 --- a/examples/rpl_udp/Makefile +++ b/examples/rpl_udp/Makefile @@ -1,18 +1,40 @@ # name of your project export PROJECT = rpl_udp -# for easy switching of boards -ifeq ($(strip $(BOARD)),) - export BOARD = native -endif +# If not BOARD is found in the environment, use this default: +export BOARD ?= native + +# This has to be the absolute path to the RIOT base directory: +export RIOTBASE ?= $(CURDIR)/../../ + +# Uncomment these lines if you want to use platform support from external +# repositories: +#export RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu +#export RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards + +# Uncomment this to enable scheduler statistics for ps: +#CFLAGS += -DSCHEDSTATISTICS + +# If you want to use valgrind, you should recompile native with either +# HAVE_VALGRIND_H or HAVE_VALGRIND_VALGRIND_H depending on the location +# of the valgrind header (i.e. or ) +# For more information about the valgrind support of RIOT read: +# RIOT/cpu/native/README +#CFLAGS += -DHAVE_VALGRIND_VALGRIND_H +#CFLAGS += -DHAVE_VALGRIND_H + +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +#CFLAGS += -DDEVELHELP + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 # get rid of the mandatory RPL warning CFLAGS += "-Wno-cpp" -# this has to be the absolute path of the RIOT-base dir -export RIOTBASE =$(CURDIR)/../.. - -## Modules to include. +## Modules to include: USEMODULE += auto_init USEMODULE += shell From 498cc027b19a75358c46427526786c47eea52076 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Mon, 13 Jan 2014 11:12:14 +0100 Subject: [PATCH 2/3] dist/example Makefiles: not BOARD -> no BOARD, ## Modules -> # Modules --- dist/Makefile | 4 ++-- examples/ccn-lite-client/Makefile | 4 ++-- examples/ccn-lite-relay/Makefile | 4 ++-- examples/default/Makefile | 4 ++-- examples/hello-world/Makefile | 2 +- examples/ipc_pingpong/Makefile | 2 +- examples/rpl_udp/Makefile | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/Makefile b/dist/Makefile index 9a04a36edc..744609aed5 100644 --- a/dist/Makefile +++ b/dist/Makefile @@ -9,7 +9,7 @@ # Set the name of your project: export PROJECT = foobar -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: @@ -39,7 +39,7 @@ export RIOTBASE ?= $(CURDIR)/../../RIOT # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 -## Modules to include: +# Modules to include: #USEMODULE += shell #USEMODULE += uart0 diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile index b0f53ae99f..c440479e6c 100644 --- a/examples/ccn-lite-client/Makefile +++ b/examples/ccn-lite-client/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = ccn-lite-client -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: @@ -31,7 +31,7 @@ export RIOTBASE ?= $(CURDIR)/../../ # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 -## Modules to include: +# Modules to include: USEMODULE += config USEMODULE += shell diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index 9909381aeb..56e8c23789 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/examples/ccn-lite-relay/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = ccn-lite-relay -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: @@ -31,7 +31,7 @@ export RIOTBASE ?= $(CURDIR)/../../ # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 -## Modules to include: +# Modules to include: USEMODULE += config USEMODULE += uart0 diff --git a/examples/default/Makefile b/examples/default/Makefile index 32c4fabfca..64c85060bd 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = default -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: @@ -31,7 +31,7 @@ export RIOTBASE ?= $(CURDIR)/../../ # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 -## Modules to include: +# Modules to include: USEMODULE += posix USEMODULE += uart0 diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile index f426dc9935..e09d751a26 100644 --- a/examples/hello-world/Makefile +++ b/examples/hello-world/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = hello-world -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: diff --git a/examples/ipc_pingpong/Makefile b/examples/ipc_pingpong/Makefile index a3c630de89..4597db46a5 100644 --- a/examples/ipc_pingpong/Makefile +++ b/examples/ipc_pingpong/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = ipc_pingpong -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile index dec4d235ed..b0376da04a 100644 --- a/examples/rpl_udp/Makefile +++ b/examples/rpl_udp/Makefile @@ -1,7 +1,7 @@ # name of your project export PROJECT = rpl_udp -# If not BOARD is found in the environment, use this default: +# If no BOARD is found in the environment, use this default: export BOARD ?= native # This has to be the absolute path to the RIOT base directory: @@ -34,7 +34,7 @@ export QUIET ?= 1 # get rid of the mandatory RPL warning CFLAGS += "-Wno-cpp" -## Modules to include: +# Modules to include: USEMODULE += auto_init USEMODULE += shell From 57679f90dc228d258f131b7921f4e676fe9e8eb9 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Wed, 15 Jan 2014 17:26:10 +0100 Subject: [PATCH 3/3] remove trailing slashes from RIOTBASE variables addresses https://github.com/RIOT-OS/RIOT/pull/496#issuecomment-32170092 --- examples/ccn-lite-client/Makefile | 2 +- examples/ccn-lite-relay/Makefile | 2 +- examples/default/Makefile | 2 +- examples/hello-world/Makefile | 2 +- examples/ipc_pingpong/Makefile | 2 +- examples/rpl_udp/Makefile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile index c440479e6c..987d06bcbe 100644 --- a/examples/ccn-lite-client/Makefile +++ b/examples/ccn-lite-client/Makefile @@ -5,7 +5,7 @@ export PROJECT = ccn-lite-client export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Uncomment these lines if you want to use platform support from external # repositories: diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index 56e8c23789..4c0e61113f 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/examples/ccn-lite-relay/Makefile @@ -5,7 +5,7 @@ export PROJECT = ccn-lite-relay export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Uncomment these lines if you want to use platform support from external # repositories: diff --git a/examples/default/Makefile b/examples/default/Makefile index 64c85060bd..4dd2c77759 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -5,7 +5,7 @@ export PROJECT = default export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Uncomment these lines if you want to use platform support from external # repositories: diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile index e09d751a26..0b98fa9590 100644 --- a/examples/hello-world/Makefile +++ b/examples/hello-world/Makefile @@ -5,7 +5,7 @@ export PROJECT = hello-world export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 diff --git a/examples/ipc_pingpong/Makefile b/examples/ipc_pingpong/Makefile index 4597db46a5..53c54937ab 100644 --- a/examples/ipc_pingpong/Makefile +++ b/examples/ipc_pingpong/Makefile @@ -5,7 +5,7 @@ export PROJECT = ipc_pingpong export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Change this to 0 show compiler invocation lines by default: export QUIET ?= 1 diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile index b0376da04a..96dd0621a5 100644 --- a/examples/rpl_udp/Makefile +++ b/examples/rpl_udp/Makefile @@ -5,7 +5,7 @@ export PROJECT = rpl_udp export BOARD ?= native # This has to be the absolute path to the RIOT base directory: -export RIOTBASE ?= $(CURDIR)/../../ +export RIOTBASE ?= $(CURDIR)/../.. # Uncomment these lines if you want to use platform support from external # repositories: