
DEPTH=	.

include Makefile.inc

# NB: the order is important here
DIRS=	${CLICK_WIFI} ${HOSTAP} ${MADWIFI}

TOPDIR := $(shell /bin/pwd)

DATE := $(shell date +'%Y.%m.%d')

all:
	for i in ${DIRS}; do \
		(cd $$i; make) || exit 1; \
	done

install:
	for i in ${DIRS}; do \
		(cd $$i; make install); \
	done

ifeq ($(DESTDIR),)
	/sbin/depmod -ae
endif

REL_NAME=stripped.$(DATE)

# this is weird, but it works:
release:
	cd /tmp; \
	rm -f $(REL_NAME).tgz; \
	rm -f $(REL_NAME); \
	ln -sf $(TOPDIR) $(REL_NAME) ; \
	tar -cvz -f $(REL_NAME).tgz $(REL_NAME)/. ; \
	rm -f $(REL_NAME) ;\
	cd $(TOPDIR); \
	scp /tmp/$(REL_NAME).tgz 18.26.4.9:~jbicket/public_html/madwifi.stripped/dist/; \
	rm -f /tmp/$(REL_NAME)



clean:
	for i in ${DIRS}; do \
		(cd $$i; make clean); \
	done
	rm -f *~

upload: all
	scp click_wifi/click_wifi.o ath_hal/ath_hal.o driver/ath_pci.o grand:
