Commit 460ecf07 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

Set loop/wakeup/ostream either via .config or via app/commandline

parent cf3ba89c
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -2,12 +2,15 @@
#
# SPDX-License-Identifier: BSD-2-Clause

COMMON_FLAGS = -g -Os -Wall -Wextra

# Only load .config when app/arch are not specified on commandline
ifneq (${app}, )
	CONFIG_app = ${app}
	CONFIG_arch = ${arch}
else
	-include .config
	COMMON_FLAGS += -include include/config.h
endif

# Make cannot include "foo"/Makefile.inc, so remove quotes from config entries
@@ -16,7 +19,6 @@ app_dir = $(subst ${quote},,${CONFIG_app})
arch_dir = $(subst ${quote},,${CONFIG_arch})

INCLUDES = -Iinclude -Iinclude/arch/${arch_dir}
COMMON_FLAGS = -g -Os -Wall -Wextra
CFLAGS = -std=c99
CXXFLAGS = -std=c++14 -fno-rtti -fno-threadsafe-statics -fno-exceptions

@@ -349,24 +351,15 @@ ifeq (${timer_us}, 1)
endif

ifeq (${loop}, 1)
	COMMON_FLAGS += -DWITH_LOOP
endif
ifdef CONFIG_loop
	COMMON_FLAGS += -DWITH_LOOP
	COMMON_FLAGS += -DCONFIG_loop
endif

ifeq (${wakeup}, 1)
	COMMON_FLAGS += -DWITH_WAKEUP
endif
ifdef CONFIG_wakeup
	COMMON_FLAGS += -DWITH_WAKEUP
	COMMON_FLAGS += -DCONFIG_wakeup
endif

ifeq (${ostream}, 1)
	COMMON_FLAGS += -DWITH_OSTREAM
endif
ifdef CONFIG_ostream
	COMMON_FLAGS += -DWITH_OSTREAM
	COMMON_FLAGS += -DCONFIG_ostream
endif

ifeq (${trace_malloc}, 1)
@@ -381,7 +374,7 @@ endif
default: build/system.elf

include/config.h: .config
	${QUIET}awk -f script/conf2h.awk .config > include/config.h
	${QUIET}test -z "${app}" && awk -f script/conf2h.awk .config > include/config.h || : > include/config.h

stack: default
	${QUIET}test -n "${OBJDUMP}"
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#define OUTPUTSTREAM_H

#include <stdint.h>
#ifdef WITH_OSTREAM
#ifdef CONFIG_ostream
#include <ostream>
#endif

@@ -47,7 +47,7 @@ class OutputStream {
	OutputStream & operator<<(double number);
	OutputStream & operator<<(OutputStream & (*fun) (OutputStream &));

#ifdef WITH_OSTREAM
#ifdef CONFIG_ostream
	OutputStream & operator<<(std::string s);
#endif

+1 −1
Original line number Diff line number Diff line
@@ -5,6 +5,6 @@
# SPDX-License-Identifier: CC0-1.0

ifdef app
	CONFIG_loop = y
	loop = 1
	override arch_drivers += ,neopixel
endif
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: CC0-1.0

ifdef app
	CONFIG_loop = y
	loop = 1
	override arch_drivers += ,i2c
	CONFIG_driver_bme680 = y
	CONFIG_driver_max44009 = y
+1 −1
Original line number Diff line number Diff line
@@ -7,5 +7,5 @@
ifdef app
	override arch_drivers += ,i2c
	CONFIG_driver_ccS811 = y
	CONFIG_loop = y
	loop = 1
endif
Loading