Changeset 12edad6 in rtems


Ignore:
Timestamp:
Apr 5, 2000, 12:51:51 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
0c67e4ac
Parents:
a899433e
Message:

Patch rtems-rc-4.5-10-cvs.diff from Ralf Corsepius <corsepiu@…>.
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
ARCHV = $(ARCH_OPTIMIZE_V)
ARCH = $(ARCH_$(VARIANT_V)_V)

Note the ARCHV 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.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • automake/local.am

    ra899433e r12edad6  
    66## and this file will probably be removed
    77
     8## translate VARIANT into VARIANT_V
    89VARIANT = OPTIMIZE
    910
    10 VARIANT_OPTIMIZE_V = optimize
    11 VARIANT_DEBUG_V = debug
    12 VARIANT_PROFILE_V = profile
     11VARIANT_OPTIMIZE_V = OPTIMIZE
     12VARIANT_DEBUG_V = DEBUG
     13VARIANT_PROFILE_V = PROFILE
     14VARIANT_optimize_V = OPTIMIZE
     15VARIANT_debug_V = DEBUG
     16VARIANT_profile_V = PROFILE
    1317
    14 ARCH = o-$(VARIANT_$(VARIANT)_V)
    15 AM_CFLAGS += $(CFLAGS_$(VARIANT)_V)
     18VARIANT_V = $(VARIANT_$(VARIANT)_V)
     19
     20## Setup the variant build subdirectory
     21ARCH_OPTIMIZE_V = o-optimize
     22ARCH_DEBUG_V = o-debug
     23ARCH_PROFILE_V = o-profile
     24
     25ARCH__V = $(ARCH_OPTIMIZE_V)
     26ARCH = $(ARCH_$(VARIANT_V)_V)
     27
     28## Setup the library suffix
     29LIBSUFFIX_OPTIMIZE_V =
     30LIBSUFFIX_DEBUG_V = _g
     31LIBSUFFIX_PROFILE_V = _p
     32
     33LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V)
     34LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V)
     35
     36LIBSUFFIX_VA = $(LIB_VARIANT).a
     37
     38## These are supposed to be set in make/custom/<bsp>.cfg
     39## CFLAGS_OPTIMIZE_V =
     40## CFLAGS_DEBUG_V =
     41## CFLAGS_PROFILE_V =
     42
     43CFLAGS__V = $(CFLAGS_OPTIMIZE_V)
     44AM_CFLAGS += $(CFLAGS_$(VARIANT_V)_V)
    1645
    1746debug:
  • c/src/make/leaf.cfg

    ra899433e r12edad6  
    4242include ${DEPEND}                    # pull in dependencies if they exist
    4343endif
    44 
    45 #
    46 # LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and
    47 #   convert our ${ARCH} back into .a or _g.a or _p.a based on debug or profile.
    48 #   Useful for installing libraries.
    49 #
    50 
    51 LIBSUFFIX_o-optimize_V=
    52 LIBSUFFIX_o-debug_V=_g
    53 LIBSUFFIX_o-profile_V=_p
    54 
    55 LIB_VARIANT=$(LIBSUFFIX_$(ARCH)_V)
    56 LIBSUFFIX_VA = $(LIB_VARIANT).a
Note: See TracChangeset for help on using the changeset viewer.