0af6203d70aff55c966ae44130d16f1d99298aac
[o-du/l2.git] / build / common / compile.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 #/********************************************************************16**
18 #
19 #       Name:   gNodeB Sample Application
20 #
21 #       Type:   make file
22 #
23 #       Desc:   Compile, assemble and link product software for
24 #               various configurations. Further comments are
25 #               embedded in the file. 
26 #
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)
30 #
31 #       Env:    Linux 2.4.x with GNU C (gcc)
32 #
33 #       File:  compile.mak
34 #
35 #********************************************************************21*/
36 #=======================================================================
37
38 STOPTS=-DENB 
39
40 Q=
41 S=
42 # Check for verbose build
43 ifneq ($(V),1)
44     Q:=@
45     S:=-s
46 endif
47 export Q
48 export S
49
50 #-DSSINT2 -DSS_TICKS_SEC=100 
51 # MTSS defines
52 SS_FLAGS=-DSS -DSS_MT -DSUNOS -DSS_LINUX -UCONRD -UNOFILESYS -USS_DEBG_MEM_CORRUP_LEVEL1 \
53     -DSS_TICKS_SEC=100 -USSI_DEBUG_LEVEL1 -USS_LICENSE_CHECK -DANSI -D_GNU_SOURCE\
54     -D_REENTRANT -D__EXTENSIONS__ -DDEBUGNOEXIT 
55
56 # Flags to be used if text logging is enabled
57 TEXT_LOGGING = -DRLOG_ENABLE_TEXT_LOGGING -DRLOG_DEBUG_MODE
58
59 ifeq ($(INSTRUMENTATION), YES)
60 INSTRUMENTATION_FLAGS = -DSS_MEM_CORRUPTION_DETECTION 
61 endif
62
63 # Flags pertaining to the functionality of TeNB are included here
64 TENB_FLAGS=-DLTERRC_REL9 -DEGTP_U_REL_9 -UMAC_SCH_STATS -USCH_STATS \
65     -DTENB_TTI_PERF -DAES -DLTE_RRC_DISSECTOR -DRSYS_WIRESHARK
66
67 #ifneq ($(PLTFRM), PAL)
68 #TENB_FLAGS += -DIPV6_SUPPORTED
69 #endif
70
71 ifeq ($(RADIO_CLUSTER), YES)
72 TENB_FLAGS += -DRADIO_CLUSTER
73 endif
74 # Flags that define the broad level functioning of the binary
75 ENV_FLAGS=-DNO_ERRCLS -DNOERRCHK -DDEBUGP 
76
77 RVW_FLAGS=-DCM_PASN_DBG -DLTEMAC_MIMO -DWR_UL_PWR \
78      -DREVIEW -DNL
79
80 # Flags that can be removed when everything works. These flags are not included
81 # in the compilation at the moment.
82 DEL_FLAGS=-DSS_WL_REGION=1 -DVE_PERF_MEAS -UVE_SUPPORT_RLC_UM_MODE -ULTE_LNX_AFFINITY \
83      -DKW_BG_DL_PROC -DKW_BG_UL_PROC -DWR_SB_SCTP -DPHY_ERROR_LOGGING -DWR_DETECT_RLF \
84      -USS_MEM_CORRUPTION_DETECTION -DL2_LOGGING_ENABLED -DLTEMAC_DRX -UUSE_PURE \
85      -DLTE_MULTIUE -DCMKV2 -DYS_ENB_CFG -DTA_NEW -DTENB_DISABLE_DL_ZBC
86
87 ALL_FLAGS=$(SS_FLAGS) $(CMN_FLAGS) $(ENV_FLAGS) $(RVW_FLAGS) $(TENB_FLAGS) $(LNXENV)
88
89 # compiler options:
90 #C_OPTS+=-g -O3 -pipe -pedantic -Wall -Werror -Wno-comment -Wshadow 
91 C_OPTS+=-g -pipe -Wall -Wno-comment -Wshadow \
92     -Wcast-qual -fno-strict-aliasing -fsigned-char --std=c99
93
94 COPTS_WO_PEDANTIC=-g -O3 -pipe -Wall -Werror -Wno-comment -Wshadow \
95     -Wcast-qual -fno-strict-aliasing -fsigned-char --std=c99
96
97 COPTS_WO_WERROR=-g -O3 -pipe -pedantic -Wall -Wno-comment -Wshadow \
98     -Wcast-qual -fno-strict-aliasing -fsigned-char --std=c99
99
100 xCPP_OPTS+=-g -pipe -pedantic -Wall -Werror -Wno-comment -Wshadow \
101     -Wcast-qual -fno-strict-aliasing -fsigned-char -lstdc++ 
102
103 # Include path settings
104 I_OPTS+=-I$(SRC_DIR) -I$(ROOT_DIR)/src/cm -I$(ROOT_DIR)/src/mt -I$(ROOT_DIR)/src/rlog -I$(ROOT_DIR)/src/wls_lib
105 I_OPTS+=$(PLTFRM_INCLUDES)
106 .SUFFIXES:.c .o
107
108 $(C_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
109         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
110         $(Q)$(CC) -c -o $@ $(C_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
111     $(PLTFRM_FLAGS) $<
112
113 $(C_WO_WERR_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
114         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
115         $(Q)$(CC) -c -o $@ $(COPTS_WO_WERROR) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
116     $(PLTFRM_FLAGS) $<
117
118 $(C_WO_PED_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
119         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
120         $(Q)$(CC) -c -o $@ $(COPTS_WO_PEDANTIC) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
121     $(PLTFRM_FLAGS) $<
122
123 $(CPP_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(HDR_FILES)
124         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
125         $(Q)$(CC) -c -o $@ $(CPP_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
126     $(PLTFRM_FLAGS) $<
127
128 $(C_OBJS_WO_LOG):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
129         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
130         $(Q)$(CC) -c -o $@ $(C_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
131     $(PLTFRM_FLAGS) $<
132
133 $(C_WO_PED_OBJS_WO_LOG):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
134         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
135         $(Q)$(CC) -c -o $@ $(COPTS_WO_PEDANTIC) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
136     $(PLTFRM_FLAGS) $<
137
138 $(CPP_OBJS_WO_LOG):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(HDR_FILES)
139         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
140         $(Q)$(CC) -c -o $@ $(CPP_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
141     $(PLTFRM_FLAGS) $<
142