X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=Makefile;h=c05032785ef9d4cf7324268f57ac989497af6fa5;hb=e408c071a2739a58b2b5e0d91973cd1ab95fa716;hp=953589e06efc5f638f4c17bd0ac9d65ca767c0a8;hpb=2c0d8db912df58c3a1b506e144e2b5d72edec617;p=madwifi%2F.git diff --git a/Makefile b/Makefile index 953589e..c050327 100644 --- a/Makefile +++ b/Makefile @@ -40,38 +40,42 @@ # Makefile for the HAL-based Atheros driver. # -ifeq ($(obj),) -obj= . -endif - +obj := $(firstword $(obj) $(SUBDIRS) .) TOP = $(obj) -ifneq (svnversion.h,$(MAKECMDGOALS)) include $(TOP)/Makefile.inc -endif - -DIRS_MODULES = $(ATH) $(ATH_HAL) $(ATH_RATE) $(WLAN) obj-y := ath/ ath_hal/ ath_rate/ net80211/ +ifdef CRYPTO_TESTING +obj-y += regression/ +endif + +.PHONY: all all: modules tools -modules: configcheck svnversion.h +.PHONY: modules +modules: configcheck $(TOP)/svnversion.h ifdef LINUX24 - for i in $(DIRS_MODULES); do \ + for i in $(obj-y); do \ $(MAKE) -C $$i || exit 1; \ done else $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules endif -.PHONY: svnversion.h -svnversion.h: - @if [ -d .svn ]; then \ - ver=`svnversion -nc . | sed -e 's/^[^:]*://;s/[A-Za-z]//'`; \ +$(addprefix $(obj)/, $(obj-y:/=)): $(TOP)/svnversion.h + +$(TOP)/svnversion.h: + @cd $(TOP) && \ + if [ -d .svn ]; then \ + ver=$$(svnversion -nc . | sed -e 's/^[^:]*://;s/[A-Za-z]//'); \ echo "#define SVNVERSION \"svn r$$ver\"" > $@.tmp; \ + elif [ -d .git ]; then \ + ver=$$(git svn log | head -n2 | tail -n1 | cut -d\ -f1); \ + echo "#define SVNVERSION \"svn $$ver\"" > $@.tmp; \ elif [ -s SNAPSHOT ]; then \ - ver=`sed -e '/^Revision: */!d;s///;q' SNAPSHOT`; \ + ver=$$(sed -e '/^Revision: */!d;s///;q' SNAPSHOT); \ echo "#define SVNVERSION \"svn r$$ver\"" > $@.tmp; \ else \ touch $@.tmp; \ @@ -83,60 +87,65 @@ svnversion.h: tools: $(MAKE) -C $(TOOLS) all || exit 1 +.PHONY: install install: install-modules install-tools +.PHONY: install-modules install-modules: modules @# check if there are modules left from an old installation @# might cause make to abort the build sh scripts/find-madwifi-modules.sh -r $(KERNELRELEASE) $(DESTDIR) - for i in $(DIRS_MODULES); do \ + for i in $(obj-y); do \ $(MAKE) -C $$i install || exit 1; \ done ifeq ($(DESTDIR),) (export KMODPATH=$(KMODPATH); /sbin/depmod -ae $(KERNELRELEASE)) endif +.PHONY: install-tools install-tools: tools $(MAKE) -C $(TOOLS) install || exit 1 +.PHONY: uninstall ininstall-modules uninstall: uninstall-tools uninstall-modules uninstall-modules: sh scripts/find-madwifi-modules.sh -r $(KERNELRELEASE) $(DESTDIR) +.PHONY: list-modules find-modules list-modules: find-modules find-modules: sh scripts/find-madwifi-modules.sh -l $(KERNELRELEASE) +.PHONY: uninstall-tools uninstall-tools: $(MAKE) -C $(TOOLS) uninstall +.PHONY: reinstall reinstall-tools reinstall-modules reinstall: uninstall install reinstall-tools: uninstall-tools install-tools reinstall-modules: uninstall-modules install-modules +.PHONY: clean clean: - for i in $(DIRS_MODULES); do \ + for i in $(obj-y); do \ $(MAKE) -C $$i clean; \ done -$(MAKE) -C $(TOOLS) clean rm -rf .tmp_versions - rm -f *.symvers svnversion.h + rm -f modules.order *.symvers Module.markers svnversion.h +.PHONY: info info: @echo "The following settings will be used for compilation:" - @echo "TARGET : $(TARGET)" - @echo "ARCH : $(ARCH)" @echo "BUS : $(BUS)" - @if [ -n "$(TOOLPATH)" ]; then \ - @echo "TOOLPATH : $(TOOLPATH)"; \ - fi @echo "KERNELRELEASE: $(KERNELRELEASE)" @echo "KERNELPATH : $(KERNELPATH)" @echo "KERNELCONF : $(KERNELCONF)" @echo "KMODPATH : $(KMODPATH)" @echo "KMODSUF : $(KMODSUF)" +.PHONY: sanitycheck sanitycheck: @echo -n "Checking requirements... " @@ -157,6 +166,7 @@ release: unload: bash scripts/madwifi-unload +.PHONY: configcheck configcheck: sanitycheck @echo -n "Checking kernel configuration... "