From: smckown Date: Wed, 15 Apr 2009 16:40:41 +0000 (+0000) Subject: Allow building from git checkout. X-Git-Tag: debian/0.11.2-5.2tmi~23 X-Git-Url: https://oss.titaniummirror.com/gitweb?p=cp210x.git;a=commitdiff_plain;h=732561c03b576d87edb9c55db6cfe871ee6791f3 Allow building from git checkout. Update Makefile so that it can properly build packages using either an svn checkout or a git checkout. The code has to still have been checked out from svn. --- diff --git a/Makefile b/Makefile index fab3efb..d440794 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,16 @@ BUILD = build KVER := $(shell uname -r) KSRCVER := $(shell echo $(KVER) | sed -e 's/-[0-9][^-]*-[a-zA-Z][^-]*$$//') PKGVER = 0.11 -SVNRELEASE := $(shell svn info | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/') -DEBRELEASE := 0tmi$(SVNRELEASE) + +REPORELEASE := $(shell svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/') +ifeq (,$(REPORELEASE)) + REPORELEASE := $(shell git svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/') +endif +ifeq (,$(REPORELEASE)) + $(error You much check the code out from svn using svn or git) +endif + +DEBRELEASE := 0tmi$(REPORELEASE) DEBVER := $(PKGVER)-$(DEBRELEASE) RFC822DATE := $(shell date --rfc-822) ROOTNAME := cp210x @@ -63,7 +71,7 @@ debug: @echo "BUILD = $(BUILD)" @echo "KVER = $(KVER)" @echo "PKGVER = $(PKGVER)" - @echo "SVNRELEASE = |$(SVNRELEASE)|" + @echo "REPORELEASE = |$(REPORELEASE)|" @echo "DEBRELEASE = $(DEBRELEASE)" @echo "DEBVER = $(DEBVER)" @echo "RFC822DATE = $(RFC822DATE)"