From 9dec64f9a8eddd205bf7fdbb89a05c318f67a945 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 14 Jul 2008 19:53:50 +0000 Subject: [PATCH] Treat svnversion.h as a real target, not a phony one Allow Linux 2.6 build system to generate svnversion.h if it's missing. This is useful for Debian "Linux module extra" package build infrastructure. Original patch from Kel Modderman. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3770 0192ed92-7a03-0410-a25b-9323aeb14dbd --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 73fb31f..f154bb0 100644 --- a/Makefile +++ b/Makefile @@ -43,9 +43,7 @@ obj := $(firstword $(obj) $(SUBDIRS) .) TOP = $(obj) -ifneq (svnversion.h,$(MAKECMDGOALS)) include $(TOP)/Makefile.inc -endif obj-y := ath/ ath_hal/ ath_rate/ net80211/ @@ -57,7 +55,7 @@ endif all: modules tools .PHONY: modules -modules: configcheck svnversion.h +modules: configcheck $(TOP)/svnversion.h ifdef LINUX24 for i in $(obj-y); do \ $(MAKE) -C $$i || exit 1; \ @@ -66,9 +64,11 @@ else $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules endif -.PHONY: svnversion.h -svnversion.h: - @if [ -d .svn ]; then \ +$(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 \ -- 2.35.1