summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-04-06 17:39:22 +0200
committerSuren A. Chilingaryan <csa@suren.me>2016-04-06 17:39:22 +0200
commite7c6e108bdd0829530716bafde88d1999111a81f (patch)
treee5904ce106f6fb5bbdcd1c6e5e926677a46ac222
parentf48b49e7c5a7eb4ab123d23b1980c0abfb4f348f (diff)
downloadpcitool-e7c6e108bdd0829530716bafde88d1999111a81f.tar.gz
pcitool-e7c6e108bdd0829530716bafde88d1999111a81f.tar.bz2
pcitool-e7c6e108bdd0829530716bafde88d1999111a81f.tar.xz
pcitool-e7c6e108bdd0829530716bafde88d1999111a81f.zip
Fix driver compilation when bazaar is missing in the system
-rw-r--r--driver/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/driver/Makefile b/driver/Makefile
index d905ab0..96260cf 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -52,16 +52,20 @@ default:
build_user=`whoami` ;\
build_date=`date "+%Y/%m/%d %H:%M:%S"` ;\
build="Built at $$build_date by $$build_user" ;\
- if [ -d ../.bzr ]; then \
+ bzr=`which bzr 2>/dev/null` ;\
+ if [ $$? -eq 0 -a -d ../.bzr ]; then \
build_revision=`bzr revno` ;\
build_author=`bzr log -r$$build_revision | grep committer | cut -c 12-` ;\
build_branch=`bzr nick` ;\
build_changes=`bzr status -SV | cut -c 5- | tr \\\n " "` ;\
revision="Revision $$build_revision from $$build_branch by $$build_author at $$build_path, last modification from $$build_lastmod" ;\
/bin/echo -e "#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES \"$$build_changes\"\\n" > build.h ;\
+ elif [ -d ../.bzr ]; then \
+ revision="Revision r\" PCILIB_REVISION \" from \" PCILIB_REVISION_BRANCH \" by \" PCILIB_REVISION_AUTHOR \" at $$build_path, last modification from $$build_lastmod" ;\
+ /bin/echo -e "#include \"../pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
else \
revision="Release \" PCILIB_RELEASE \" (r\" PCILIB_REVISION \") from \" PCILIB_REVISION_BRANCH \" by \" PCILIB_REVISION_AUTHOR \" at $$build_path, last modification from $$build_lastmod" ;\
- /bin/echo -e "#include \"../pcilib/build.h\"\\n #define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
+ /bin/echo -e "#include \"../pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
fi ;\
$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) CC=$$CC modules