# Edit this path to match with your system (it should point to the root
# directory of the Linux kernel source). hostapd uses it only to get matching
# version of linux/wireless.h so that ioctls match with the kernel driver.
KERNEL_PATH=/usr/src/linux

CC=gcc

ifndef CFLAGS
# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
# a file (undefine it, if you want to save in binary size)

# define WORDS_BIGENDIAN if you are building for big endian system
# (e.g., PowerPC)

CFLAGS = -O2 -Wall -g -I$(KERNEL_PATH)/include -DHOSTAPD_DUMP_STATE
endif

OBJS =	hostapd.o eloop.o ieee802_1x.o eapol_sm.o radius.o md5.o rc4.o common.o

all: hostapd

hostapd: $(OBJS)
	$(CC) -o hostapd $(CFLAGS) $(OBJS)

hostapd.o: hostapd.c ../driver/modules/hostap_wlan.h eloop.h ap.h hostapd.h \
	ieee802_1x.h common.h
eloop.o: eloop.c eloop.h
ieee802_1x.o: ieee802_1x.c ieee802_1x.h ap.h hostapd.h radius.h common.h \
	eapol_sm.h md5.h rc4.h
eapol_sm.o: eapol_sm.c eapol_sm.h hostapd.h ieee802_1x.h eloop.h
radius.o: radius.c radius.h common.h md5.h
md5.o: md5.c md5.h common.h
rc4.o: rc4.c rc4.h common.h
common.o: common.c common.h

clean:
	rm -f core *.o hostapd
