Skip to content

Commit

Permalink
Treat svnversion.h as a real target, not a phony one
Browse files Browse the repository at this point in the history
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
  • Loading branch information
proski committed Jul 14, 2008
1 parent 4878463 commit 9dec64f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand All @@ -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; \
Expand All @@ -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 \
Expand Down

0 comments on commit 9dec64f

Please sign in to comment.