blob: 8ff035dd95bb6771116ac67810e36510b8080afc [file] [log] [blame]
Jouni Malinencd4e3c32015-10-29 12:39:56 +02001
2ALL=sigma_dut
3
4all: $(ALL)
5
Jouni Malinen80102f12019-02-25 19:03:49 +02006ifdef UBSAN
7CC=clang
8CHECKS=undefined,unsigned-integer-overflow
9CFLAGS += -fsanitize=$(CHECKS)
10CFLAGS += -fno-sanitize-recover=all
11LDFLAGS += -fsanitize=$(CHECKS)
12LDFLAGS += -fno-sanitize-recover=all
13endif
14
Jouni Malinencd4e3c32015-10-29 12:39:56 +020015ifndef CC
16CC=gcc
17endif
18
19ifndef LDO
20LDO=$(CC)
21endif
22
23ifndef CFLAGS
24CFLAGS = -MMD -O2 -Wall -g
25endif
26
27GITVER := $(shell git describe --dirty=+)
28ifneq ($(GITVER),)
29CFLAGS += -DSIGMA_DUT_VER=\"$(GITVER)\"
30endif
31
32export BINDIR ?= /usr/local/bin/
33
34OBJS=sigma_dut.o
35OBJS += utils.o
36OBJS += wpa_ctrl.o
37OBJS += wpa_helpers.o
38
39OBJS += cmds_reg.o
40OBJS += basic.o
41OBJS += sta.o
42OBJS += traffic.o
43OBJS += p2p.o
44OBJS += dev.o
45OBJS += ap.o
46OBJS += powerswitch.o
47OBJS += atheros.o
priyadharshini gowthamand66913a2016-07-29 15:11:17 -070048OBJS += ftm.o
Jouni Malinend86e5822017-08-29 03:55:32 +030049OBJS += dpp.o
Jouni Malinencd4e3c32015-10-29 12:39:56 +020050
51ifndef NO_TRAFFIC_AGENT
52CFLAGS += -DCONFIG_TRAFFIC_AGENT -DCONFIG_WFA_WMM_AC
53OBJS += traffic_agent.o
54OBJS += uapsd_stream.o
55LIBS += -lpthread
56endif
57
58ifndef NO_WLANTEST
59CFLAGS += -DCONFIG_WLANTEST
60OBJS += wlantest.o
61endif
62
63ifndef NO_SNIFFER
64CFLAGS += -DCONFIG_SNIFFER
65OBJS += sniffer.o
66endif
67
Jouni Malinenad8a24e2018-09-04 13:20:11 +030068ifdef SERVER
Jouni Malinencd4e3c32015-10-29 12:39:56 +020069CFLAGS += -DCONFIG_SERVER
70OBJS += server.o
Jouni Malinen3b17d532018-09-04 19:10:58 +030071LIBS += -lsqlite3
Jouni Malinencd4e3c32015-10-29 12:39:56 +020072endif
73
Amarnath Hullur Subramanyam9c381f52017-03-17 00:04:41 -070074ifdef MIRACAST
75OBJS += miracast.o
76CFLAGS += -DMIRACAST -DMIRACAST_DHCP_M
77LIBS += -ldl
78endif
79
Peng Xu291d97d2018-01-31 16:34:03 -080080ifdef NL80211_SUPPORT
81CFLAGS += -DNL80211_SUPPORT -I /usr/include/libnl3
82LIBS += -lnl-3 -lnl-genl-3
83endif
84
Jouni Malinencd4e3c32015-10-29 12:39:56 +020085sigma_dut: $(OBJS)
86 $(LDO) $(LDFLAGS) -o sigma_dut $(OBJS) $(LIBS)
87
88clean:
89 rm -f core *~ *.o *.d sigma_dut
90
91$(DESTDIR)$(BINDIR)/%: %
92 install -D $(<) $(@)
93
94install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
95
96-include $(OBJS:%.o=%.d)