1 ################################################################################
2 # Copyright (c) [2017-2019] [Radisys] #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you may not use this file except in compliance with the License. #
6 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, #
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ################################################################################
17 #********************************************************************20**
19 # Name: gNodeB Sample Application
23 # Desc: Compile, assemble and link product software for
24 # various configurations. Further comments are
25 # embedded in the file.
27 # This file supports a variety of environments and
28 # build targets. The default build target will be the
29 # portable target for the Linu 2.4.x with GNU C(gcc)
31 # Env: Linux 2.4.x with GNU C (gcc)
35 # clean remove all object files
39 #********************************************************************21*/
40 #=======================================================================
42 # Identify the location our software which is used by rest
43 # of the build scripts
44 include ../common/rsys_fancy.mak
45 include ../common/env.mak
51 ROOT_DIR=$(ROOT_DIR_SCRIPTS)
55 CPUINFO=`cat /proc/cpuinfo | grep processor| wc -l`
59 NUM_PARALLEL=$(shell echo $(CPUINFO) - 1 |bc)
63 NUM_PARALLEL=$(shell echo $(CPUINFO) + 2 |bc)
66 PARALLEL_COMP=-j $(NUM_PARALLEL)
69 # Different options to CPUH and CPUL builds
70 # Other apsects of tool chain set here
71 # These should be made available appropriately to the builds
73 ifeq ($(MACHINE),BIT64)
75 CC_STRIP =strip --strip-all
81 CC_STRIP =strip --strip-all
96 #-----------------------------------------------------------------------
97 # macro for output file name and makefile name
100 $(Q)echo -e "Preparing directories for build..."
101 $(Q)mkdir -p $(BUILD_DIR)/obj
102 $(Q)mkdir -p $(LOG_ROOT)
103 $(Q)mkdir -p $(LIB_ROOT)
104 $(Q)echo -e "Directories are successfully prepared"
107 ifeq ($(CNM_ENABLE),YES)
108 CNM_OPT = -DxENABLE_CNM -DREM_ENABLE -DCNM_DEBUG
110 CNM_OPT = -UENABLE_CNM -UREM_ENABLE
113 PLTFRM_FLAGS= -UMSPD $(CNM_OPT)
116 PLTFRM_FLAGS += -DMODE=TDD
119 ifeq ($(CA_ENABLE),YES)
120 PLTFRM_FLAGS += -DCA_ENABLE=YES
123 # The include options get merged with the options needed by
124 # the called makefiles and hence we export these to make them
130 # The called makefiles depend on these macros and these need to be exported
136 # Add to the linker options the platform specific components
137 L_OPTS+=-lnsl -lrt -lm -lpthread
140 # Export some of the flags expected from the command line.
141 # These macros are made available for the makefiles called from this makefile
147 ###################################################################################################
148 # TeNB Compilation Options - Help Menu
149 ###################################################################################################
151 @echo -e "******************************************************************"
152 @echo -e "BUILD COMMAND DESCRIPTION "
153 @echo -e "------------------------------------------------------------------"
154 @echo -e "$(RULE)tenb - Builds all components of TeNB$(NORM)"
155 @echo -e "$(OPTS) options: $(NORM)"
156 @echo -e "$(OPTS) MACHINE=BIT64/BIT32 - Default is BIT32$(NORM)"
157 @echo -e "$(OPTS) MODE=TDD - If not specified, MODE=FDD$(NORM)"
158 @echo -e "$(RULE)clean_all tdd cleanup everything$(NORM)"
159 @echo -e "******************************************************************"
163 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/kw.mak OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC1)'
164 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/pj.mak OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC1)'
165 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/rg.mak OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC1)'
168 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/rg.mak clean OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC2)'
169 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/kw.mak clean OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC2)'
170 $(Q)$(MAKE) -f $(COM_BUILD_DIR)/pj.mak clean OBJ_DIR=$(OBJ_ROOT) LIB_DIR=$(LIB_ROOT) LOG_DIR=$(LOG_ROOT) CC='$(CC2)'
173 ###################################################################################################
175 ###################################################################################################
177 tenb: prepare_dirs copy_build
180 $(Q)mkdir -p $(ROOT_DIR)/libs/
181 $(Q)cp -f ./lib/*.a $(ROOT_DIR)/libs/
183 ###################################################################################################
185 ###################################################################################################