[11a26b9] | 1 | ## |
---|
| 2 | ## $Id$ |
---|
| 3 | ## |
---|
| 4 | |
---|
| 5 | ## ------------------------------------------------------------------------- |
---|
| 6 | ## NOTE: This file is rather immature and has to be considered to be |
---|
| 7 | ## almost experimental. |
---|
| 8 | ## |
---|
| 9 | ## Expect frequent changes -- It deserves to be cleaned up :( |
---|
| 10 | ## ------------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | ## The section below is based on make/compilers/gcc-target-default.cfg |
---|
| 13 | ## used in former versions of RTEMS. |
---|
| 14 | |
---|
| 15 | ## |
---|
| 16 | ## Set up the flags for the toolchains: |
---|
| 17 | ## |
---|
| 18 | ## We are considering 3 different building schemes here: |
---|
| 19 | ## * Using gcc's being able to accept -specs (aka gcc-2.8 building scheme) |
---|
| 20 | ## * Using gcc's not being able to accept -specs (aka gcc-2.7.2 building |
---|
| 21 | ## scheme) |
---|
| 22 | ## * Using third party toolchains (aka non-gcc building scheme) |
---|
| 23 | ## |
---|
| 24 | ## Automake conditionals in use: |
---|
| 25 | ## RTEMS_USE_GCC .. if we are using GCC |
---|
| 26 | |
---|
| 27 | ## NOTES: |
---|
| 28 | ## * The gcc-2.8 building scheme is the nominal building scheme and |
---|
| 29 | ## is actively supported. |
---|
| 30 | ## * The non-gcc building scheme requires manually setting up environment |
---|
| 31 | ## variables and is hardly tested at all |
---|
| 32 | |
---|
| 33 | ## CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we |
---|
| 34 | ## would want the corresponding macros to be set to. |
---|
| 35 | ## |
---|
| 36 | ## CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set by the |
---|
| 37 | ## 'VARIANT=<OPTIMIZE|DEBUG>' targets to their _V values. |
---|
| 38 | |
---|
| 39 | if RTEMS_USE_GCC |
---|
| 40 | ## All the stuff below is specific to gcc |
---|
| 41 | |
---|
| 42 | ## gcc >= 2.8.x |
---|
| 43 | GCCSPECS = $(GCC_SPECS) $(RTEMS_BSP_SPECS) |
---|
| 44 | else |
---|
| 45 | ## fall back to the old style compilers/*.cfg |
---|
| 46 | ## CONFIG.CC is supposed to be provided by <BSP>.cfg |
---|
| 47 | include $(CONFIG.CC) |
---|
| 48 | endif # RTEMS_USE_GCC |
---|
| 49 | |
---|
| 50 | DEFS = @DEFS@ |
---|
| 51 | |
---|
[11cafc0] | 52 | CPPFLAGS = @CPPFLAGS@ $(CPU_DEFINES) $(DEFINES) |
---|
| 53 | CFLAGS = @RTEMS_CFLAGS@ |
---|
[11a26b9] | 54 | ## FIXME: This should be correct, but is not supported, yet |
---|
| 55 | # CXXFLAGS = @RTEMS_CXXFLAGS@ $(XCXXFLAGS) |
---|
| 56 | ## Fall back to using RTEMS_CFLAGS for C++ |
---|
| 57 | CXXFLAGS = @RTEMS_CFLAGS@ $(XCXXFLAGS) |
---|
| 58 | ASFLAGS = $(CPU_ASFLAGS) $(CPU_CFLAGS) $(XASFLAGS) |
---|
| 59 | |
---|
[11cafc0] | 60 | depend: |
---|
[11a26b9] | 61 | |
---|
| 62 | if RTEMS_USE_GCC |
---|
| 63 | ## gcc >= 2.8 |
---|
[9480bb42] | 64 | RTEMS_RELLDFLAGS = -qnolinkcmds -nostdlib -Wl,-r |
---|
[11a26b9] | 65 | define make-rel |
---|
[9480bb42] | 66 | $(LINK) $(RTEMS_RELLDFLAGS) $^ |
---|
[11a26b9] | 67 | endef |
---|
| 68 | else |
---|
| 69 | ## non-gcc |
---|
| 70 | define make-rel |
---|
[9480bb42] | 71 | $(LINK) $(RTEMS_RELLDFLAGS) $^ |
---|
[11a26b9] | 72 | endef |
---|
| 73 | endif |
---|
| 74 | |
---|
| 75 | ## ------------------------------------------------------------------------- |
---|
| 76 | |
---|
| 77 | ## translate VARIANT into VARIANT_V |
---|
| 78 | VARIANT = OPTIMIZE |
---|
| 79 | |
---|
| 80 | VARIANT_OPTIMIZE_V = OPTIMIZE |
---|
| 81 | VARIANT_DEBUG_V = DEBUG |
---|
| 82 | VARIANT_optimize_V = OPTIMIZE |
---|
| 83 | VARIANT_debug_V = DEBUG |
---|
| 84 | |
---|
| 85 | VARIANT_V = $(VARIANT_$(VARIANT)_V) |
---|
| 86 | |
---|
| 87 | ## Setup the library suffix |
---|
| 88 | LIBSUFFIX_OPTIMIZE_V = |
---|
| 89 | LIBSUFFIX_DEBUG_V = _g |
---|
| 90 | LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V) |
---|
| 91 | |
---|
| 92 | LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V) |
---|
| 93 | |
---|
| 94 | ## These are supposed to be set in make/custom/<bsp>.cfg |
---|
| 95 | CPU_CFLAGS = @CPU_CFLAGS@ |
---|
| 96 | CFLAGS_OPTIMIZE_V = @CFLAGS_OPTIMIZE_V@ |
---|
| 97 | CFLAGS_DEBUG_V = @CFLAGS_DEBUG_V@ |
---|
| 98 | CFLAGS__V = $(CFLAGS_OPTIMIZE_V) |
---|
| 99 | |
---|
| 100 | ## ------------------------------------------------------------------------ |
---|
| 101 | ## Setup hard-coded flags |
---|
| 102 | if RTEMS_USE_GCC |
---|
| 103 | ## gcc >= gcc-2.8 |
---|
| 104 | RTEMS_CFLAGS_OPTIMIZE_V = |
---|
| 105 | RTEMS_CFLAGS_DEBUG_V = -qrtems_debug -Wno-unused |
---|
| 106 | |
---|
| 107 | ## non-gcc |
---|
| 108 | ## We can't guess what flags might be required here. |
---|
| 109 | ## Pass the values from the environment if you want to apply them. |
---|
| 110 | endif |
---|
| 111 | RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V) |
---|
| 112 | |
---|
| 113 | ## ------------------------------------------------------------------------- |
---|
| 114 | |
---|
| 115 | CC = @CC@ $(GCCSPECS) |
---|
| 116 | CXX = @CXX@ $(GCCSPECS) |
---|
| 117 | CPP = @CPP@ $(GCCSPECS) |
---|
| 118 | |
---|
| 119 | LD = @LD@ |
---|
| 120 | OBJCOPY = @OBJCOPY@ |
---|
| 121 | NM = @NM@ |
---|
| 122 | SIZE = @SIZE@ |
---|
| 123 | STRIP = @STRIP@ |
---|
| 124 | |
---|
| 125 | ## |
---|
| 126 | AM_CPPFLAGS = $(RTEMS_CPPFLAGS) |
---|
| 127 | AM_CFLAGS = |
---|
| 128 | AM_CXXFLAGS = |
---|
[11cafc0] | 129 | AM_CCASFLAGS = $(RTEMS_CPPFLAGS) $(RTEMS_CCASFLAGS) |
---|