aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/Makefile
blob: 7104f4f583d3aed30286ff4c6702d369ea57133d (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
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
125
126
127
128
129
130
131
ALL=wlantest wlantest_cli test_vectors

all: $(ALL)

ifndef CC
CC=gcc
endif

ifndef RANLIB
RANLIB=ranlib
endif

ifndef CFLAGS
CFLAGS = -MMD -O2 -Wall -g
endif


CFLAGS += -I.
CFLAGS += -I../src
CFLAGS += -I../src/utils

# glibc < 2.17 needs -lrt for clock_gettime()
LIBS += -lrt

ifndef LDO
LDO=$(CC)
endif

Q=@
E=echo
ifeq ($(V), 1)
Q=
E=true
endif
ifeq ($(QUIET), 1)
Q=@
E=true
endif

%.o: %.c
	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
	@$(E) "  CC " $<


OBJS_lib += ../src/utils/libutils.a
OBJS_lib += ../src/crypto/libcrypto.a

CFLAGS += -DCONFIG_PEERKEY
CFLAGS += -DCONFIG_IEEE80211W
CFLAGS += -DCONFIG_IEEE80211R
CFLAGS += -DCONFIG_HS20
CFLAGS += -DCONFIG_DEBUG_FILE
CFLAGS += -DCONFIG_FILS

OBJS += ../src/common/ieee802_11_common.o
OBJS += ../src/common/wpa_common.o
OBJS += ../src/radius/radius.o
OBJS += ../src/rsn_supp/wpa_ie.o

OBJS += wlantest.o
OBJS += readpcap.o
OBJS += writepcap.o
OBJS += monitor.o
OBJS += process.o
OBJS += wired.o
OBJS += rx_mgmt.o
OBJS += rx_data.o
OBJS += rx_eapol.o
OBJS += rx_ip.o
OBJS += rx_tdls.o
OBJS += bss.o
OBJS += sta.o
OBJS += ccmp.o
OBJS += tkip.o
OBJS += ctrl.o
OBJS += inject.o
OBJS += wep.o
OBJS += bip.o
OBJS += gcmp.o

LIBS += -lpcap

TOBJS += test_vectors.o
TOBJS += ccmp.o
TOBJS += tkip.o
TOBJS += wep.o
TOBJS += bip.o
TOBJS += gcmp.o


../src/utils/libutils.a:
	$(MAKE) -C ../src/utils

../src/crypto/libcrypto.a:
	$(MAKE) -C ../src/crypto


ifneq ($(CONFIG_SOLIB), yes)
LIBWLANTEST = libwlantest.a
libwlantest.a: $(OBJS_lib)
	$(AR) crT libwlantest.a $(OBJS_lib)
	$(RANLIB) libwlantest.a

else
CFLAGS  += -fPIC -DPIC
LDFLAGS += -shared

LIBWLANTEST  = libwlantest.so
libwlantest.so: $(OBJS_lib)
	$(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBWLANTEST)

endif


OBJS_cli = wlantest_cli.o


wlantest: $(OBJS) $(LIBWLANTEST)
	$(LDO) $(LDFLAGS) -o wlantest $(OBJS) -L. -lwlantest $(LIBS)

wlantest_cli: $(OBJS_cli) $(LIBWLANTEST)
	$(LDO) $(LDFLAGS) -o wlantest_cli $(OBJS_cli) -L. -lwlantest $(LIBS)

test_vectors: $(TOBJS) $(LIBWLANTEST)
	$(LDO) $(LDFLAGS) -o test_vectors $(TOBJS) -L. -lwlantest $(LIBS)

clean:
	$(MAKE) -C ../src clean
	rm -f core *~ *.o *.d libwlantest.a libwlantest.so $(ALL)

-include $(OBJS:%.o=%.d)