Makefile 9.13 KB
Newer Older
gauthier's avatar
GPLv3    
gauthier committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
################################################################################
#   OpenAirInterface
#   Copyright(c) 1999 - 2014 Eurecom
#
#    OpenAirInterface is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#
#    OpenAirInterface is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with OpenAirInterface.The full GNU General Public License is
#    included in this distribution in the file called "COPYING". If not,
#    see <http://www.gnu.org/licenses/>.
#
#  Contact Information
#  OpenAirInterface Admin: openair_admin@eurecom.fr
#  OpenAirInterface Tech : openair_tech@eurecom.fr
#  OpenAirInterface Dev  : openair4g-devel@eurecom.fr
#
ghaddab's avatar
ghaddab committed
26
#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
gauthier's avatar
GPLv3    
gauthier committed
27
28
#
################################################################################
29
30
31
32
33
34
35
36
37
38
39
####################################################
#       USER SPACE CODE GENERATION
####################################################

#---------------------------------------------------
#
#---------------------------------------------------


#LM_LICENSE_FILE=
#export LM_LICENSE_FILE
40
include $(OPENAIR_HOME)/common/utils/Makefile.inc
41

42
KERNEL_NAME:=$(shell uname -r)
43
NUM_CORES=$(shell getconf _NPROCESSORS_CONF)
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

export SET_UM=$(shell if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "ARCH=um" ; else echo ""; fi)

#SUBDIRS_openair_USERRF  =   $(MAIN_RT_DIR) $(CONFIG_DIR)

#openair_USERRFDIR  = openair_RFOBJS
#openair_USERRFLIBS = $(addsuffix /${openair_USERRFDIR}/Lib.a, ${SUBDIRS_openair_USERRF})
#openair_USERRFOBJS = $(addsuffix /${openair_USERRFDIR}/*.o, ${SUBDIRS_openair_USERRF})
#openair_USERRFDEPS = $(addsuffix /${openair_USERRFDIR}/*.d, ${SUBDIRS_openair_USERRF})

mac_sim_no_netlink:
	( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim MASTER=1)

mac_sim:
	( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim MASTER=1 NETLINK=1 NO_RRM=1)

mac_sim_rrm:
	( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_rrm MASTER=1 NETLINK=1)

mac_sim_mt_cellular:
	( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_mt CELLULAR=1 NO_RRM=1)

mac_sim_rg_cellular:
	( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_rg MASTER=1 CELLULAR=1 NO_RRM=1)

openair_layer2_emul.ko:
thomasl's avatar
thomasl committed
70
	(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` NO_RRM=1 PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 PHYEMUL=1 && mv openair_l2.ko openair_layer2.ko)
71
72

openair_layer2_emul_rrm.ko:
thomasl's avatar
thomasl committed
73
	(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 PHYEMUL=1 && mv openair_l2.ko openair_layer2.ko)
74
75
76


openair_layer2.ko:
thomasl's avatar
thomasl committed
77
	(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` NO_RRM=1 PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2.ko)
78
79

openair_layer2_rrm.ko:
thomasl's avatar
thomasl committed
80
	(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2.ko)
81
82

openair_layer2_2615.ko:
thomasl's avatar
thomasl committed
83
	(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2_2615.ko)
84
85
86


openair_rrc.ko:
thomasl's avatar
thomasl committed
87
	(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 NO_RRM=1 && mv openair_rrc.ko openair_RRC.ko)
88
89

openair_rrc_rrm.ko:
thomasl's avatar
thomasl committed
90
	(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 && mv openair_rrc.ko openair_RRC.ko)
91
92
93


openair_rrc_2615.ko:
thomasl's avatar
thomasl committed
94
	(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 && mv openair_rrc.ko openair_RRC_2615.ko)
95
96

openair_rrc_emul.ko:
thomasl's avatar
thomasl committed
97
	(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 PHYEMUL=1 NO_RRM=1)
98
99

openair_rrc_emul_rrm.ko:
thomasl's avatar
thomasl committed
100
	(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 PHYEMUL=1)
101
102
103


openair_emul.ko:
thomasl's avatar
thomasl committed
104
	(cd SIMULATION/PHY_EMULATION/DEVICE_DRIVER/ && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 NO_RRM=1)
105
106

openair_emul_rrm.ko:
thomasl's avatar
thomasl committed
107
	(cd SIMULATION/PHY_EMULATION/DEVICE_DRIVER/ && $(MAKE) V=1 -C $(KERNEL_DIR)/build  M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1)
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135



create_device:
	rm -f /dev/openair0
	mknod /dev/openair0 c 127 0
	chmod a+rw /dev/openair0


install_emul:
	make devs
	make fifos
	(insmod SIMULATION/PHY_EMULATION/DEVICE_DRIVER/openair_emul.ko)
	(insmod LAYER2/openair_layer2.ko)
	(insmod RRC/MESH/openair_rrc.ko)
	(insmod NAS/DRIVER/MESH/nasmesh.ko)

remove_emul:
	rmmod  nasmesh
	sleep 1
	rmmod  openair_rrc
	sleep 1
	rmmod  openair_l2
	sleep 1
	rmmod  openair_emul


clean_nasmesh:
thomasl's avatar
thomasl committed
136
	(cd NAS/DRIVER/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
137
138

nasmesh_address_fix.ko:
thomasl's avatar
thomasl committed
139
	(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) V=1 ADDRESS_FIX=1 -C $(KERNEL_DIR)/build M=`pwd`)
140
141

nasmesh.ko:
thomasl's avatar
thomasl committed
142
	(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) V=1 -C $(KERNEL_DIR)/build M=`pwd`)
143
144
145

# automatically detect the linux header files for driver compilation
nasmesh_netlink.ko:
thomasl's avatar
thomasl committed
146
	(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
147
148

naslite_netlink_ether.ko:
thomasl's avatar
thomasl committed
149
	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
150
151

oai_nw_ether.ko:
thomasl's avatar
thomasl committed
152
	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
153
154

oai_nw_drv.ko:
thomasl's avatar
thomasl committed
155
	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
156
157

nasmesh_netlink_address_fix.ko:
thomasl's avatar
thomasl committed
158
	(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_NETLINK=1 ADDRESS_FIX=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
159
160
161


nasmesh_netlink_loopback.ko:
thomasl's avatar
thomasl committed
162
	(cd NAS/DRIVER/MESH && $(MAKE) $(SET_UM) NAS_NETLINK=1 LOOPBACK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
163
164
165

# drivers cellular version
nascellmt_netlink.ko:
thomasl's avatar
thomasl committed
166
	(cd NAS/DRIVER/CELLULAR/NASMT && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
167
168

nascellmt_clean.ko:
thomasl's avatar
thomasl committed
169
	(cd NAS/DRIVER/CELLULAR/NASMT && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
170
171

nascellrg_netlink.ko:
thomasl's avatar
thomasl committed
172
	(cd NAS/DRIVER/CELLULAR/NASRG && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
173
174

nascellrg_clean.ko:
thomasl's avatar
thomasl committed
175
	(cd NAS/DRIVER/CELLULAR/NASRG && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 NAS_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
176

gauthier's avatar
   
gauthier committed
177
178
# Driver for UE using LTE core network (MME, S+P-GW)
ue_ip.ko:
thomasl's avatar
thomasl committed
179
	(cd NETWORK_DRIVER/UE_IP && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
gauthier's avatar
   
gauthier committed
180
181


182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
rt_emul:
	(cd SIMULATION/USER_TOOLS/RT_EMUL_LAUNCHER && $(MAKE))

bypass_phy:
	(cd SIMULATION/PHY_EMULATION/TRANSPORT/KERNEL_INTERFACE && $(MAKE))

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


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

201
#	cp arch/openair_CardBus_MIMO1/device_driver/openair_rf.ko $(KERNEL_DIR)/openair/
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#	depmod -aq

devs:
	if ! test -a /dev/openair0;\
	then \
	mknod /dev/openair0 c 127 0;\
	chmod a+rw /dev/openair0;\
	fi;

load_sounder_ue: install_cbmimo1_ublaze
	insmod mac/chansounder/openair_chansounder_ue.ko

load_sounder_nodeb: install_platon
	(cd openair_rf && ./openair_rf_platon 1917600 0 ../arch/platon/rbt_files/DAQ_B.rbt 30p 15p 10p 25p && ./openair_rf_platon 1917600 0 ../arch/platon/rbt_files/daq_platon_11_2005.rbt 30p 15p 10p 25p)


stop_sounder:
	rmmod openair_chansounder
	rmmod openair_rf

stop_sounder_nodeb:
	(cd openair_rf && ./openair_rf_platon 1907600 4)
	rmmod openair_chansounder
	rmmod openair_rf


emul_rt:
	(cd SIMULATION/USER_TOOLS/RT_EMUL_LAUNCHER && $(MAKE))

clean:
	(cd NAS/DRIVER/MESH && $(MAKE) clean)
233
234
235
	(cd NAS/DRIVER/LITE && $(MAKE) clean)
	rm -rf NAS/DRIVER/MESH/RB_TOOL/rb_tool
	rm -rf NAS/DRIVER/LITE/RB_TOOL/rb_tool
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259

cleanall:
	find -name *.o -delete -print
	find -name *.ko -delete -print
	find -name *~ -delete -print
	find -name *.bak -delete -print
	rm -rf NAS/DRIVER/MESH/RB_TOOL/rb_tool
	rm -rf NAS/DRIVER/LITE/RB_TOOL/rb_tool


cleansvn:
	rm -rf `find -name *.svn* -print` ; \
	find -name *.svn* -delete -print

tgz:
	mkdir /tmp/openair2_tmp; \
	$(MAKE) cleanall; \
	cp -r . /tmp/openair2_tmp; \
	(cd /tmp/openair2_tmp && $(MAKE) cleansvn && cd .. && tar czfv openair2.tgz openair2_tmp) ; \
	cp /tmp/openair2.tgz . ;\
	rm -rf /tmp/openair2_tmp

print:
	@echo $(IS_KERNEL_OPENAIRINTERFACE)
260
	@echo $(KERNEL_DIR)
261
	@echo $(IS_LINUX)