Makefile 15.2 KB
Newer Older
1 2 3 4 5
# Include some shared directives
include $(OPENAIR_TARGETS)/Makerules

default: oaisim

nikaeinn's avatar
nikaeinn committed
6
include $(OPENAIR_TARGETS)/Makefile.common
7

8 9 10 11 12
TOP_DIR               = $(OPENAIR1_DIR)
OPENAIR1_TOP          = $(OPENAIR1_DIR)
OPENAIR2_TOP          = $(OPENAIR2_DIR)
OPENAIR3_TOP          = $(OPENAIR3_DIR)
OPENAIR3              = $(OPENAIR3_DIR)
13

14 15 16 17 18
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ; else if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "-mssse3" ; else echo ""; fi; fi)
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
19
CFLAGS += -O2	
20

21
ifeq ($(DEBUG),1)	
22
CFLAGS += -g -ggdb -DDEBUG_PHY -DDEBUG_MEAS
23 24
CFLAGS += -DRRC_MSG_PRINT
CFLAGS += -DPDCP_MSG_PRINT
25
#CFLAGS += -DTRACE_RLC_UM_PDU
gauthier's avatar
 
gauthier committed
26
#CFLAGS += -DTRACE_RLC_AM_PDU
27 28 29 30 31
endif 

ifeq ($(MSG_PRINT),1)
CFLAGS += -DRRC_MSG_PRINT
CFLAGS += -DPDCP_MSG_PRINT
32 33 34
endif

CFLAGS += -Wstrict-prototypes -Wpointer-sign
35
CFLAGS += -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
36

37 38 39 40 41 42 43 44 45 46 47 48
# Check if GCC version is greater or equal to 4.4
GCCVERSIONGTEQ44 := $(shell expr `gcc -dumpversion | cut -f1,2 -d. --output-delimiter=""` \>= 44)
ifeq "$(GCCVERSIONGTEQ44)" "1"
    CFLAGS += -Wno-packed-bitfield-compat
endif

ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES

CFLAGS += -DOPENAIR_LTE -DPUCCH #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -DPHY_ABSTRACTION #-DPHY_ABSTRACTION_UL #-DRLC_UM_TEST_TRAFFIC=1
CFLAGS += -DNEW_FFT
#CFLAGS += -DLLR8
49
CFLAGS += -DPACKAGE_NAME='"oaisim"'
50

51 52 53 54 55 56 57 58 59
ifndef OPENAIR2
OPENAIR2=1
endif

ifdef DEBUG
DISABLE_XER_PRINT=0
MSG_PRINT=1
endif

60 61 62 63 64 65 66 67 68 69 70 71 72 73
ifndef OPENAIR_EMU
export OPENAIR_EMU=1
endif

ifdef EMOS
CFLAGS+=-DEMOS
endif

ifdef TRAFFIC_TM5
CFLAGS += -DRLC_UM_TEST_TRAFFIC=1 #-DFULL_BUFFER=1
endif

# activate OCG and libxml only under linux
ifeq ($(linux),1)
74
CFLAGS += $(LIBXML2_CFLAGS) -L/usr/local/lib -I/usr/include/atlas -L/usr/X11R6/lib
75
OCG_FLAG =1
76 77 78 79 80 81 82
CFLAGS += -DLINUX
endif

ifdef SMBV
CFLAGS += -DSMBV
endif

83
ifeq ($(XFORMS), 1)
84 85 86
CFLAGS += -DXFORMS
endif

87
ifdef DB
88 89 90 91 92
# Check if libmysqlclient is installed and use it if found to store simulation data for postprocessing
ENABLE_DB = $(shell if [ `dpkg -l | grep libmysqlclient -c` = "0" ]; then  echo "0" ; else  echo "1" ; fi )
ifeq ($(ENABLE_DB), 1)
CFLAGS +=-I/usr/include/mysql -L/usr/lib/mysql -DENABLE_DB_STATS
DB_LDFLAGS = -lmysqlclient
93
endif
94
endif
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
ifdef PRINT_STATS
CFLAGS += -DPRINT_STATS
endif

ifndef rrc_cellular
rrc_cellular = 0
rrc_cellular_eNB = 0
rrc_cellular_UE = 0
else
  ifeq ($(eNB_flag),1)
    rrc_cellular_eNB=1
  endif
  ifeq ($(UE_flag),1)
    rrc_cellular_UE=1
  endif
endif

ifdef LS
CFLAGS += -DLARGE_SCALE
endif

# ln -sf EUTRA-RRC-Definitions-a20.asn EUTRA-RRC-Definitions.asn
# make cleanasn1
#make all Rel10=1

ifdef CBA
CFLAGS += -DRel10
CFLAGS += -DCBA
124
$(info "Rel10=1 CBA=1")
125 126 127

else ifdef Rel10
CFLAGS += -DRel10
128
$(info "Rel10=1")
129
else # default is rel 8
130
$(info "Rel8=1")
131 132 133
CFLAGS += -DRel8
endif

134
#CFLAGS += -DMAX_NUM_CCs=1
knopp's avatar
 
knopp committed
135

gauthier's avatar
gauthier committed
136 137 138
ifeq ($(RLC_STOP_ON_LOST_PDU), 1)
CFLAGS += -DRLC_STOP_ON_LOST_PDU
endif
gauthier's avatar
gauthier committed
139 140 141
ifeq ($(STOP_ON_IP_TRAFFIC_OVERLOAD), 1)
CFLAGS += -DSTOP_ON_IP_TRAFFIC_OVERLOAD
endif
gauthier's avatar
gauthier committed
142

143 144 145

ifeq ($(MIH_C_MEDIEVAL_EXTENSIONS), 1)
CFLAGS += -DMIH_C_MEDIEVAL_EXTENSIONS
146 147
ifeq ($(USE_3GPP_ADDR_AS_LINK_ADDR), 1)
CFLAGS += -DUSE_3GPP_ADDR_AS_LINK_ADDR
148
endif
149 150 151
endif


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
ifeq ($(NAS), 1)
CFLAGS += -DNAS_NETLINK -DLINUX
NAS_FLAG=1
endif

ifdef TEST_OMG
CFLAGS += -DTEST_OMG
#CFLAGS += -DDEBUG_OMG
endif
# after the execution, a profiling output "gmon.out" will be created,
#then we need to run "gprof ./oaisim > gmon.txt" in the same directory as "gmon.out"
# you could also use the script "grpof2dot.py gmon.txt" for visual diagrams
ifdef GPROF
CFLAGS += -pg
endif

#require kernel patch for oai driver to enable address autoconfiguration (IPv6 only)
ifdef ADDCONF
CFLAGS+=-DADDRCONF
endif

ifdef OAI_NW_DRIVER_TYPE_ETHERNET
CFLAGS+=-DOAI_NW_DRIVER_TYPE_ETHERNET
endif

CFLAGS += $(shell if [ `uname -o` = "Cygwin" ] ; then echo "-DCYGWIN" ;fi)

180 181 182 183
CFLAGS += -DENABLE_FXP -DOAI_EMU -DENABLE_USE_CPU_EXECUTION_TIME
ifndef DISABLE_XER_PRINT
CFLAGS += -DXER_PRINT
endif
184

185 186
ifdef SECU
ifeq ($(NETTLE_FOUND), 0)
187
$(warning "Nettle library >= 2.5 is not installed on your system, nettle-dev lib needed, continuing with security disabled")
188 189 190
SECU=0
else
ifeq ($(OPENSSL_FOUND), 0)
191
$(warning "openssl library is not installed on your system, openssl lib needed, continuing with security disabled")
192 193 194
SECU=0
else
CFLAGS += -DENABLE_SECURITY
195
LIBS += $(OPENSSL_LIBS) $(NETTLE_LIBS)
196 197 198 199
endif
endif
endif

200 201 202 203 204 205 206
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc
include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
207
include $(OPENAIR3_DIR)/RAL-LTE/Makefile.inc
winckel's avatar
winckel committed
208 209
include $(OPENAIR2_DIR)/ENB_APP/Makefile.inc

210

211
INCLUDES += -I$(TOP_DIR)
winckel's avatar
winckel committed
212 213 214 215 216
INCLUDES += $(L2_incl)
INCLUDES += $(ENB_APP_incl)
INCLUDES += $(UTIL_incl)
INCLUDES += $(UTILS_incl)
INCLUDES += -I$(ASN1_MSG_INC)
217
INCLUDES += -I$(COMMON_UTILS_DIR)/collection
218

219 220 221 222 223 224 225 226 227 228
SIMULATION_OBJS  = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/abstraction.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o

229
ASN1_RRC_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS))
230

231 232 233 234 235 236
OAISIM_OBJS_COMMON  = $(OPENAIR_TARGETS)/SIMU/USER/channel_sim.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/init_lte.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/oaisim_config.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/sinr_sim.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/cor_SF_sim.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/oaisim_functions.o
237
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/event_handler.o
238

239
OAISIM_OBJS = $(OPENAIR_TARGETS)/SIMU/USER/oaisim.o
240

241
ifeq ($(XFORMS), 1)	
242 243 244 245 246 247 248
TOOLS_OBJS += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
endif

ifdef PAD
CFLAGS += -DPAD
endif

249 250 251
OAISIM_PAD_OBJS =  $(OPENAIR_TARGETS)/SIMU/USER/discrete_event_generator.o
OAISIM_PAD_OBJS += $(OPENAIR_TARGETS)/SIMU/USER/threadpool.o
OAISIM_PAD_OBJS += $(OPENAIR_TARGETS)/SIMU/USER/oaisim_pad.o
252
#deactivate the log offloading
253 254 255 256 257
ifndef LOG_THREAD
CFLAGS +=-DLOG_NO_THREAD
endif

ifdef PROC
258 259 260
INT_OBJS += $(OPENAIR_TARGETS)/SIMU/PROC/channel_sim_proc.o
INT_OBJS += $(OPENAIR_TARGETS)/SIMU/PROC/Process.o
CFLAGS += -DPROC
261 262 263
endif

CFLAGS += -DENABLE_VCD_FIFO
Cedric Roux's avatar
Cedric Roux committed
264
CFLAGS += -DENABLE_NEW_MULTICAST
265
ifdef NAS
266
CFLAGS += -DENABLE_PDCP_NETLINK_FIFO
267
endif
268 269
# CFLAGS += -DENABLE_LOG_FIFO

270 271
# Check if libpgm is installed and use it if found instead of the unreliable
# multicast
272
ifeq ($(PGM_FOUND), 1)
273 274
CFLAGS		+= $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
LIBS		+= $(PGM_LIBS)
275 276
endif

277
OBJ += $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS)
278
OBJ += $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON) $(ENB_APP_OBJS)
279 280 281 282
ifeq ($(OPENAIR2),1)
OBJ += $(L2_OBJS)
endif

283 284 285
LFDS_OBJ_DIR		 = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
LFDS_LIB		 = $(LFDS_OBJ_DIR)/bin/liblfds611.a
LIBS 			+= $(LFDS_LIB)
286
SHARED_DEPENDENCIES 	+= $(LFDS_LIB)
287

nikaeinn's avatar
nikaeinn committed
288
all: oaisim 
289 290 291 292 293

pad: oaisim_pad

userclean: cleanall oaisim

294 295 296
objsdir:
	@if [ ! -d $(OBJS_DIR) ]; then mkdir -p $(OBJS_DIR); fi

297 298 299 300 301 302 303 304 305
printvars:
	@echo rrc_cellular variable is $(rrc_cellular)
	@echo EXTRA_CFLAGS = $(EXTRA_CFLAGS)
	@echo OAI Config generator is $(OCG_FLAG)
	@echo OAI NETLINK FLAG is $(NAS_FLAG)
	@echo SSE3 proc is $(SSE3PROC)
	@echo L2 objs are $(L2_OBJS)
	@echo eNB_flag is $(eNB_flag)
	@echo UE_flag is $(UE_flag)
306
	@echo S1AP objs: $(S1AP_BUILT_OBJS)
307
	@echo X2AP objs: $(X2AP_BUILT_OBJS)
308
	@echo CFLAGS: $(CFLAGS)
309
	@echo Enable PGM: $(PGM_FOUND)
310

311
##UTIL_YAC_C = $(OPENAIR2_TOP)/UTIL/enb_parser.o
312
##$(UTIL_LEX_C) = $(subst $(OPENAIR_HOME), $(OBJS_DIR), $(OBJ) $(OAISIM_OBJS) $(ASN1_RRC_MSG_OBJS1))
313 314


315
OAISIM_COMPILED_OBJECTS = $(subst $(OPENAIR_HOME), $(OBJS_DIR), $(OBJ) $(OAISIM_OBJS) $(ASN1_RRC_MSG_OBJS1))
Cedric Roux's avatar
Cedric Roux committed
316

317
-include $(ITTI_MESSAGES_XML:.xml=.d)
318
-include $(OAISIM_PAD_OBJS:.o=.d)
Cedric Roux's avatar
Cedric Roux committed
319
-include $(OAISIM_COMPILED_OBJECTS:.o=.d)
320

winckel's avatar
winckel committed
321
ifdef ENABLE_ITTI
322
$(OAISIM_COMPILED_OBJECTS): $(ITTI_MESSAGES_H)
323 324

oaisim_pad.o: $(ITTI_MESSAGES_H)
325
endif
326

327 328 329 330
$(OAISIM_COMPILED_OBJECTS): | objsdir

.SECONDEXPANSION:
$(OAISIM_COMPILED_OBJECTS) $(OAISIM_PAD_OBJS): %.o : $$(subst $(OBJS_DIR), $(OPENAIR_HOME), $$*.c)
331
	@echo Compiling $<
332
	@if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi;
winckel's avatar
winckel committed
333 334
	@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DPHY_CONTEXT=1 $(INCLUDES) -o $@ $<
	@$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) -DPHY_CONTEXT=1 $(INCLUDES) $< > $*.d
335 336 337 338 339 340
	@mv -f $*.d $*.d.tmp
	@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
	sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
	@rm -f $*.d.tmp

341 342 343 344
$(LFDS_LIB):
	@if [ ! -d $(LFDS_OBJ_DIR)/bin ]; then mkdir -p $(LFDS_OBJ_DIR)/bin; fi;
	@if [ ! -d $(LFDS_OBJ_DIR)/obj ]; then mkdir -p $(LFDS_OBJ_DIR)/obj; fi;
	$(MAKE) -C $(LFDS_DIR) -f makefile.linux OUTDIR=$(LFDS_OBJ_DIR)
345

346
oaisim_pad: $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_RRC_MSG_OBJS1)
347
	@echo "Linking oaisim_pad ..."
348
	@$(MPICC) $(INCLUDES) $(S1AP_Incl) $(X2AP_Incl) -o oaisim_pad $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_RRC_MSG_OBJS1) \
winckel's avatar
winckel committed
349
	-lpthread -llapack_atlas -lforms -lrt -lconfig $(LIBS) $(DB_LDFLAGS)
350

351
oaisim: $(OAISIM_COMPILED_OBJECTS) $(SHARED_DEPENDENCIES)
352
	@echo "Linking oaisim ..."
353
	@$(CC) $(INCLUDES) $(S1AP_Incl) $(X2AP_Incl) -o oaisim $(CFLAGS) $(EXTRA_CFLAGS) $(OAISIM_COMPILED_OBJECTS) \
354
	-lpthread -llapack_atlas -lforms -lrt -lconfig $(LIBS) $(DB_LDFLAGS)
355 356 357 358 359 360 361 362

ifeq ($(rrc_cellular_eNB),1)
	mv oaisim oaisim_eNB
endif
ifeq ($(rrc_cellular_UE),1)
	mv oaisim oaisim_UE
endif

363
oaisimCROWN: $(OBJ) $(ASN1_RRC_MSG_OBJS1) oaisimCROWN.c
364
	@echo "Compiling oaisimCROWN.c ..."
365
	@$(CC) oaisimCROWN.c $(INCLUDES) $(S1AP_Incl) $(X2AP_Incl) -o oaisimCROWN $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(ASN1_RRC_MSG_OBJS1) -lm -lblas -lpthread -llapack_atlas -lforms $(LIBXML2_LIBS) -lX11 -lXpm -lrt -lconfig 
366

gauthier's avatar
gauthier committed
367 368 369 370 371
oai_nw_drv:
	(cd $(OPENAIR2_DIR) && $(MAKE) oai_nw_drv.ko)
	(cp $(OPENAIR2_DIR)/NAS/DRIVER/LITE/oai_nw_drv.ko . )
oai_nw_drv_clean:
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/LITE && $(MAKE) clean)
372
nasmesh_fix:
373 374 375 376 377 378 379 380
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE) clean && $(MAKE))
	(cd $(OPENAIR2_DIR) && $(MAKE) clean && $(MAKE) nasmesh_netlink_address_fix.ko)
nasmesh_fix_uninstall:	
	(sudo rmmod nasmesh.ko)
nasmesh_fix_install:	
	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)	
nasmesh_fix_reinstall:
	(sudo rmmod nasmesh.ko)	
381 382
	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
nasmesh_nl:
383 384
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
	(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink.ko)
385 386
	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
rb_tool:
387
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
388 389 390 391

nasmesh_install:
	(sudo rmmod nasmesh)
	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
392 393
nasmesh_clean:
	(cd $(OPENAIR2_DIR) && $(MAKE) clean)
394 395 396 397 398 399 400 401 402
nas_sim_mt_cellular:
	( cd $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR && make nasmt_sim CELLULAR=1 NO_RRM=1)

nas_sim_rg_cellular:
	( cd $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR && make nasrg_sim MASTER=1 CELLULAR=1 NO_RRM=1)

rrm_std_cellular:
	( cd $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR && make cell_rrm CELL_RRM=1 CELLULAR=1 NO_RRM=1)

403
cleanall: common-cleanall clean cleanasn1
404

405
cleanalmostall: clean
406
	rm -f $(ASN1_RRC_MSG_OBJS1)
407

408
clean: common-clean
409 410
	@$(RM_F_V) oaisim
	@$(RM_F_V) oaisim_pad
411
# 	@$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
412 413 414 415
	@$(RM_F_V) $(OAISIM_PAD_OBJS)
	@$(RM_F_V) $(OAISIM_PAD_OBJS:.o=.d)
	@$(RM_F_V) $(OAISIM_COMPILED_OBJECTS)
	@$(RM_F_V) $(OAISIM_COMPILED_OBJECTS:.o=.d)
416 417
	@$(RM_F_V) *.exe*
	@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o
418 419

cleanl1:
420 421 422 423
	@$(RM_F_V) LOG_THREAD oaisim
	@$(RM_F_V) $(PHY_OBJS) $(SCHED_OBJS)
	@$(RM_F_V) *.o
	@$(RM_F_V) *.exe
424 425

cleanl2:
426 427
	@$(RM_F_V) $(L2_OBJS)
	@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o
428 429

cleanasn1:
430
	@$(RM_F_V) $(ASN1_RRC_MSG_OBJS1)
431 432 433 434 435
	$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ; rm -f $(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS) *.o *.d)
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8
436 437

cleancell:
438 439 440 441 442 443
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/CELLULAR/*.o
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/CELLULAR/*.d
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/L2_INTERFACE/*.o
	@$(RM_F_V) $(OPENAIR2_DIR)/RRC/L2_INTERFACE/*.d
	@$(RM_F_V) $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.o
	@$(RM_F_V) $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.d
444

445 446 447
cleanlfds:
	$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean

448
print:
449 450 451
	@echo "OBJ "				$(OBJ)
	@echo "OAISIM_OBJS "		$(OAISIM_OBJS)
	@echo "OAISIM_PAD_OBJS "	$(OAISIM_PAD_OBJS)
452
	@echo "OCG_FLAG are "		$(OCG_FLAG)
453 454
	@echo "CFLAGS are "			$(CFLAGS)
	@echo "EXTRA_CFLAGS are"	$(EXTRA_CFLAGS)
455
	@echo "COMMON_CFLAGS are"	$(COMMON_CFLAGS)
456
	@echo "L2 includes are"		$(L2_incl)
winckel's avatar
winckel committed
457
	@echo "INCLUDES are"		$(INCLUDES)
458
	@echo "S1AP Includes are"	$(S1AP_Incl)
459
	@echo "X2AP Includes are"	$(X2AP_Incl)
460
	@echo "TOP_DIR Include is"	I$(TOP_DIR)
461 462
	@echo "UTIL includes are"	$(UTIL_incl)
	@echo "UTILS includes are"	$(UTILS_incl)
463 464 465 466
	@echo "IS_REL8 is "			$(IS_REL8)
	@echo "IS_REL10 is "		$(IS_REL10)
	@echo "ENABLE_DB is "		$(ENABLE_DB)
	@echo "Libs are"			$(LIBS)
467
	@echo "NAS"			$(NAS)	
468 469

showcflags:
470
	@echo oaisim cflags: $(CFLAGS)
winckel's avatar
winckel committed
471
	@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB showcflags; fi
472
	@if [ -d $(X2AP_DIR) ]; then $(MAKE) -C $(X2AP_DIR) -f Makefile.inc showcflags; fi
473

474
otg_all: otg_latency otg_gp
475 476 477

# need to check if the file exists before calling otgplot
otg_latency:
478 479
	export TITLE="Application OWD(ms)"
	cp /tmp/otg_latency.dat /tmp/onewaydelay.dat
480 481
	$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_latency.dat" "[$(COL1):$(COL2)]"
otg_latency_bg:
482
	export TITLE="Background OWD(ms)"
483 484
	$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_latency_bg.dat" "[$(COL1):$(COL2)]"
otg_gp:
485
	export TITLE="Application Goodput(Kb/s)"
486 487 488
	cp /tmp/otg_GP.dat /tmp/goodput.dat
	$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/goodput.dat" "[$(COL1):$(COL2)]"
otg_gp_bg:
489
	export TITLE="Background Goodput(Kb/s)"
490
	$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_GP_bg.dat" "[$(COL1):$(COL2)]"
491
otg_jitter:
492
	export TITLE="Aplication Jitter(ms)"
493
	$(OPENAIR2_DIR)/UTIL/OTG/OTGplot "/tmp/otg_jitter.dat" "[$(COL1):$(COL2)]"
494 495 496

pexpect = $(shell if [ `dpkg -l | grep pexpect -c` = "0" ]; then  echo "0" ; else  echo "1" ; fi )

497
pre-ci:
498 499
	@echo "Pre-commit check"

500
ifeq 	($(pexpect), 1)
501 502 503
ifndef	PW
	@echo "Usage: make pre-ci PW=mypassword"
	@echo "Password is used to access the local host through ssh."
504
	python $(OPENAIR_TARGETS)/TEST/OAI/test01.py
505 506 507 508 509
else
	python $(OPENAIR_TARGETS)/TEST/OAI/test01.py -w $(PW)
endif
else
	@echo "Python pexpect package is missing, please install"
510
endif