]> oss.titaniummirror.com Git - cp210x.git/commitdiff
Allow building from git checkout.
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Wed, 15 Apr 2009 16:40:41 +0000 (16:40 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Wed, 15 Apr 2009 16:40:41 +0000 (16:40 +0000)
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.

Makefile

index fab3efb67500980d53176694966ec83f6a92ed9f..d440794f88168fdd19f26497f7ad6fc9307c2d0a 100644 (file)
--- 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)"