diff --git a/Makefile.defaultmodules b/Makefile.defaultmodules new file mode 100644 index 0000000000000000000000000000000000000000..fa37f3e5517582e580c39cda3df6bff16a296db2 --- /dev/null +++ b/Makefile.defaultmodules @@ -0,0 +1,3 @@ +DEFAULT_MODULE += cpu core sys + +DEFAULT_MODULE += auto_init diff --git a/Makefile.include b/Makefile.include index 330768004e84635fdb52ecbca710ebefe1c3812d..8977118f46f4bc3bc187973f06235dd4d9055575 100644 --- a/Makefile.include +++ b/Makefile.include @@ -48,6 +48,11 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.include include $(RIOTCPU)/$(CPU)/Makefile.include include $(RIOTBASE)/Makefile.dep +# Test if there where dependencies against a module in DISABLE_MODULE. +ifneq (, $(filter $(DISABLE_MODULE), $(USEMODULE))) +$(error "Required modules were disabled using DISABLE_MODULE: $(sort $(filter $(DISABLE_MODULE), $(USEMODULE)))") +endif + # Test if the input language was specified externally. # Otherwise test if the compiler unterstands the "-std=gnu99" flag, and use it if so. # Otherwise test if the compiler unterstands the "-std=c99" flag, and use it if so. diff --git a/Makefile.modules b/Makefile.modules index 0c378806e7e7e8f28f9088e4e58dac0ab8329d86..6013c3b359d092d88f7c2c09e70c3612253b297d 100644 --- a/Makefile.modules +++ b/Makefile.modules @@ -1,8 +1,10 @@ UNDEF += $(BINDIR)startup.o include $(RIOTBASE)/Makefile.pseudomodules +include $(RIOTBASE)/Makefile.defaultmodules + +USEMODULE += $(filter-out $(DISABLE_MODULE), $(DEFAULT_MODULE)) -USEMODULE += cpu core sys INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include ED = $(USEMODULE:%=-DMODULE_%) ED += $(USEPKG:%=-DMODULE_%) diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile index 57420b83597a4680572e03100134fabdbce7acf6..9118a91a20ad9e4287c3cf986270c35546222fde 100644 --- a/examples/ccn-lite-client/Makefile +++ b/examples/ccn-lite-client/Makefile @@ -34,7 +34,6 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += posix USEMODULE += ps -USEMODULE += auto_init USEMODULE += random USEMODULE += transceiver ifeq ($(BOARD),msba2) diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index b5ad2a02074ce508fa82c809acc5046041b58762..80aa25d0d6bbae8cf47e56ea94101b1ff6854173 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/examples/ccn-lite-relay/Makefile @@ -31,9 +31,6 @@ export QUIET ?= 1 USEMODULE += config USEMODULE += posix -USEMODULE += auto_init - -USEMODULE += auto_init USEMODULE += transceiver ifeq ($(BOARD),msba2) diff --git a/examples/default/Makefile b/examples/default/Makefile index 04f948076ca72acb760ca33df2d14c2de03354aa..b1b135e65c7b3715f7708cf7990c95f8e851a741 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -34,7 +34,6 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += ps USEMODULE += vtimer -USEMODULE += auto_init USEMODULE += defaulttransceiver ifneq (,$(filter msb-430,$(BOARD))) diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile index 53492aae2bb63888f80b3d12a248c0676eeca57f..e1163453c66c249a2c44c7a76d57bea91a10e025 100644 --- a/examples/rpl_udp/Makefile +++ b/examples/rpl_udp/Makefile @@ -36,7 +36,6 @@ endif # Modules to include: -USEMODULE += auto_init USEMODULE += shell USEMODULE += shell_commands USEMODULE += posix diff --git a/tests/test_bloom/Makefile b/tests/test_bloom/Makefile index 5130dfb6c55153d2333c0c34160fb826145105d2..e78b2fef9ad649dcdaeba1ef4ea37386264f7f59 100644 --- a/tests/test_bloom/Makefile +++ b/tests/test_bloom/Makefile @@ -12,6 +12,8 @@ USEMODULE += bloom export PROJDEPS = sets.h +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include sets.h: generate_sets.py words.txt.gz diff --git a/tests/test_bloom_bytes/Makefile b/tests/test_bloom_bytes/Makefile index 4b26fb6a2e9288ff45e9c841e7b5d151d6a3a6b4..525b6e88cc30abbd949b511dd0473c3de90108c3 100644 --- a/tests/test_bloom_bytes/Makefile +++ b/tests/test_bloom_bytes/Makefile @@ -9,5 +9,7 @@ USEMODULE += hashes USEMODULE += bloom USEMODULE += random +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include endif diff --git a/tests/test_disable_module/Makefile b/tests/test_disable_module/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..8ec07da85424a5941d69be2958010a083ad2db9c --- /dev/null +++ b/tests/test_disable_module/Makefile @@ -0,0 +1,6 @@ +export PROJECT = test_disable_module +include ../Makefile.tests_common + +DISABLE_MODULE += auto_init + +include $(RIOTBASE)/Makefile.include diff --git a/tests/test_disable_module/main.c b/tests/test_disable_module/main.c new file mode 100644 index 0000000000000000000000000000000000000000..aa9de6cc7179736d9ed51ad374bc566f376b53ed --- /dev/null +++ b/tests/test_disable_module/main.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @ingroup tests + * @{ + * + * @file + * @brief Test whether DISABLE_MODULE works. + * + * @author René Kijewski <rene.kijewski@fu-berlin.de> + * + * @} + */ + +#include <stdio.h> + +int main(void) +{ + puts("Start."); + +# ifdef MODULE_AUTO_INIT + puts("-ERROR: MODULE_AUTO_INIT present!"); +# else + puts("+OK: MODULE_AUTO_INIT absent."); +# endif + + puts("Done."); + return 0; +} diff --git a/tests/test_float/Makefile b/tests/test_float/Makefile index 69d4ae71f4d50a792eba90d8cb5636ddfc04c763..8f4b911c2093da02a4afdb553b1ad02dc168da86 100644 --- a/tests/test_float/Makefile +++ b/tests/test_float/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_float include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_hwtimer/Makefile b/tests/test_hwtimer/Makefile index 87bfc5a8011ea34c474210af8b56f3c4d10e110a..e5646a2ebbeadf26f8e50c190ac879d7b19f7d06 100644 --- a/tests/test_hwtimer/Makefile +++ b/tests/test_hwtimer/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_hwtimer include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_hwtimer_spin/Makefile b/tests/test_hwtimer_spin/Makefile index 1dc49ec94aad5c4d368fcc6614cb70b82d3a700e..fc10ae4c2672515cb538d5c90d61cd56de723d9f 100644 --- a/tests/test_hwtimer_spin/Makefile +++ b/tests/test_hwtimer_spin/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_hwtimer_spin include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_irq/Makefile b/tests/test_irq/Makefile index 37536811bd395fc55b22fe13d84218978fb16458..bb56d210534b827bbde5884e5aaf8bb35dd0c758 100644 --- a/tests/test_irq/Makefile +++ b/tests/test_irq/Makefile @@ -5,7 +5,6 @@ ifeq (,$(filter native,$(BOARD))) include $(RIOTBASE)/Makefile.unsupported else -USEMODULE += auto_init USEMODULE += posix include $(RIOTBASE)/Makefile.include diff --git a/tests/test_mutex_unlock_and_sleep/Makefile b/tests/test_mutex_unlock_and_sleep/Makefile index 2a99c8dfc8d73271180c6ddf3ad678def0eb6d79..d6293d4c42f292f883b611621dceefe62590a845 100644 --- a/tests/test_mutex_unlock_and_sleep/Makefile +++ b/tests/test_mutex_unlock_and_sleep/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_mutex_unlock_and_sleep include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_nativenet/Makefile b/tests/test_nativenet/Makefile index 7813fdda6c27b27cb9c6ce2bc374539304df72a1..730a3608f85bab2d1fd81370fe5863895dc84418 100644 --- a/tests/test_nativenet/Makefile +++ b/tests/test_nativenet/Makefile @@ -5,7 +5,6 @@ ifeq (,$(filter native,$(BOARD))) include $(RIOTBASE)/Makefile.unsupported else -USEMODULE += auto_init USEMODULE += nativenet USEMODULE += transceiver diff --git a/tests/test_net_if/Makefile b/tests/test_net_if/Makefile index 073f4b76abba720836e3893e7afe68816dad4962..4e41b8ac75e9622dcd51beb5cf5f2cffe6c153c5 100644 --- a/tests/test_net_if/Makefile +++ b/tests/test_net_if/Makefile @@ -8,7 +8,6 @@ ifeq ($(BOARD),stm32f4discovery) include Makefile.$(BOARD) endif -USEMODULE += auto_init USEMODULE += net_if USEMODULE += defaulttransceiver diff --git a/tests/test_pnet/Makefile b/tests/test_pnet/Makefile index b1c34b788eed96f9a38da6409952fd159b7747af..8ca3400f8151c0bc80a2157178a2506dc9ed1530 100644 --- a/tests/test_pnet/Makefile +++ b/tests/test_pnet/Makefile @@ -1,7 +1,6 @@ export PROJECT = test_pnet include ../Makefile.tests_common -USEMODULE += auto_init USEMODULE += posix USEMODULE += pnet USEMODULE += vtimer diff --git a/tests/test_posix_semaphore/Makefile b/tests/test_posix_semaphore/Makefile index cd255938f6e87b2d1a800f30b63096ac04c02ac8..8bd82b29036309bf73c9d3a7367bef8d9ca71877 100644 --- a/tests/test_posix_semaphore/Makefile +++ b/tests/test_posix_semaphore/Makefile @@ -1,8 +1,8 @@ export PROJECT = test_posix_semaphore include ../Makefile.tests_common -USEMODULE += posix +USEMODULE += posix -export INCLUDES += -I$(RIOTBASE)/sys/posix/include +DISABLE_MODULE += auto_init include $(RIOTBASE)/Makefile.include diff --git a/tests/test_posix_sleep/Makefile b/tests/test_posix_sleep/Makefile index ed0f3709448c3a4640c8678ab0a721c7fb4267b1..4bfdb1dec9e112d7ba895f31280bef147b52313f 100644 --- a/tests/test_posix_sleep/Makefile +++ b/tests/test_posix_sleep/Makefile @@ -3,4 +3,6 @@ include ../Makefile.tests_common USEMODULE += posix +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_pthread/Makefile b/tests/test_pthread/Makefile index 2deaa76c455bf9603591f892df938dcfb8358ac9..77cb428b6caaa6d9ebc8b872cf137aa99dd1d6ab 100644 --- a/tests/test_pthread/Makefile +++ b/tests/test_pthread/Makefile @@ -4,4 +4,6 @@ include ../Makefile.tests_common USEMODULE += posix USEMODULE += pthread +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_pthread_cooperation/Makefile b/tests/test_pthread_cooperation/Makefile index 3430409269e9c79dc6f60560367100c39c18258f..a01e5b4ddb0fef51a4b506dc0504ec3b4271f80e 100644 --- a/tests/test_pthread_cooperation/Makefile +++ b/tests/test_pthread_cooperation/Makefile @@ -4,4 +4,6 @@ include ../Makefile.tests_common USEMODULE += posix USEMODULE += pthread +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_queue_fairness/Makefile b/tests/test_queue_fairness/Makefile index 609832133e45babb0128a6330e5c1ea6b4485a8a..c5cff262aca04409509023109602ae67cb8037f7 100644 --- a/tests/test_queue_fairness/Makefile +++ b/tests/test_queue_fairness/Makefile @@ -3,4 +3,6 @@ include ../Makefile.tests_common USEMODULE += vtimer +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_sha256/Makefile b/tests/test_sha256/Makefile index d4bf0e23638971e2bb159da026f296209379216e..2a8d1101fe621ff03034ec17c8c06123bb637163 100644 --- a/tests/test_sha256/Makefile +++ b/tests/test_sha256/Makefile @@ -3,4 +3,6 @@ include ../Makefile.tests_common USEMODULE += crypto_sha256 +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_shell/Makefile b/tests/test_shell/Makefile index eb01cdf9d55351052b7de5839348102565f1aef5..dd7de7b434d83651d22b4db35dec32e01c4e1f2f 100644 --- a/tests/test_shell/Makefile +++ b/tests/test_shell/Makefile @@ -6,4 +6,6 @@ USEMODULE += shell_commands USEMODULE += ps USEMODULE += posix +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_basic/Makefile b/tests/test_thread_basic/Makefile index 108f8b1aa313dbb20e45e266164896294d131721..8b62fa2109a41bcdb77e7a618454307ad826108c 100644 --- a/tests/test_thread_basic/Makefile +++ b/tests/test_thread_basic/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_basic include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_cooperation/Makefile b/tests/test_thread_cooperation/Makefile index 5319a06bf14377465272ef8f8072280b13a50396..e23527f4af75b33ffa401acb07cb14884a5b07d8 100644 --- a/tests/test_thread_cooperation/Makefile +++ b/tests/test_thread_cooperation/Makefile @@ -1,5 +1,7 @@ export PROJECT = test_thread_cooperation include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_exit/Makefile b/tests/test_thread_exit/Makefile index 504d5a9cc4397d111c37a1837976a9ed003a1da7..5ab60346430d6a010ce42f2677f24e06660929b3 100644 --- a/tests/test_thread_exit/Makefile +++ b/tests/test_thread_exit/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_exit include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_msg/Makefile b/tests/test_thread_msg/Makefile index 5f60dfbfd83b19c328cff2303a54731a346b39e2..1ab8f454007e144286b2b68f93b910539124e84f 100644 --- a/tests/test_thread_msg/Makefile +++ b/tests/test_thread_msg/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_msg include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_msg_block_w_queue/Makefile b/tests/test_thread_msg_block_w_queue/Makefile index e74bbc4b64df6f08d214fb3a908b73f20dfb243a..dfc976dc485fbd74452fc98abf389ddb989a9538 100644 --- a/tests/test_thread_msg_block_w_queue/Makefile +++ b/tests/test_thread_msg_block_w_queue/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_msg_block_w_queue include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_msg_block_wo_queue/Makefile b/tests/test_thread_msg_block_wo_queue/Makefile index 8f6a7e4423eb4770771110cc34ab3e6b61111555..6cf5cd8bffd59539ac6f5c38e2c704d939640e4c 100644 --- a/tests/test_thread_msg_block_wo_queue/Makefile +++ b/tests/test_thread_msg_block_wo_queue/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_msg_block_wo_queue include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_thread_msg_seq/Makefile b/tests/test_thread_msg_seq/Makefile index 4f50f0a8cb6d73a08ede113fd8ff9dc80c918977..f4f95bcd339e511b75e632ef20268bc51a9cdcd4 100644 --- a/tests/test_thread_msg_seq/Makefile +++ b/tests/test_thread_msg_seq/Makefile @@ -1,4 +1,6 @@ export PROJECT = test_thread_msg_seq include ../Makefile.tests_common +DISABLE_MODULE += auto_init + include $(RIOTBASE)/Makefile.include diff --git a/tests/test_vtimer_msg/Makefile b/tests/test_vtimer_msg/Makefile index fa9f98a683c8f829eafa78c3043b21b53454f1db..ba57fc7b9c8f6daf5ce7bba2d642f989c6915b78 100644 --- a/tests/test_vtimer_msg/Makefile +++ b/tests/test_vtimer_msg/Makefile @@ -1,7 +1,6 @@ export PROJECT = test_vtimer_msg include ../Makefile.tests_common -USEMODULE += auto_init USEMODULE += vtimer include $(RIOTBASE)/Makefile.include