Chris Johns e2266055bc Add an RTEMS config wrapper around Makefile.inc.
This is an internal command that wraps the Makefile.inc file in
a BSP so you can get at the configuration values from the
command line without knowing anything about Makefile.inc.

To use:

 $ ../source-builder/sb-rtems-config \
     --rtems=$HOME/development/rtems/4.11 \
     --rtems-bsp=sis \
      rtems_cpu_cflags

The option '--list' lists all available configuration values.
The configuration values are match case insensitive and you can
list a number with each printed on a separate line.

The --rtems-bsp can be in new coming standard of arch/bsp such as
'sparc/sis' or you can just supply the bsp, eg 'sis'.
2013-05-13 12:22:18 +10:00

44 lines
1.2 KiB
Makefile

#
# Makefile to extract the contents of the Makefile.inc
#
# Use with 'gmake -f rtems-config.mk makefile_inc=/path/Makefile.inc
#
MAKEFLAGS=-n
VARS_OLD := $(.VARIABLES)
include $(makefile_inc)
include $(RTEMS_CUSTOM)
out = $(info $(1)=$(2))
all:
RTEMS_BSP=$(RTEMS_BSP)
RTEMS_CPU=$(RTEMS_CPU)
RTEMS_CPU_MODEL=$(RTEMS_CPU_MODEL)
RTEMS_API=$(RTEMS_API)
prefix=$(prefix)
exec_prefix=$(exec_prefix)
RTEMS_ROOT=$(prefix)
PROJECT_ROOT=$(RTEMS_ROOT)
RTEMS_CUSTOM=$(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
RTEMS_SHARE=$(RTEMS_ROOT)/share/rtems$(RTEMS_API)
CC_FOR_TARGET=$(CC_FOR_TARGET)
CXX_FOR_TARGET=$(CXX_FOR_TARGET)
AS_FOR_TARGET=$(AS_FOR_TARGET)
AR_FOR_TARGET=$(AR_FOR_TARGET)
NM_FOR_TARGET=$(NM_FOR_TARGET)
LD_FOR_TARGET=$(LD_FOR_TARGET)
SIZE_FOR_TARGET=$(SIZE_FOR_TARGET)
OBJCOPY_FOR_TARGET=$(OBJCOPY_FOR_TARGET)
RTEMS_HAS_MP=$(RTEMS_HAS_MULTIPROCESSING)
RTEMS_HAS_POSIX_API=$(RTEMS_HAS_POSIX_API)
RTEMS_HAS_ITRON_API=$(RTEMS_HAS_ITRON_API)
RTEMS_HAS_CPLUSPLUS=$(RTEMS_HAS_CPLUSPLUS)
RTEMS_HAS_NETWORKING=$(RTEMS_HAS_NETWORKING)
RTEMS_CPU_CFLAGS=$(CPU_CFLAGS)
RTEMS_CFLAGS=$(CFLAGS)
BSP_POST_LINK=$(bsp-post-link)
Y=$(foreach V, $(sort $(filter-out $(VARS_OLD), $(.VARIABLES))), $(call out, $(V), $($(V))))