ifndef CC
CC=gcc
endif

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

# Include directories for CVS version
CFLAGS += -I../driver/modules -I../utils -I../hostapd -I../../hcf -I../../include -I../../include/hcf -I../../include/wireless

# Uncomment following two lines to use portable libdnet and libpcap instead of
# Linux-specific internal implementation for L2 packet handling
#CFLAGS += -DUSE_DNET_PCAP
#LIBS=-ldnet -lpcap

all: wpa_supplicant wpa_passphrase

OBJS = wpa_supplicant.o sha1.o aes_wrap.o config.o l2_packet.o \
	driver_wext.o driver_hostap.o driver_prism54.o driver_hermes.o\
	../hostapd/eloop.o ../hostapd/common.o ../hostapd/md5.o \
	../hostapd/rc4.o
OBJS_p = wpa_passphrase.o sha1.o

wpa_supplicant: $(OBJS)
	$(CC) -o wpa_supplicant $(OBJS) $(LIBS)

wpa_passphrase: $(OBJS_p)
	$(CC) -o wpa_passphrase $(OBJS_p)

clean:
	rm -f core *~ *.o wpa_supplicant wpa_passphrase *.d

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