1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #940 from Kijewski/issue-926

make: Add DEFAULT_MODULE and DISABLE_MODULE
This commit is contained in:
Ludwig Ortmann 2014-04-02 14:46:24 +02:00
commit c0846fde22
34 changed files with 102 additions and 14 deletions

3
Makefile.defaultmodules Normal file
View File

@ -0,0 +1,3 @@
DEFAULT_MODULE += cpu core sys
DEFAULT_MODULE += auto_init

View File

@ -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.

View File

@ -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_%)

View File

@ -34,7 +34,6 @@ USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += posix
USEMODULE += ps
USEMODULE += auto_init
USEMODULE += random
USEMODULE += transceiver
ifeq ($(BOARD),msba2)

View File

@ -31,9 +31,6 @@ export QUIET ?= 1
USEMODULE += config
USEMODULE += posix
USEMODULE += auto_init
USEMODULE += auto_init
USEMODULE += transceiver
ifeq ($(BOARD),msba2)

View File

@ -34,7 +34,6 @@ USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
USEMODULE += vtimer
USEMODULE += auto_init
USEMODULE += defaulttransceiver
ifneq (,$(filter msb-430,$(BOARD)))

View File

@ -36,7 +36,6 @@ endif
# Modules to include:
USEMODULE += auto_init
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += posix

View File

@ -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

View File

@ -9,5 +9,7 @@ USEMODULE += hashes
USEMODULE += bloom
USEMODULE += random
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include
endif

View File

@ -0,0 +1,6 @@
export PROJECT = test_disable_module
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -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;
}

View File

@ -1,4 +1,6 @@
export PROJECT = test_float
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_hwtimer
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_hwtimer_spin
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -5,7 +5,6 @@ ifeq (,$(filter native,$(BOARD)))
include $(RIOTBASE)/Makefile.unsupported
else
USEMODULE += auto_init
USEMODULE += posix
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_mutex_unlock_and_sleep
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -5,7 +5,6 @@ ifeq (,$(filter native,$(BOARD)))
include $(RIOTBASE)/Makefile.unsupported
else
USEMODULE += auto_init
USEMODULE += nativenet
USEMODULE += transceiver

View File

@ -8,7 +8,6 @@ ifeq ($(BOARD),stm32f4discovery)
include Makefile.$(BOARD)
endif
USEMODULE += auto_init
USEMODULE += net_if
USEMODULE += defaulttransceiver

View File

@ -1,7 +1,6 @@
export PROJECT = test_pnet
include ../Makefile.tests_common
USEMODULE += auto_init
USEMODULE += posix
USEMODULE += pnet
USEMODULE += vtimer

View File

@ -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

View File

@ -3,4 +3,6 @@ include ../Makefile.tests_common
USEMODULE += posix
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -4,4 +4,6 @@ include ../Makefile.tests_common
USEMODULE += posix
USEMODULE += pthread
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -4,4 +4,6 @@ include ../Makefile.tests_common
USEMODULE += posix
USEMODULE += pthread
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -3,4 +3,6 @@ include ../Makefile.tests_common
USEMODULE += vtimer
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -3,4 +3,6 @@ include ../Makefile.tests_common
USEMODULE += crypto_sha256
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -6,4 +6,6 @@ USEMODULE += shell_commands
USEMODULE += ps
USEMODULE += posix
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_basic
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,5 +1,7 @@
export PROJECT = test_thread_cooperation
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_exit
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_msg
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_msg_block_w_queue
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_msg_block_wo_queue
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,6 @@
export PROJECT = test_thread_msg_seq
include ../Makefile.tests_common
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include

View File

@ -1,7 +1,6 @@
export PROJECT = test_vtimer_msg
include ../Makefile.tests_common
USEMODULE += auto_init
USEMODULE += vtimer
include $(RIOTBASE)/Makefile.include