f3370716b8f30309d66a4bdbd3356f9336759602
[o-du/l2.git] / build / common / cm.mak
1 ################################################################################
2 #   Copyright (c) [2017-2019] [Radisys]                                        #
3 #                                                                              #
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                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
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 ################################################################################
16
17 #-------------------------------------------------------------#
18 #Makefile for product cm - script generated.
19 #Only the $(CCcmFLAGS) may be modified.
20 #-------------------------------------------------------------#
21 include ../common/rsys_fancy.mak
22 include ../common/env.mak
23 COLOR=$(COLOR_GREEN)
24 SRC_DIR=$(ROOT_DIR)/src/cm
25
26 EG_DIR=$(ROOT_DIR)/src/egtpu
27 SZ_DIR=$(ROOT_DIR)/src/s1ap
28 CZ_DIR=$(ROOT_DIR)/src/x2ap
29
30 # TODO - The dependency between layers and CM files should be removed #
31 I_OPTS+=-I$(EG_DIR) -I$(SZ_DIR) -I$(CZ_DIR)
32 I_OPTS+=-I$(ROOT_DIR)/src/du_app
33 I_OPTS+=-I$(ROOT_DIR)/src/codec_utils/common
34
35 #-------------------------------------------------------------#
36 #User macros (to be modified)
37 #-------------------------------------------------------------#
38 #CCrmFLAGS=-DLRM_LWLC -DRMU_LWLC -URMU_NPLC -DRGM_LWLC -DLWLCSMRMMILRM -DLCSMRMMILRM -DSM -DRM_INTF
39 #CCnlFlags=-DLWLCSMSONILNL -DNLU_LWLC -DLCSMSONILNL -DNLU_TC -DTCSMSONILNL -DNL
40 #CCcmFLAGS=-DSS_MT_TMR -DSS_FLOAT  -DRGR_V1 -DLSZV1 -DVE_SB_SCTP $(CCrmFLAGS)
41 #CCsmFLAGS=-DHI -DSB -DEG -DWR -DKW -DKW_PDCP -DPJ -DSZ -DYS -DRG -DNH -UVE_SM_LOG_TO_FILE -DRGR_SI_SCH -DTA_NEW -DSI_NEW -DCZ $(CCrmFLAGS) $(CCnlFlags)
42
43 #-------------------------------------------------------------#
44 # Define all the layers that are part of this binary so that  #
45 # their coupling requirements get defined from envopt.h.      #
46 #-------------------------------------------------------------#
47 # TODO -DRM has conflict with some cm_atm files. It is temp-  #
48 # orarily removed from this list.                             #
49 MOD_FLAGS=-DNH -DWR -DNX -DSZ -DCZ -DSB -DHI -DEG -DSM -DNL -DSM -DRG -DKW -DYS
50 #This module does not support binary logging so disable it
51 TEXT_LOG=YES
52
53 #-------------------------------------------------------------#
54 # Source file list. This needs to be explicitly built as CM
55 # directory contains files for both CPUL and CPUH.
56 #-------------------------------------------------------------#
57 C_SRCS=$(wildcard $(SRC_DIR)/*.c)
58 C_SRCS:=$(filter-out %cm_ss.c, $(C_SRCS))
59 C_SRCS:=$(filter-out %egt_util.c, $(C_SRCS))
60 C_SRCS:=$(filter-out %lve.c, $(C_SRCS))
61 C_SRCS:=$(filter-out %cm_atm.c, $(C_SRCS))
62 C_SRCS:=$(filter-out %_ptsp.c, $(C_SRCS))
63 C_SRCS:=$(filter-out %_se_tst.c, $(C_SRCS))
64 ifeq ($(PLTFRM),XEON)
65 C_SRCS:=$(filter-out %mem_wl.c, $(C_SRCS))
66 else
67 C_SRCS:=$(filter-out %mem.c, $(C_SRCS))
68 endif
69
70 C_OBJS_WO_LOG=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(C_SRCS))
71 HDR_FILES+= $(wildcard $(SRC_DIR)/*.[hx])
72
73
74 lib: $(LIB_DIR)/libcm.a
75
76 include $(COM_BUILD_DIR)/compile.mak
77
78 #-------------------------------------------------------------#
79 #Linker macros             
80 #-------------------------------------------------------------#
81 $(LIB_DIR)/libcm.a:$(C_OBJS_WO_LOG)
82         @echo -e "Creating Archive $(COLOR) $@ $(REVERT_COLOR)"
83         $(Q)ar -cr $(LIB_DIR)/libcm.a $(C_OBJS) 
84 #-------------------------------------------------------------#
85 #Clean macros             
86 #-------------------------------------------------------------#
87 clean:
88         @echo -e "$(COLOR_RED)Cleaning CPUH CM$(REVERT_COLOR)"
89         @echo -e "$(COLOR_RED) $(REVERT_COLOR)"
90         $(Q)\rm -f $(LIB_DIR)/libcm.a $(C_OBJS_WO_LOG)
91
92