remove version in all files
[dpdk.git] / mk / target / generic / rte.vars.mk
1 #   BSD LICENSE
2
3 #   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
4 #   All rights reserved.
5
6 #   Redistribution and use in source and binary forms, with or without 
7 #   modification, are permitted provided that the following conditions 
8 #   are met:
9
10 #     * Redistributions of source code must retain the above copyright 
11 #       notice, this list of conditions and the following disclaimer.
12 #     * Redistributions in binary form must reproduce the above copyright 
13 #       notice, this list of conditions and the following disclaimer in 
14 #       the documentation and/or other materials provided with the 
15 #       distribution.
16 #     * Neither the name of Intel Corporation nor the names of its 
17 #       contributors may be used to endorse or promote products derived 
18 #       from this software without specific prior written permission.
19
20 #   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
21 #   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
22 #   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
23 #   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
24 #   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
25 #   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
26 #   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
27 #   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
28 #   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
29 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
30 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32
33 #
34 # This .mk is the generic target rte.var.mk ; it includes .mk for
35 # the specified machine, architecture, toolchain (compiler) and
36 # executive environment.
37 #
38
39 #
40 # machine:
41 #
42 #   - can define ARCH variable (overriden by cmdline value)
43 #   - can define CROSS variable (overriden by cmdline value)
44 #   - define MACHINE_CFLAGS variable (overriden by cmdline value)
45 #   - define MACHINE_LDFLAGS variable (overriden by cmdline value)
46 #   - define MACHINE_ASFLAGS variable (overriden by cmdline value)
47 #   - can define CPU_CFLAGS variable (overriden by cmdline value) that
48 #     overrides the one defined in arch.
49 #   - can define CPU_LDFLAGS variable (overriden by cmdline value) that
50 #     overrides the one defined in arch.
51 #   - can define CPU_ASFLAGS variable (overriden by cmdline value) that
52 #     overrides the one defined in arch.
53 #
54 # examples for RTE_MACHINE: default, pc, bensley, tylesburg, ...
55 #
56 include $(RTE_SDK)/mk/machine/$(RTE_MACHINE)/rte.vars.mk
57
58 #
59 # arch:
60 #
61 #   - define ARCH variable (overriden by cmdline or by previous
62 #     optional define in machine .mk)
63 #   - define CROSS variable (overriden by cmdline or previous define
64 #     in machine .mk)
65 #   - define CPU_CFLAGS variable (overriden by cmdline or previous
66 #     define in machine .mk)
67 #   - define CPU_LDFLAGS variable (overriden by cmdline or previous
68 #     define in machine .mk)
69 #   - define CPU_ASFLAGS variable (overriden by cmdline or previous
70 #     define in machine .mk)
71 #   - may override any previously defined variable
72 #
73 # examples for RTE_ARCH: i686, x86_64
74 #
75 include $(RTE_SDK)/mk/arch/$(RTE_ARCH)/rte.vars.mk
76
77 #
78 # toolchain:
79 #
80 #   - define CC, LD, AR, AS, ...
81 #   - define TOOLCHAIN_CFLAGS variable (overriden by cmdline value)
82 #   - define TOOLCHAIN_LDFLAGS variable (overriden by cmdline value)
83 #   - define TOOLCHAIN_ASFLAGS variable (overriden by cmdline value)
84 #   - may override any previously defined variable
85 #
86 # examples for RTE_TOOLCHAIN: gcc, icc
87 #
88 include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.vars.mk
89
90 #
91 # exec-env:
92 #
93 #   - define EXECENV_CFLAGS variable (overriden by cmdline)
94 #   - define EXECENV_LDFLAGS variable (overriden by cmdline)
95 #   - define EXECENV_ASFLAGS variable (overriden by cmdline)
96 #   - may override any previously defined variable
97 #
98 # examples for RTE_EXEC_ENV: linuxapp, baremetal
99 #
100 include $(RTE_SDK)/mk/exec-env/$(RTE_EXEC_ENV)/rte.vars.mk
101
102 # Don't set CFLAGS/LDFLAGS flags for kernel module, all flags are
103 # provided by Kbuild framework.
104 ifeq ($(KERNELRELEASE),)
105
106 # merge all CFLAGS
107 CFLAGS := $(CPU_CFLAGS) $(EXECENV_CFLAGS) $(TOOLCHAIN_CFLAGS) $(MACHINE_CFLAGS)
108 CFLAGS += $(TARGET_CFLAGS)
109
110 # merge all LDFLAGS
111 LDFLAGS := $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS)
112 LDFLAGS += $(TARGET_LDFLAGS)
113
114 # merge all ASFLAGS
115 ASFLAGS := $(CPU_ASFLAGS) $(EXECENV_ASFLAGS) $(TOOLCHAIN_ASFLAGS) $(MACHINE_ASFLAGS)
116 ASFLAGS += $(TARGET_ASFLAGS)
117
118 # add default include and lib paths
119 CFLAGS += -I$(RTE_OUTPUT)/include
120 LDFLAGS += -L$(RTE_OUTPUT)/lib
121
122 # always include rte_config.h: the one in $(RTE_OUTPUT)/include is
123 # the configuration of SDK when $(BUILDING_RTE_SDK) is true, or the
124 # configuration of the application if $(BUILDING_RTE_SDK) is not
125 # defined.
126 ifeq ($(BUILDING_RTE_SDK),1)
127 # building sdk
128 CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
129 ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
130 CFLAGS += -include $(RTE_OUTPUT)/include/rte_warnings.h
131 endif
132 else
133 # if we are building an external application, include SDK's lib and
134 # includes too
135 CFLAGS += -I$(RTE_SDK_BIN)/include
136 ifneq ($(wildcard $(RTE_OUTPUT)/include/rte_config.h),)
137 CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
138 endif
139 CFLAGS += -include $(RTE_SDK_BIN)/include/rte_config.h
140 ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
141 CFLAGS += -include $(RTE_SDK_BIN)/include/rte_warnings.h
142 endif
143 LDFLAGS += -L$(RTE_SDK_BIN)/lib
144 endif
145
146 export CFLAGS
147 export LDFLAGS
148
149 endif