Commit d5a12e3b authored by Cedric Roux's avatar Cedric Roux

- Moved Makerules to OPENAIR_TARGETS

- Created Makefile.common that gathers common definitions for oaisim and lte-softmodem
- Added ITTI capabilities to lte-softmodem (currently not stable)
	* Created dummy l2l1 task
	* Added -K option to output itti messages to file (some RT issues with file flush)
- Added S1AP/SCTP tasks in lte-softmodem

pre-ci ok
lte-softmodem with HARD_RT=1 build ok

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4514 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c53171a9
......@@ -6,16 +6,15 @@ libgtpv1u_OBJECTS = \
nw-gtpv1u/src/NwGtpv1uMsg.o \
nw-gtpv1u/src/NwGtpv1u.o \
gtpv1u_eNB.o \
gtpv1u_teid_pool.o \
gtpv1u_teid_pool.o
CFLAGS = \
-I./nw-gtpv1u/shared \
-I./nw-gtpv1u/include \
-I../UTILS \
-I../UTILS/HASHTABLE \
-I../UDP \
-I$(OPENAIR2_DIR) \
-I../UTILS \
-I../UTILS/HASHTABLE \
-I../UDP \
-I$(OPENAIR2_DIR) \
-DUSER_MODE \
-DENABLE_USE_MME \
-DUSER_MODE \
......
include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
# include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
OUTDIR = $(S1AP_DIR)/enb_objs
......
include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
# include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
OUTDIR = .
......
# This file gathers compilation directive shared between lte-softmodem and oaisim
ITTI_MESSAGES_H = messages_xml.h
ITTI_MESSAGES_XML = messages.xml
ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
include $(COMMON_UTILS_DIR)/Makefile.inc
$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
@echo "Generating messages.xml ..."
@gccxml $(L2_incl) $(UTILS_incl) $< -fxml=$@
@$(CC) -MM $(L2_incl) $(UTILS_incl) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@echo "Generating messages_xml.h ..."
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef ENABLE_ITTI
SHARED_DEPENDENCIES = $(ITTI_MESSAGES_H)
endif
ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
SHARED_DEPENDENCIES += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a
export S1AP_CFLAGS
ENABLE_ITTI = 1
$(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
endif
ifdef ENABLE_ITTI
gccxml_available = $(shell if [ `gccxml --version | grep GCC-XML -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
ifeq ($(gccxml_available), 0)
$(error gccxml is missing, please install)
endif
CFLAGS += -I$(OPENAIR2_DIR)/COMMON -DENABLE_ITTI $(UTILS_incl)
ifndef DISABLE_ITTI_EVENT_FD
CFLAGS += -DENABLE_EVENT_FD
endif
endif
force_look:
@true
common-clean:
@$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
@$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean OUTDIR=$(LFDS_OBJ_DIR)
# @if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB clean OUTDIR=$(S1AP_OBJ_DIR); fi
# @if [ -d $(SCTP_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB clean OUTDIR=$(SCTP_OBJ_DIR); fi
......@@ -57,4 +57,13 @@ COMMON_CFLAGS = \
-fno-strict-aliasing \
-g \
-ggdb \
-O2
\ No newline at end of file
-O2
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP
SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))
export S1AP_DIR
export COMMON_UTILS_DIR
\ No newline at end of file
# Include some shared directives
include $(OPENAIR_TARGETS)/Makerules
default: lte-softmodem
all: lte-softmodem
include $(OPENAIR_TARGETS)/Makefile.common
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
ifeq "$(GCCVERSION)" "4.4.3"
CFLAGS += -Wno-packed-bitfield-compat
......@@ -52,9 +60,6 @@ endif
OBJ += $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
include $(COMMON_UTILS_DIR)/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
......@@ -66,22 +71,6 @@ else
OBJ += $(SCHED_OBJS)
endif
#ifndef rrc_cellular
ifeq ($(rrc_cellular),0)
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
export rrc_cellular
OPENAIR2_TOP = $(OPENAIR2_DIR)
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
......@@ -102,12 +91,16 @@ OPENAIR2=1
endif
ifeq ($(OPENAIR2),1)
ASN1_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS))
OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS)
OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS)
OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
#OBJ += $(PDCP_DIR)/pdcp_thread.o
CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1
endif
ifdef ENABLE_ITTI
OBJ += $(UTILS_OBJS)
endif
CFLAGS += $(L2_incl) $(UTIL_incl) $(UTILS_incl)
CFLAGS += -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES #-I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM
......@@ -158,7 +151,7 @@ endif
RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags) -DRTAI
LDFLAGS += -lpthread -lm -lforms
ifeq ($(RTAI),1)
LDFLAGS += $(shell rtai-config --lxrt-ldflags)
LDFLAGS += $(shell rtai-config --lxrt-ldflags) -lrt
else
LDFLAGS += -lrt
endif
......@@ -168,19 +161,33 @@ CFLAGS += -I/opt/uhd/include -L/opt/uhd/lib -luhd -lpthread -lstdc++
endif
#CFLAGS += -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/x86_64-linux-gnu -I/usr/include/rtai/
all: lte-softmodem
$(LFDS_DIR)/bin/liblfds611.a:
$(MAKE) -C $(LFDS_DIR) -f makefile.linux
LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a
LIBS += $(LFDS_LIB)
SHARED_DEPENDENCIES += $(LFDS_LIB)
$(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)
$(RTAI_OBJ): %.o : %.c
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) -o $@ $<
ifdef ENABLE_ITTI
$(OBJ) $(RTAI_OBJ): $(ITTI_MESSAGES_H)
endif
$(OBJ) $(ASN1_MSG_OBJS1): %.o : %.c
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
@$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) $< > $*.d
@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
$(USRP_OBJ):$(USRP_FILE_OBJ)
@echo Compiling openair_usrp.cpp
......@@ -192,19 +199,13 @@ condtest: condtest.c
synctest: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o synctest
lte-softmodem: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(SHARED_DEPENDENCIES)
@echo Linking $@
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem $(LDFLAGS) $(LIBS)
lte-softmodem: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(LFDS_DIR)/bin/liblfds611.a
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem $(LDFLAGS) $(LFDS_DIR)/bin/liblfds611.a
lte-softmodem-usrp: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(USRP_OBJ) $(LFDS_DIR)/bin/liblfds611.a
$(CC) $(USRP_OBJ) $(CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem-usrp $(LDFLAGS) $(LFDS_DIR)/bin/liblfds611.a
ifeq ($(rrc_cellular_eNB),1)
mv lte-softmodem lte-softmodem_eNB
endif
ifeq ($(rrc_cellular_UE),1)
mv lte-softmodem lte-softmodem_UE
endif
lte-softmodem-usrp: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(USRP_OBJ) $(SHARED_DEPENDENCIES)
@echo Linking $@
@$(CC) $(USRP_OBJ) $(CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem-usrp $(LDFLAGS) $(LIBS)
synctest_eNB: synctest
cp synctest synctest_eNB
......@@ -284,9 +285,10 @@ run_eNB1:
run_eNB2:
rtai-load eNB2 --verbose
clean:
rm -rf $(OBJ) $(RTAI_OBJ)
rm -f $(ASN1_MSG_INC)/asn1_msg.o
clean: common-clean
@$(RM_F_V) $(OBJ) $(RTAI_OBJ)
@$(RM_F_V) $(OBJ:.o=.d) $(RTAI_OBJ:.o=.d)
@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o $(ASN1_MSG_INC)/asn1_msg.d
cleanasn1:
rm -f $(ASN1_MSG_OBJS1)
......@@ -318,9 +320,6 @@ show:
@echo $(EXTRA_CFLAGS)
@echo $(OBJ) $(RTAI_OBJ)
@echo $(USRP_OBJ)
@echo rrc_cellular variable is $(rrc_cellular)
@echo eNB_flag is $(eNB_flag)
@echo UE_flag is $(UE_flag)
@echo IS_REL8 is $(IS_REL8)
@echo IS_REL10 is $(IS_REL10)
......
......@@ -92,8 +92,13 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface_init.h"
# include "timer.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#ifdef XFORMS
......@@ -657,6 +662,9 @@ static void *eNB_thread(void *arg)
slot=0;
frame++;
}
#if defined(ENABLE_ITTI)
itti_update_lte_time(frame, slot);
#endif
}
LOG_D(HW,"eNB_thread: finished, ran %d times.\n",frame);
......@@ -889,6 +897,9 @@ static void *UE_thread(void *arg)
slot=0;
frame++;
}
#if defined(ENABLE_ITTI)
itti_update_lte_time(frame, slot);
#endif
}
LOG_D(HW,"UE_thread: finished, ran %d times.\n",frame);
......@@ -904,9 +915,85 @@ static void *UE_thread(void *arg)
return 0;
}
/* DUmmy l2l1 task */
void *l2l1_task(void *args_p) {
#if defined(ENABLE_ITTI)
MessageDef *message_p;
itti_mark_task_ready (TASK_L2L1);
# if defined(ENABLE_USE_MME)
/* Trying to register each eNB */
{
char *mme_address_v4;
char *mme_address_v6 = "2001:660:5502:12:30da:829a:2343:b6cf";
s1ap_register_eNB_t *s1ap_register_eNB;
uint32_t hash;
if (EPC_MODE_ENABLED)
{
mme_address_v4 = EPC_MODE_MME_ADDRESS;
}
else
{
mme_address_v4 = "192.168.12.87";
}
/* FIXME: following parameters should be setup by eNB applicative layer ? */
message_p = itti_alloc_new_message(TASK_L2L1, S1AP_REGISTER_ENB);
s1ap_register_eNB = &message_p->ittiMsg.s1ap_register_eNB;
hash = s1ap_generate_eNB_id();
/* Some default/random parameters */
s1ap_register_eNB->eNB_id = eNB_id + (hash & 0xFFFF8);
s1ap_register_eNB->cell_type = CELL_MACRO_ENB;
s1ap_register_eNB->tac = 0;
s1ap_register_eNB->mcc = 208;
s1ap_register_eNB->mnc = 34;
s1ap_register_eNB->default_drx = PAGING_DRX_256;
s1ap_register_eNB->nb_mme = 1;
s1ap_register_eNB->mme_ip_address[0].ipv4 = 1;
s1ap_register_eNB->mme_ip_address[0].ipv6 = 0;
memcpy(s1ap_register_eNB->mme_ip_address[0].ipv4_address, mme_address_v4,
strlen(mme_address_v4));
memcpy(s1ap_register_eNB->mme_ip_address[0].ipv6_address, mme_address_v6,
strlen(mme_address_v6));
itti_send_msg_to_task(TASK_S1AP, eNB_id, message_p);
}
# endif
#endif
#if defined(ENABLE_ITTI)
while (1) {
// Checks if a message has been sent to L2L1 task
itti_receive_msg (TASK_L2L1, &message_p);
if (message_p != NULL) {
switch (ITTI_MSG_ID(message_p)) {
case TERMINATE_MESSAGE:
itti_exit_task ();
break;
case MESSAGE_TEST:
LOG_D(EMU, "Received %s\n", ITTI_MSG_NAME(message_p));
break;
default:
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break;
}
free (message_p);
}
}
#endif
return NULL;
}
int main(int argc, char **argv) {
......@@ -964,6 +1051,7 @@ int main(int argc, char **argv) {
int ant_offset=0;
int error_code;
char *itti_dump_file = NULL;
const struct option long_options[] = {
{"calib-ue-rx", required_argument, NULL, 256},
......@@ -976,7 +1064,7 @@ int main(int argc, char **argv) {
mode = normal_txrx;
while ((c = getopt_long (argc, argv, "C:O:ST:UdF:V",long_options,NULL)) != -1)
while ((c = getopt_long (argc, argv, "C:K:O:ST:UdF:V",long_options,NULL)) != -1)
{
switch (c)
{
......@@ -1001,6 +1089,13 @@ int main(int argc, char **argv) {
case 'T':
tcxo=atoi(optarg);
break;
case 'K':
#if defined(ENABLE_ITTI)
itti_dump_file = strdup(optarg);
#else
printf("-K option is disabled when ENABLE_ITTI is not defined\n");
#endif
break;
case 'O':
#if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = 1;
......@@ -1110,6 +1205,32 @@ int main(int argc, char **argv) {
// initialize the log (see log.h for details)
logInit();
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
# if defined(ENABLE_USE_MME)
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing SCTP task interface: FAILED\n");
return -1;
}
if (itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing S1AP task interface: FAILED\n");
return -1;
}
# endif
if (itti_create_task(TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing L2L1 task interface: FAILED\n");
return -1;
}
// Handle signals until all tasks are terminated
// itti_wait_tasks_end();
#endif
if (ouput_vcd) {
if (UE_flag==1)
vcd_signal_dumper_init("/tmp/openair_dump_UE.vcd");
......@@ -1431,6 +1552,23 @@ int main(int argc, char **argv) {
#ifdef OPENAIR2
int eMBMS_active=0;
#if defined(ENABLE_ITTI)
if (UE_flag == 1) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC UE task interface: FAILED\n");
exit (EXIT_FAILURE);
}
} else {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC eNB task interface: FAILED\n");
exit (EXIT_FAILURE);
}
}
#endif
l2_init(frame_parms,eMBMS_active,
0,// cba_group_active
0); // HO flag
......
# Include some standard directives
include Makerules
# Include some shared directives
include $(OPENAIR_TARGETS)/Makerules
default: oaisim
include $(OPENAIR_TARGETS)/Makefile.common
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
......@@ -7,29 +11,13 @@ CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ;
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)
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3_TOP = $(OPENAIR3_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP
SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))
export S1AP_DIR
export COMMON_UTILS_DIR
CFLAGS = $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
ifdef ENABLE_ITTI
CFLAGS += -DENABLE_ITTI
ifndef DISABLE_ITTI_EVENT_FD
CFLAGS += -DENABLE_EVENT_FD
endif
endif
CFLAGS += $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
# Check if GCC version is greater or equal to 4.4
GCCVERSIONGTEQ44 := $(shell expr `gcc -dumpversion | cut -f1,2 -d. --output-delimiter=""` \>= 44)
......@@ -175,10 +163,6 @@ ifndef DISABLE_XER_PRINT
CFLAGS += -DXER_PRINT
endif
ifneq ($(USE_MME), R8)
UPDATE_RELEASE_9=1
endif
ifdef SECU
ifeq ($(NETTLE_FOUND), 0)
@echo "Nettle library >= 2.5 is not installed on your system, continuing with security disabled"
......@@ -194,7 +178,6 @@ endif
endif
endif
include $(COMMON_UTILS_DIR)/Makefile.inc
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
......@@ -202,14 +185,6 @@ 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
#include $(OPENAIR2_DIR)/S1AP/Makefile.inc
#include $(OPENAIR2_DIR)/S1AP/MESSAGES/Makefile.inc
ITTI_MESSAGES_H = messages_xml.h
ITTI_MESSAGES_XML = messages.xml
ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
......@@ -230,7 +205,7 @@ 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
OAISIM_OBJS = oaisim.o
OAISIM_OBJS = $(OPENAIR_TARGETS)/SIMU/USER/oaisim.o
ifdef XFORMS
TOOLS_OBJS += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
......@@ -264,8 +239,8 @@ endif
# Check if libpgm is installed and use it if found instead of the unreliable
# multicast
ifeq ($(PGM_FOUND), 1)
CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
LIBS += $(PGM_LIBS)
CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
LIBS += $(PGM_LIBS)
endif
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS) $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON)
......@@ -276,9 +251,7 @@ endif
LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a
LIBS += $(LFDS_LIB)
OAISIM_DEPENDENCIES = $(LFDS_LIB)
default: oaisim
SHARED_DEPENDENCIES += $(LFDS_LIB)
all: oaisim pad
......@@ -289,20 +262,6 @@ userclean: cleanall oaisim
objsdir:
@if [ ! -d $(OBJS_DIR) ]; then mkdir -p $(OBJS_DIR); fi
ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
OAISIM_DEPENDENCIES += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a
export S1AP_CFLAGS
$(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
endif
printvars:
@echo rrc_cellular variable is $(rrc_cellular)
@echo EXTRA_CFLAGS = $(EXTRA_CFLAGS)
......@@ -323,28 +282,7 @@ OAISIM_COMPILED_OBJECTS = $(subst $(OPENAIR_HOME), $(OBJS_DIR), $(OBJ) $(OAISIM_
-include $(OAISIM_COMPILED_OBJECTS:.o=.d)
ifdef ENABLE_ITTI
gccxml_available = $(shell if [ `gccxml --version | grep GCC-XML -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
ifeq ($(gccxml_available), 0)
$(error gccxml is missing, please install)
endif
endif
$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
@echo "Generating messages.xml ..."
@gccxml $(L2_incl) $(UTILS_incl) $< -fxml=$@
@$(CC) -MM $(L2_incl) $(UTILS_incl) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@echo "Generating messages_xml.h ..."
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef ENABLE_ITTI
$(OAISIM_OBJS): $(ITTI_MESSAGES_H)
$(OAISIM_COMPILED_OBJECTS): $(ITTI_MESSAGES_H)
oaisim_pad.o: $(ITTI_MESSAGES_H)
endif
......@@ -373,7 +311,7 @@ oaisim_pad: $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1)
@$(MPICC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim_pad $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1) \
-lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS)
oaisim: $(OAISIM_COMPILED_OBJECTS) $(OAISIM_DEPENDENCIES)
oaisim: $(OAISIM_COMPILED_OBJECTS) $(SHARED_DEPENDENCIES)
@echo "Linking oaisim ..."
@$(CC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim $(CFLAGS) $(EXTRA_CFLAGS) $(OAISIM_COMPILED_OBJECTS) \
-lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS)
......@@ -425,19 +363,16 @@ cleanall: clean cleanasn1
cleanalmostall: clean
rm -f $(ASN1_MSG_OBJS1)
clean:
@$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean OUTDIR=$(LFDS_OBJ_DIR)
clean: common-clean
@$(RM_F_V) oaisim
@$(RM_F_V) oaisim_pad
@$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
# @$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
@$(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)
@$(RM_F_V) *.exe*
@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o
@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB clean OUTDIR=$(S1AP_OBJ_DIR); fi
@if [ -d $(SCTP_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB clean OUTDIR=$(SCTP_OBJ_DIR); fi
cleanl1:
@$(RM_F_V) LOG_THREAD oaisim
......@@ -489,9 +424,6 @@ showcflags:
@echo oaisim cflags: $(CFLAGS)
@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB showcflags; fi
force_look:
@true
otg_all: otg_latency otg_gp
# need to check if the file exists before calling otgplot
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment