mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 04:24:45 +00:00
Ralf's description of the patch follows:
Now that make VARIANT=xxx has prooven not to be simple enough, I made up
my mind to change again the internals of the mechanism being used to
handle variants:
With the patch below, I introduce the indirection step I had mentioned
in one of my recent mails to translate settings of VARIANT.
The trick is to use the contents of VARIANT as keyword to lookup another
internal keyword (VARIANT_V), which then is used as keyword to lookup
values for setting ARCH, LIB_VARIANT, LIBSUFFIX_VA and AM_CFLAGS from
ARCH_$(VARIANT_V)_V etc. (cf automake/local.am).
This means, at first to translate
VARIANT=[optimize|OPTIMIZE] into VARIANT_V=OPTIMIZE
VARIANT=[debug|DEBUG] into VARIANT_V=DEBUG
VARIANT=[profile|PROFILE] into VARIANT_V=PROFILE
VARIANT=<anything> into VARIANT_V=<anything>
=> perform keyword conversion to uppercase and reduction from 6 to 3+1
internal keywords.
$(VARIANT_V) then is used to lookup make variables from other tables
(eg. CFLAGS_*_V). Eg. ARCH is set up this way:
ARCH_OPTIMIZE_V = o-optimize
ARCH_DEBUG_V = o-debug
ARCH_PROFILE_V = o-profile
ARCH__V = $(ARCH_OPTIMIZE_V)
ARCH = $(ARCH_$(VARIANT_V)_V)
Note the ARCH__V variable. When VARIANT=<anything> is passed to make,
VARIANT_V=<anything> will be set, resulting into ARCH =
$(ARCH_$(<anything>)_V) = $(ARCH__V) = $(ARCH_OPTIMIZE_V), ie. falling
back to OPTIMIZE.
=> o- or o-<anything> should never popup anymore.
81 lines
1.7 KiB
Plaintext
81 lines
1.7 KiB
Plaintext
## $Id$
|
|
|
|
## NOTE: This is a temporary work-around to keep
|
|
## RTEMS's non automake standard make targets working.
|
|
## Once automake is fully integrated these make targets
|
|
## and this file will probably be removed
|
|
|
|
## translate VARIANT into VARIANT_V
|
|
VARIANT = OPTIMIZE
|
|
|
|
VARIANT_OPTIMIZE_V = OPTIMIZE
|
|
VARIANT_DEBUG_V = DEBUG
|
|
VARIANT_PROFILE_V = PROFILE
|
|
VARIANT_optimize_V = OPTIMIZE
|
|
VARIANT_debug_V = DEBUG
|
|
VARIANT_profile_V = PROFILE
|
|
|
|
VARIANT_V = $(VARIANT_$(VARIANT)_V)
|
|
|
|
## Setup the variant build subdirectory
|
|
ARCH_OPTIMIZE_V = o-optimize
|
|
ARCH_DEBUG_V = o-debug
|
|
ARCH_PROFILE_V = o-profile
|
|
|
|
ARCH__V = $(ARCH_OPTIMIZE_V)
|
|
ARCH = $(ARCH_$(VARIANT_V)_V)
|
|
|
|
## Setup the library suffix
|
|
LIBSUFFIX_OPTIMIZE_V =
|
|
LIBSUFFIX_DEBUG_V = _g
|
|
LIBSUFFIX_PROFILE_V = _p
|
|
|
|
LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V)
|
|
LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V)
|
|
|
|
LIBSUFFIX_VA = $(LIB_VARIANT).a
|
|
|
|
## These are supposed to be set in make/custom/<bsp>.cfg
|
|
## CFLAGS_OPTIMIZE_V =
|
|
## CFLAGS_DEBUG_V =
|
|
## CFLAGS_PROFILE_V =
|
|
|
|
CFLAGS__V = $(CFLAGS_OPTIMIZE_V)
|
|
AM_CFLAGS += $(CFLAGS_$(VARIANT_V)_V)
|
|
|
|
debug:
|
|
@echo
|
|
@echo "\"make debug\" is obsolete, instead use:"
|
|
@echo " make VARIANT=DEBUG"
|
|
@echo
|
|
|
|
.PHONY: debug
|
|
|
|
profile:
|
|
@echo
|
|
@echo "\"make profile\" is obsolete, instead use:"
|
|
@echo " make VARIANT=PROFILE"
|
|
@echo
|
|
|
|
.PHONY: profile
|
|
|
|
preinstall-am: $(PREINSTALL_FILES)
|
|
preinstall: preinstall-am
|
|
.PHONY: preinstall preinstall-am
|
|
|
|
depend-am:
|
|
depend: depend-am
|
|
.PHONY: depend depend-am
|
|
|
|
${ARCH}:
|
|
mkdir ${ARCH}
|
|
|
|
clean-local:
|
|
$(RM) -r o-optimize o-debug o-profile $(CLEANDIRS)
|
|
$(RM) Depends-o-optimize.tmp Depends-o-debug.tmp Depends-o-profile.tmp
|
|
|
|
distclean-local:
|
|
$(RM) Depends-o-optimize Depends-o-debug Depends-o-profile
|
|
|
|
PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
|