From 2cb388736941852c65d215cc1baf8e182f860d45 Mon Sep 17 00:00:00 2001 From: mentor Date: Fri, 23 May 2008 03:49:25 +0000 Subject: [PATCH] Add lots of .PHONY to Makefiles and remove a duplicate rule definition git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3678 0192ed92-7a03-0410-a25b-9323aeb14dbd --- Makefile | 13 +++++++++++++ ath/Makefile | 3 +++ ath_hal/Makefile | 3 +++ ath_rate/Makefile | 3 +++ ath_rate/amrr/Makefile | 3 +++ ath_rate/minstrel/Makefile | 3 +++ ath_rate/onoe/Makefile | 3 +++ ath_rate/sample/Makefile | 3 +++ net80211/Makefile | 3 +++ tools/Makefile | 6 ++++-- 10 files changed, 41 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d5a8199..4d263ee 100644 --- a/Makefile +++ b/Makefile @@ -49,8 +49,10 @@ endif obj-y := ath/ ath_hal/ ath_rate/ net80211/ +.PHONY: all all: modules tools +.PHONY: modules modules: configcheck svnversion.h ifdef LINUX24 for i in $(obj-y); do \ @@ -81,8 +83,10 @@ 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 @@ -95,24 +99,30 @@ 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 $(obj-y); do \ $(MAKE) -C $$i clean; \ @@ -121,6 +131,7 @@ clean: rm -rf .tmp_versions rm -f *.symvers svnversion.h +.PHONY: info info: @echo "The following settings will be used for compilation:" @echo "TARGET : $(TARGET)" @@ -135,6 +146,7 @@ info: @echo "KMODPATH : $(KMODPATH)" @echo "KMODSUF : $(KMODSUF)" +.PHONY: sanitycheck sanitycheck: @echo -n "Checking requirements... " @@ -155,6 +167,7 @@ release: unload: bash scripts/madwifi-unload +.PHONY: configcheck configcheck: sanitycheck @echo -n "Checking kernel configuration... " diff --git a/ath/Makefile b/ath/Makefile index 69c8241..b736ad0 100644 --- a/ath/Makefile +++ b/ath/Makefile @@ -65,13 +65,16 @@ EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) install -m 0644 ath_$(BUSNAME).$(KMODSUF) $(DESTDIR)/$(KMODPATH) +.PHONY: clean clean: rm -f *~ *.o *.ko *.mod.c .*.cmd rm -f .depend .version .*.o.flags .*.o.d diff --git a/ath_hal/Makefile b/ath_hal/Makefile index 994af47..b914aa0 100644 --- a/ath_hal/Makefile +++ b/ath_hal/Makefile @@ -67,6 +67,7 @@ endif -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules @@ -90,6 +91,7 @@ endif `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) @@ -97,6 +99,7 @@ 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 diff --git a/ath_rate/Makefile b/ath_rate/Makefile index 9379c14..d62323f 100644 --- a/ath_rate/Makefile +++ b/ath_rate/Makefile @@ -5,6 +5,7 @@ obj-y := amrr/ onoe/ sample/ minstrel/ include $(TOP)/Makefile.inc +.PHONY: modules modules: ifdef LINUX24 for i in $(obj-y); do \ @@ -14,11 +15,13 @@ else $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules endif +.PHONY: install install: for i in $(obj-y); do \ $(MAKE) -C $$i install || exit 1; \ done +.PHONY: clean clean: for i in $(obj-y); do \ $(MAKE) -C $$i clean; \ diff --git a/ath_rate/amrr/Makefile b/ath_rate/amrr/Makefile index 37f68d9..8667b5f 100644 --- a/ath_rate/amrr/Makefile +++ b/ath_rate/amrr/Makefile @@ -54,13 +54,16 @@ EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) install -m 0644 ath_rate_amrr.$(KMODSUF) $(DESTDIR)/$(KMODPATH) +.PHONY: clean clean: -rm -f *~ *.o *.ko *.mod.c -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd diff --git a/ath_rate/minstrel/Makefile b/ath_rate/minstrel/Makefile index 24f247a..7d13705 100644 --- a/ath_rate/minstrel/Makefile +++ b/ath_rate/minstrel/Makefile @@ -52,13 +52,16 @@ EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) install -m 0644 ath_rate_minstrel.$(KMODSUF) $(DESTDIR)/$(KMODPATH) +.PHONY: clean clean: -rm -f *~ *.o *.ko *.mod.c -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd diff --git a/ath_rate/onoe/Makefile b/ath_rate/onoe/Makefile index 11689cf..f5e6752 100644 --- a/ath_rate/onoe/Makefile +++ b/ath_rate/onoe/Makefile @@ -54,13 +54,16 @@ EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) install -m 0644 ath_rate_onoe.$(KMODSUF) $(DESTDIR)/$(KMODPATH) +.PHONY: clean clean: -rm -f *~ *.o *.ko *.mod.c -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd diff --git a/ath_rate/sample/Makefile b/ath_rate/sample/Makefile index ba3735a..3b19f8e 100644 --- a/ath_rate/sample/Makefile +++ b/ath_rate/sample/Makefile @@ -52,13 +52,16 @@ EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) install -m 0644 ath_rate_sample.$(KMODSUF) $(DESTDIR)/$(KMODPATH) +.PHONY: clean clean: -rm -f *~ *.o *.ko *.mod.c -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd diff --git a/net80211/Makefile b/net80211/Makefile index 6a14996..efdd84a 100644 --- a/net80211/Makefile +++ b/net80211/Makefile @@ -82,6 +82,7 @@ EXTRA_CFLAGS+=$(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\" -include $(TOPDIR)/Rules.make +.PHONY: all all: $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules @@ -102,6 +103,7 @@ wlan_xauth.o: $(wlan_xauth-objs) wlan_acl.o: $(wlan_acl-objs) $(LD) $(LDOPTS) -o wlan_acl.$(KMODSUF) -r $(wlan_acl-objs) +.PHONY: install install: test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH) for i in $(MOD_INSTALL); do \ @@ -109,6 +111,7 @@ install: install -m 0644 $$f.$(KMODSUF) $(DESTDIR)/$(KMODPATH); \ done +.PHONY: clean clean: -rm -f *~ *.o *.ko *.mod.c -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd diff --git a/tools/Makefile b/tools/Makefile index 709d64b..d9c259c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -50,6 +50,7 @@ endif ALL= athstats 80211stats athkey athchans athctrl \ athdebug 80211debug wlanconfig +.PHONY: all all: $(ALL) INCS= -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) @@ -57,8 +58,6 @@ CFLAGS= -g -O2 -Wall ALL_CFLAGS= $(CFLAGS) $(INCS) LDFLAGS= -all: $(ALL) - athstats: athstats.c $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c 80211stats: 80211stats.c @@ -77,6 +76,7 @@ wlanconfig: wlanconfig.c $(CC) -o 80211debug $(ALL_CFLAGS) $(LDFLAGS) 80211debug.c +.PHONY: install install: $(ALL) install -d $(DESTDIR)$(BINDIR) for i in $(ALL); do \ @@ -87,6 +87,7 @@ install: $(ALL) install -m 0644 man/*.8 $(DESTDIR)$(MANDIR)/man8 install $(TOP)/scripts/madwifi-unload $(DESTDIR)$(BINDIR)/madwifi-unload +.PHONY: uninstall uninstall: for i in $(ALL); do \ rm -f $(DESTDIR)$(BINDIR)/$$i; \ @@ -95,5 +96,6 @@ uninstall: rm -f $(DESTDIR)$(MANDIR)/man8/$$i; \ done +.PHONY: clean clean: rm -f $(ALL) core a.out -- 2.35.1