1 2ALL=sigma_dut 3 4all: $(ALL) 5 6ifndef CC 7CC=gcc 8endif 9 10ifndef LDO 11LDO=$(CC) 12endif 13 14ifndef CFLAGS 15CFLAGS = -MMD -O2 -Wall -g 16endif 17 18GITVER := $(shell git describe --dirty=+) 19ifneq ($(GITVER),) 20CFLAGS += -DSIGMA_DUT_VER=\"$(GITVER)\" 21endif 22 23export BINDIR ?= /usr/local/bin/ 24 25OBJS=sigma_dut.o 26OBJS += utils.o 27OBJS += wpa_ctrl.o 28OBJS += wpa_helpers.o 29 30OBJS += cmds_reg.o 31OBJS += basic.o 32OBJS += sta.o 33OBJS += traffic.o 34OBJS += p2p.o 35OBJS += dev.o 36OBJS += ap.o 37OBJS += powerswitch.o 38OBJS += atheros.o 39OBJS += ftm.o 40OBJS += dpp.o 41 42ifndef NO_TRAFFIC_AGENT 43CFLAGS += -DCONFIG_TRAFFIC_AGENT -DCONFIG_WFA_WMM_AC 44OBJS += traffic_agent.o 45OBJS += uapsd_stream.o 46LIBS += -lpthread 47endif 48 49ifndef NO_WLANTEST 50CFLAGS += -DCONFIG_WLANTEST 51OBJS += wlantest.o 52endif 53 54ifndef NO_SNIFFER 55CFLAGS += -DCONFIG_SNIFFER 56OBJS += sniffer.o 57endif 58 59ifdef SERVER 60CFLAGS += -DCONFIG_SERVER 61OBJS += server.o 62LIBS += -lsqlite3 63endif 64 65ifdef MIRACAST 66OBJS += miracast.o 67CFLAGS += -DMIRACAST -DMIRACAST_DHCP_M 68LIBS += -ldl 69endif 70 71ifdef NL80211_SUPPORT 72CFLAGS += -DNL80211_SUPPORT -I /usr/include/libnl3 73LIBS += -lnl-3 -lnl-genl-3 74endif 75 76sigma_dut: $(OBJS) 77 $(LDO) $(LDFLAGS) -o sigma_dut $(OBJS) $(LIBS) 78 79clean: 80 rm -f core *~ *.o *.d sigma_dut 81 82$(DESTDIR)$(BINDIR)/%: % 83 install -D $(<) $(@) 84 85install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) 86 87-include $(OBJS:%.o=%.d) 88