aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/Makefile
blob: 983b330e1fd549c7ecbd6b90a7adf22b636a5747 (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
ALL=wlantest

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


ifndef LDO
LDO=$(CC)
endif

Q=@
E=echo
ifeq ($(V), 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

OBJS += ../src/common/ieee802_11_common.o

OBJS += wlantest.o
OBJS += readpcap.o
OBJS += monitor.o
OBJS += process.o
OBJS += bss.o
OBJS += crc32.o

LIBS += -lpcap


../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

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

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

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