# set to 0 if you don't want any debugging code to be compiled in
export ACX_DEBUG=0
ifndef KERNEL_SOURCE
KERNEL_SOURCE=/lib/modules/$(shell uname -r)/build
endif

.PHONY: all extract_firmware driver install clean

all: modules

modules:
	make -C $(KERNEL_SOURCE) SUBDIRS=$(shell pwd)/src modules

config.mk: Configure
	@./Configure

extract_firmware: firmware
	make -C firmware extract_firmware

driver: config.mk
	make -C src

install:
	make -C $(KERNEL_SOURCE) SUBDIRS=$(shell pwd)/src modules_add

clean:
	make -C $(KERNEL_SOURCE) SUBDIRS=$(shell pwd)/src clean

distclean: 
#	@echo "WARNING this will remove all binaries, including the \
#		file that contains the firmware information. If you \
#		wish to continue press enter, else CTL-C"; \
#	pause; \
#	cd firmware; rm *.o -f; rm CVS -rf; cd ..; \
#	cd src; rm *.o -f; rm CVS -rf; cd ..; \
#	cd include; rm CVS -rf; cd ..; \ 
#	cd scripts; rm CVS -rf; cd ..;
