Makefile 1.82 KB
Newer Older
1
2
# NASMESH Driver makefile
#
3
include $(OPENAIR_HOME)/common/utils/Makefile.inc
4
5
NAS_UPDIR	:= $(shell /bin/pwd)

thomasl's avatar
thomasl committed
6
7
KERNEL_ARCH:=$(shell echo `uname -m`)
SET_X64:=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
8
9
10
11

####################################################
#      EXTRA COMPILER FLAGS
####################################################
thomasl's avatar
   
thomasl committed
12
EXTRA_CFLAGS = -I$(OPENAIR2_DIR)/COMMON -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) 
13
14
15
16
17
18

ifdef ADDRCONF
EXTRA_CFLAGS += -DADDRCONF
endif

ifdef OAI_NW_DRIVER_TYPE_ETHERNET
19
EXTRA_CFLAGS += -DOAI_NW_DRIVER_TYPE_ETHERNET
20
21
22
23
24
25
26
27
endif

ifdef OAI_NW_DRIVER_USE_NETLINK
EXTRA_CFLAGS += -DOAI_NW_DRIVER_USE_NETLINK
else
EXTRA_CFLAGS += $(shell rtai-config --module-cflags) -DRTAI -D__IN_RTAI__ -Wall
endif

28
29
ccflags-y= $(CFLAGS) $(EXTRA_CFLAGS)
CFLAGS=
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

ifdef LOOPBACK
EXTRA_CFLAGS += -DLOOPBACK_TEST
endif

ifdef ADDRESS_FIX
EXTRA_CFLAGS += -DNAS_ADDRESS_FIX
endif

####################################################
#      LOADABLE MODULE GOALS
####################################################
obj-m += oai_nw_drv.o
oai_nw_drv-objs += device.o
oai_nw_drv-objs += common.o
oai_nw_drv-objs += ioctl.o
46
oai_nw_drv-objs += classifier.o
47
48
49
50
51
52
53
54
55
56
oai_nw_drv-objs += tool.o
ifdef OAI_NW_DRIVER_USE_NETLINK
oai_nw_drv-objs += netlink.o
endif

####################################################
#      REVOIR LE CLEAN
####################################################

#netlink.ko:
57
	#make $(x)$(y) NAS_NETLINK=1 V=1 -C $(KERNEL_DIR) M=`pwd` modules
58
59

#oai_nw_drv.ko:
60
#	make  V=1 -C $(KERNEL_DIR) M=`pwd` modules
61
62
63
64
65
66
67
68
69
70
71
72
print:
	@echo subversion : $(SUBVERSION)
clean:
	rm -f *.ko
	rm -f .*.ko.cmd
	rm -f .*.o.cmd
	rm -f *.o
	rm -f *.mod.c
	find . -name *.ko     -delete
	find . -name .*.o     -delete
	find . -name *.o      -delete
	find . -name *.mod.c  -delete