[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[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 Q=
18 S=
19 # Check for verbose build
20 ifneq ($(V),1)
21     Q:=@
22     S:=-s
23 endif
24 export Q
25 export S
26
27 #-DSSINT2 -DSS_TICKS_SEC=100 
28 # MTSS defines
29 SS_FLAGS=-DSS -DSS_MT -DSUNOS -DSS_LINUX -UCONRD -UNOFILESYS -USS_DEBG_MEM_CORRUP_LEVEL1 \
30     -DSS_TICKS_SEC=100 -USSI_DEBUG_LEVEL1 -USS_LICENSE_CHECK -DANSI -D_GNU_SOURCE\
31     -D_REENTRANT -D__EXTENSIONS__ -DDEBUGNOEXIT 
32
33 # Flags to be used if text logging is enabled
34 TEXT_LOGGING = -DRLOG_ENABLE_TEXT_LOGGING -DRLOG_DEBUG_MODE
35
36 ifeq ($(INSTRUMENTATION), YES)
37 INSTRUMENTATION_FLAGS = -DSS_MEM_CORRUPTION_DETECTION 
38 endif
39
40 # Flags pertaining to the functionality of TeNB are included here
41 TENB_FLAGS=-DLTERRC_REL9 -DEGTP_U_REL_9 -UMAC_SCH_STATS -USCH_STATS \
42     -DTENB_TTI_PERF -DAES -DLTE_RRC_DISSECTOR -DRSYS_WIRESHARK
43
44 #ifneq ($(PLTFRM), PAL)
45 #TENB_FLAGS += -DIPV6_SUPPORTED
46 #endif
47
48 ifeq ($(RADIO_CLUSTER), YES)
49 TENB_FLAGS += -DRADIO_CLUSTER
50 endif
51 # Flags that define the broad level functioning of the binary
52 ENV_FLAGS=-DNO_ERRCLS -DNOERRCHK -DDEBUGP 
53
54 RVW_FLAGS=-DCM_PASN_DBG -DLTEMAC_MIMO -DWR_UL_PWR \
55      -DREVIEW -DNL
56
57 # Flags that can be removed when everything works. These flags are not included
58 # in the compilation at the moment.
59 DEL_FLAGS=-DSS_WL_REGION=1 -DVE_PERF_MEAS -UVE_SUPPORT_RLC_UM_MODE -ULTE_LNX_AFFINITY \
60      -DKW_BG_DL_PROC -DKW_BG_UL_PROC -DWR_SB_SCTP -DPHY_ERROR_LOGGING -DWR_DETECT_RLF \
61      -USS_MEM_CORRUPTION_DETECTION -DL2_LOGGING_ENABLED -DLTEMAC_DRX -UUSE_PURE \
62      -DLTE_MULTIUE -DCMKV2 -DYS_ENB_CFG -DTA_NEW -DTENB_DISABLE_DL_ZBC
63
64 ALL_FLAGS=$(SS_FLAGS) $(CMN_FLAGS) $(ENV_FLAGS) $(RVW_FLAGS) $(TENB_FLAGS) $(LNXENV)
65
66 # compiler options:
67 #C_OPTS+=-g -O3 -pipe -pedantic -Wall -Werror -Wno-comment -Wshadow 
68 C_OPTS+=-g -pipe -Wall -Wno-comment -Wshadow \
69     -Wcast-qual -fno-strict-aliasing -fsigned-char --std=c99
70
71 COPTS_WO_WERROR=-g -O3 -pipe -pedantic -Wall -Wno-comment -Wshadow \
72     -Wcast-qual -fno-strict-aliasing -fsigned-char --std=c99
73
74 xCPP_OPTS+=-g -pipe -pedantic -Wall -Werror -Wno-comment -Wshadow \
75     -Wcast-qual -fno-strict-aliasing -fsigned-char -lstdc++ 
76
77 # Include path settings
78 I_OPTS+=-I$(SRC_DIR) -I$(ROOT_DIR)/src/cm -I$(ROOT_DIR)/src/mt -I$(ROOT_DIR)/src/wls_lib
79 I_OPTS+=$(PLTFRM_INCLUDES)
80 .SUFFIXES:.c .o
81
82 $(C_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
83         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
84         $(Q)$(CC) -c -o $@ $(C_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
85     $(PLTFRM_FLAGS) $<
86
87 $(C_WO_WERR_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
88         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
89         $(Q)$(CC) -c -o $@ $(COPTS_WO_WERROR) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
90     $(PLTFRM_FLAGS) $<
91
92 $(CPP_OBJS):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(HDR_FILES)
93         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
94         $(Q)$(CC) -c -o $@ $(CPP_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
95     $(PLTFRM_FLAGS) $<
96
97 $(C_OBJS_WO_LOG):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HDR_FILES)
98         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
99         $(Q)$(CC) -c -o $@ $(C_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
100     $(PLTFRM_FLAGS) $<
101
102 $(CPP_OBJS_WO_LOG):$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(HDR_FILES)
103         @echo -e "Compiling $(COLOR_RED) $< $(REVERT_COLOR)"
104         $(Q)$(CC) -c -o $@ $(CPP_OPTS) $(I_OPTS) $(ALL_FLAGS) $(TEXT_LOGGING) $(MOD_FLAGS) \
105     $(PLTFRM_FLAGS) $<
106
107 #**********************************************************************
108 #         End of file
109 #**********************************************************************