forked from cornelisnetworks/opa-ff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakerules.project
More file actions
executable file
·254 lines (239 loc) · 11.6 KB
/
Makerules.project
File metadata and controls
executable file
·254 lines (239 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# BEGIN_ICS_COPYRIGHT8 ****************************************
#
# Copyright (c) 2015, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# END_ICS_COPYRIGHT8 ****************************************
## Rules for ALL_HOST project
#=============================================================================#
## Project Make Rules File
## -----------------------
##
## All tools local makefiles should include this makerules file after its own
## local definitions section and before the local rules section. Use
## Makefile.template as a base makefile and modify the template according to
## your application needs. The template makefile includes this makerules file
## and this project makerules file includes the global makerules file. Any
## modifications to this makerules file or to local makefiles should be made
## in a portable fashion using 'ifdef' structures where necessary so that the
## same makefile can be used on multiple platforms. The main purpose of this
## include makerules file is for local variable definitions and rules which are
## specific to the project at hand. Global modifications should be made in the
## global makerules file and local items should be in the local makefile, not
## in this makerules file. Any modifications to the source should be made with
## portability in mind and should follow the embedded notations. Documentation
## is automatically generated from this makefile! Use the correct conventions
## for those items which should be documented.
##
## NOTE: This makefile inclusion (the global makerules, and the template
## makefile) depend on using the GNU version of make. GNU make must be
## installed on your system prior to using this makefile.
#=============================================================================#
##
#=============================================================================#
# The following list is the standard list of definitions which will be defined
# for all platforms. It consists of general and machine specific sections that
# contain many system parameters which may be used in a makefile. Please keep
# the list(s) in strictly aphabetical order to facilitate simple searches.
#
# See Makerules.global for the meaning of these flags
#-----------------------------------------------------------------------------#
# Common platform definitions:
#-----------------------------------------------------------------------------#
# TBD code should be redone so that prepfiles can insert version string instead
# of using MODULEVERSION
ifeq "$(RELEASE_TAG)" ""
MODULEVERSION=$(shell $(PATCH_ENG_VERSION))
RPM_REL=$(shell echo $(MODULEVERSION)|cut -d"." -f1-2)
RPM_VER=$(shell echo $(MODULEVERSION).999.999|cut -d"." -f3)
else
MODULEVERSION=$(shell $(CONVERT_RELEASETAG) $(RELEASE_TAG))
RPM_REL=$(shell echo $(MODULEVERSION)|cut -d"." -f1-4)
RPM_VER=$(shell echo $(MODULEVERSION).999.999.999.999|cut -d"." -f5)
endif
PROJ_DIR = $(GLOBAL_DIR)
PROJ_BIN_DIR = $(GLOBAL_BIN_DIR)
PROJ_DRIVER_BIN_DIR = $(GLOBAL_BIN_DIR)
PROJ_INCLUDE_DIR = $(GLOBAL_INCLUDE_DIR)
PROJ_LIB_DIR = $(GLOBAL_LIB_DIR)
PROJ_SHLIB_DIR = $(GLOBAL_SHLIB_DIR)
PROJ_SBR_DIR = $(GLOBAL_SBR_DIR)
ifeq "$(RELEASE_TAG)" ""
# only use engineer's name for directory name (omit timestamp part),
# otherwise each partial build goes to a different place
STAGE_SUB_DIR = IntelOPA-Tools-FF.$(BUILD_TARGET_OS_ID).$(shell $(PATCH_ENG_VERSION)|cut -d"." -f1)
else
STAGE_SUB_DIR = IntelOPA-Tools-FF.$(BUILD_TARGET_OS_ID).$(MODULEVERSION)
endif
PROJ_STAGE_DIR = $(STAGE_DIR)/$(STAGE_SUB_DIR)
PROJ_STAGE_BIN_DIR = $(PROJ_STAGE_DIR)/bin
PROJ_STAGE_MAN_DIR = $(PROJ_STAGE_DIR)/man
PROJ_STAGE_INCLUDE_DIR = $(PROJ_STAGE_DIR)/include
PROJ_STAGE_TESTS_DIR = $(PROJ_STAGE_DIR)/Tests
PROJ_STAGE_SRC_DIR = $(PROJ_STAGE_DIR)/src
PROJ_STAGE_TESTS_BIN_DIR= $(PROJ_STAGE_DIR)/Tests/bin
#PROJ_STAGE_LIB_DIR = $(PROJ_STAGE_DIR)/bin/$(BUILD_TARGET)/$(BUILD_TARGET_OS_VERSION)/lib/$(BUILD_CONFIG)
PROJ_STAGE_LIB_DIR = $(PROJ_STAGE_DIR)/bin/$(BUILD_TARGET)/$(BUILD_TARGET_OS_VENDOR).$(BUILD_TARGET_OS_VENDOR_VERSION)/lib/$(BUILD_CONFIG)
PROJ_STAGE_SHLIB_DIR= $(PROJ_STAGE_LIB_DIR)
PROJ_STAGE_SBR_DIR = $(STAGE_SBR_DIR)
#PROJ_STAGE_DRIVER_BIN_DIR= $(PROJ_STAGE_DIR)/bin/$(BUILD_TARGET)/$(BUILD_TARGET_OS_VERSION)/$(BUILD_CONFIG)
#PROJ_STAGE_DRIVER_BIN_DIR= $(PROJ_STAGE_DIR)/bin/$(BUILD_TARGET)/$(BUILD_TARGET_OS_VERSION)/$(BUILD_CONFIG)
PROJ_STAGE_FASTFABRIC_DIR = $(PROJ_STAGE_DIR)/fastfabric
PROJ_STAGE_IBTOOLS_DIR = $(PROJ_STAGE_DIR)/fastfabric/tools
PROJ_STAGE_SAMPLES_DIR = $(PROJ_STAGE_DIR)/iba_samples
PROJ_STAGE_FIRMWARE_DIR = $(PROJ_STAGE_DIR)/Firmware
PROJ_STAGE_OPA_SA_DB_DIR = $(PROJ_STAGE_DIR)/opasadb
PROJ_STAGE_LSF_DIR = $(PROJ_STAGE_DIR)/Lsf
PROJ_STAGE_MOAB_DIR = $(PROJ_STAGE_DIR)/Moab
PROJ_INCLUDE_DIRS = $(COMN_INCLUDE_DIRS)
PROJ_LIB_DIRS = $(COMN_LIB_DIRS)
PROJDEPLIBS =
PROJLIBS = $(CCLIBS)
BSCPROJ =
# strict-prototypes - treat extern int foo() as function with no args
CPROJ = -DPRODUCT=$(PRODUCT) -DPRODUCT_$(PRODUCT) -DMODULEVERSION=$(MODULEVERSION) -DIB_STACK_OPENIB
ifeq ($(__GNUC__),2)
CPROJ += -fstrict-prototypes
endif
CCPROJ = $(CCNORTTI) $(CCNOEXH) $(CPROJ)
# DBG and _DEBUG_ are primarily used by IbAccess and modules using it
# IB_DEBUG is the prefered define to test
CPROJDEBUG = -DICSDEBUG -DDBG -DIB_DEBUG
DEPENDPROJ =
LDPROJ =
LINTPROJ =
MIDLPROJ =
RSCPROJ =
# On Windows ACE needs MFC DLL
USEMFC = shared
# variables for use in modules building against Open IB Stack
ifeq "$(OFED_STACK_PREFIX)" ""
OFED_STACK_PREFIX=/usr
endif
OPENIB_INCLUDE_DIRS=
#OPENIB_USER_INCLUDE_DIRS= $(OFED_STACK_PREFIX)/include $(OFED_STACK_PREFIX)/include/infiniband
OPENIB_USER_INCLUDE_DIRS= $(OFED_STACK_PREFIX)/include/infiniband $(OFED_STACK_PREFIX)/include
ifeq "$(BUILD_TARGET)" "X86_64"
OPENIB_USER_LIB_DIRS= $(OFED_STACK_PREFIX)/lib64
else
ifeq "$(BUILD_TARGET)" "PPC64"
OPENIB_USER_LIB_DIRS= $(OFED_STACK_PREFIX)/lib64
else
OPENIB_USER_LIB_DIRS= $(OFED_STACK_PREFIX)/lib
endif
endif
OPENIB_USER_LIBS= ibverbs ibumad ibmad
IBACCESS_USER_INCLUDE_DIRS= $(GLOBAL_INCLUDE_DIR)/iba $(GLOBAL_INCLUDE_DIR)/iba/public
IBACCESS_USER_LIB_DIRS=
IBACCESS_USER_LIBS= public
PROJ_INCLUDE_DIRS+= $(IBACCESS_USER_INCLUDE_DIRS) $(OPENIB_INCLUDE_DIRS) $(OPENIB_USER_INCLUDE_DIRS)
CPROJKERNEL=$(CKERNEL)
#-----------------------------------------------------------------------------#
# Platform specific definitions:
#-----------------------------------------------------------------------------#
ifeq "$(BUILD_TARGET_OS)" "VXWORKS"
$(error BUILD_TARGET_OS of VXWORKS not supported)
endif # VXWORKS
ifeq "$(BUILD_TARGET_OS)" "DARWIN"
$(error BUILD_TARGET_OS of DARWIN not supported)
endif # DARWIN
ifeq "$(BUILD_TARGET_OS)" "LINUX"
ifndef BUILD_TARGET_OS_VERSION
$(error BUILD_TARGET_OS_VERSION not defined)
endif
ifndef BUILD_TARGET_OS_VENDOR_VERSION
$(error BUILD_TARGET_OS_VENDOR_VERSION not defined)
endif
ifndef BUILD_TARGET_OS_VENDOR
$(error BUILD_TARGET_OS_VENDOR not defined)
endif
ICS_KERNEL_CONF_FILE:=$(TL_DIR)/Makerules/LINUX/$(BUILD_TARGET).$(BUILD_TARGET_OS_VENDOR).$(BUILD_TARGET_OS_VERSION).h
endif # LINUX
ifeq "$(BUILD_TARGET_OS)" "WIN32"
$(error BUILD_TARGET_OS of WIN32 not supported)
endif # WIN32
#=============================================================================#
#=============================================================================#
## TL_DIR must be set in the environment for the 'make' to succeed.
## icsmake will do this for you
#-----------------------------------------------------------------------------#
# Include Global makerules definitions and rules
include $(TL_DIR)/Makerules/Makerules.global
ifdef BUILD_26
ifndef KERNELRELEASE
#parse cflags for KBUILD
#only trick is with -I options
#with relative path directories
# get an alternate copy of CFLAGS without any compiler options
KBUILD_CFLAGS:=$(filter -D%, $(CMACH)) $(CSYS) $(CENV) $(CPROJ) $(CMOD) $(CLOCAL) $(CINCSRCH)
ifeq "$(BUILD_CONFIG)" "debug"
KBUILD_CFLAGS+=$(filter -D%, $(CDEBUG))
endif
KBUILD_EXTRA_CFLAGS=$(filter-out -I%,$(KBUILD_CFLAGS))
# -I options with absolute paths
KBUILD_INCS:=$(filter -I%,$(KBUILD_CFLAGS))
KBUILD_EXTRA_CFLAGS+=$(filter -I/%,$(KBUILD_INCS))
# -I options with relative paths
KBUILD_REL_INC_DIRS:=$(patsubst -I%,%,$(filter-out -I/%,$(KBUILD_INCS)))
KBUILD_EXTRA_CFLAGS+=$(addprefix -I${PWD}/,$(KBUILD_REL_INC_DIRS))
endif
endif
#=============================================================================#
#=============================================================================#
## The project makerules file also contains the following basic make target
## rules for simplifying application build processes:
##
#=============================================================================#
# The following section contains a list of standard targets which will be used
# by all of the makefiles. The targets are listed in alphabetical order and
# depend on the above definitions section as well as externally defined items
# from the user specific makefile.
#=============================================================================#
# General Rules:
#-----------------------------------------------------------------------------#
#ifeq "$(BUILD_TARGET_OS)" "DARWIN"
#Info.plist: Info.$(BUILD_TARGET_OS_VERSION).plist
# $(SED) -e 's/MODULEVERSION/$(MODULEVERSION)/' < $< > $@
#endif
#=============================================================================#
#=============================================================================#
# This section contains a set of targets which override the standard ones
# provided for by GNU make.
#=============================================================================#
# Standard Makefile Rules Overrides:
#-----------------------------------------------------------------------------#
#=============================================================================#
#=============================================================================#
# Targets to make sure the initial environment is properly configured
#=============================================================================#
#ifndef ENVIRONMENT
#check_env:
# @echo "The ENVIRONMENT environment variable must be set to be valid"
# @exit 1
#else #ENVIRONMENT
#check_env:
#endif #ENVIRONMENT
#.PHONY: check_env
#=============================================================================#