Makefile 3.47 KB
Newer Older
1 2 3 4 5
# command line flags are automatically exported and thus passed down to any sub-make. 
# here we set the default flags in case on command line flags are provided
# these flags have to be explicitely exported so that the sub-make is aware of them


6
include $(OPENAIR_DIR)/common/utils/Makefile.inc
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
ifndef OPENAIR_LTE
export OPENAIR_LTE=1
export OPENAIR_EMU=0
endif

ifndef OPENAIR1
export OPENAIR1=0
endif

ifndef OPENAIR2
export OPENAIR2=0
endif

ifndef OPENAIR3
export OPENAIR3=0
endif

ifndef EMOS
export EMOS=0
endif

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

all: openair_rf_cbmimo1_softmodem.ko asn1_msg_kern.ko nasmesh.ko rb_tool openair_rf scope

openair_rf_cbmimo1_softmodem.ko:  
thomasl's avatar
thomasl committed
45
	(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
46 47

oai_user_cbmimo1.ko:
thomasl's avatar
thomasl committed
48
	(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 BIT8_TX=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
49 50

oai_user_exmimo.ko:
thomasl's avatar
thomasl committed
51
	(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko $(CURDIR)/openair_rf_softmodem.ko)
52 53

asn1_msg_kern.ko:
thomasl's avatar
thomasl committed
54
	(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) -C $(KERNEL_DIR)/build V=0 M=`pwd` RTAI=1 -j2 && mv asn1_msg_kern.ko $(CURDIR)/asn1_msg_kern.ko)
55 56

nasmesh.ko:
thomasl's avatar
thomasl committed
57
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` && mv nasmesh.ko $(CURDIR)/nasmesh.ko)
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 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 124

rb_tool:
	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))

openair_rf:
	(cd $(OPENAIR1_DIR)/USERSPACE_TOOLS/OPENAIR_RF && $(MAKE) clean CBMIMO1=1 && $(MAKE) all CBMIMO1=1 && $(MAKE) clean CBMIMO1=1)

scope:
	(cd $(OPENAIR1_DIR)/USERSPACE_TOOLS/SCOPE && $(MAKE) clean && $(MAKE) all && $(MAKE) clean )	

#Remove all but source files
cleanall: 
	(cd $(OPENAIR1_DIR) && $(MAKE) cleanall)
	(cd $(OPENAIR2_DIR) && $(MAKE) cleanall)

fifos:
	@for i in `seq 0 64`;\
	do \
	have_rtfX=`ls /dev/ |grep -c rtf$$i`;\
	if [ "$$have_rtfX" -eq 0 ] ;then \
	mknod -m 666 /dev/rtf$$i c 150 $$i; \
	fi;\
	done

openair0:
	mknod /dev/openair0 c 127 0
	chmod a+rw /dev/openair0

install_oai_user:
	make fifos
	insmod openair_rf_softmodem.ko

updatefw:
	$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 

boot_exmimo:
	sudo make install_oai_user
	$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 
	sleep 1
	sudo rmmod openair_rf
	sudo make install_oai_user

reboot_exmimo:
	$(OPENAIR1_DIR)/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 -b
	sudo rmmod openair_rf
	sudo make install_oai_user

install_softmodem:
	make fifos
ifeq ($(OPENAIR2),1)
	insmod asn1_msg_kern.ko
endif
	insmod openair_rf_softmodem.ko

remove:
	rmmod openair_rf
ifeq ($(OPENAIR2),1)
	rmmod asn1_msg_kern
endif

test:
	(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) test RTAI=1 CBMIMO1=1)	
	(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) test)

clean:
	(cd $(OPENAIR1_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) clean RTAI=1 CBMIMO1=1)
	(cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES && $(MAKE) clean)