Add lots of .PHONY to Makefiles and remove a duplicate rule definition
[madwifi/.git] / ath_hal / Makefile
index c9a3ef4a36d21ffa7a474ed301b6a3016a9c1c26..b914aa0796d323d092c7196d91d5288da9cd269a 100644 (file)
 # Makefile for the Atheros WLAN driver.
 #
 
-ifeq ($(obj),)
-obj=   .
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/..
 
 include $(TOP)/Makefile.inc
@@ -70,6 +67,7 @@ endif
 
 -include $(TOPDIR)/Rules.make
 
+.PHONY: all
 all:
        $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
 
@@ -89,10 +87,11 @@ else
 endif
        # Replace as many hashed names as possible with meaningful
        # ones in the symbol table of the binary kernel module for HAL.
-       $(OBJCOPY) \
-               `cat $(shell dirname $(obj))/scripts/hal_unmangle.objcopy` \
+       $(filter-out -O binary -S,$(OBJCOPY)) \
+               `cat $(TOP)/scripts/hal_unmangle.objcopy` \
                $(obj)/$(TARGET).hal.o
 
+.PHONY: install
 install:
        test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH)
        install -m 0644 ath_hal.$(KMODSUF) $(DESTDIR)/$(KMODPATH)
@@ -100,11 +99,12 @@ ifneq ($(strip $(ALQ)),0)
        install -m 0644 alq.$(KMODSUF) $(DESTDIR)/$(KMODPATH)
 endif
 
+.PHONY: clean
 clean:
        rm -f *~ *.o *.ko *.mod.c uudecode .*.cmd
        rm -f .depend .version .*.o.flags .*.o.d
        rm -rf .tmp_versions
 
-ath_hal.o: $(ath_hal-objs)
+ath_hal.o: $(addprefix $(obj)/,$(ath_hal-objs))
        $(LD) $(LDFLAGS) -o ath_hal.$(KMODSUF) -r $(ath_hal-objs)