summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/build.cmake4
-rw-r--r--driver/Makefile13
2 files changed, 10 insertions, 7 deletions
diff --git a/cmake/build.cmake b/cmake/build.cmake
index b0d803a..2488e4c 100644
--- a/cmake/build.cmake
+++ b/cmake/build.cmake
@@ -38,7 +38,7 @@ if (${_retcode} EQUAL 0)
set(PCILIB_LAST_MODIFICATION ${_output})
endif (${_retcode} EQUAL 0)
-if (BAZAAR_FOUND)
+if (BAZAAR_FOUND AND EXISTS ${PCILIB_SOURCE_DIR}/.bzr)
execute_process(
COMMAND ${BAZAAR_EXECUTABLE} revno --tree ${PCILIB_SOURCE_DIR}
RESULT_VARIABLE _retcode
@@ -77,6 +77,6 @@ if (BAZAAR_FOUND)
string(REGEX REPLACE "\n+" ";" PCILIB_REVISION_MODIFICATIONS "${_output}")
# set(PCILIB_REVISION_MODIFICATIONS ${_output})
endif (${_retcode} EQUAL 0)
-endif(BAZAAR_FOUND)
+endif(BAZAAR_FOUND AND EXISTS ${PCILIB_SOURCE_DIR}/.bzr)
configure_file(${PCILIB_SOURCE_DIR}/pcilib/build.h.in ${PCILIB_BINARY_DIR}/pcilib/build.h)
diff --git a/driver/Makefile b/driver/Makefile
index 96260cf..f932693 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -60,12 +60,15 @@ default:
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 ;\
+ grep "#define PCILIB_RELEASE" ../pcilib/build.h &> /dev/null ;\
+ if [ $$? -eq 0 ]; then \
+ 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 ;\
+ else \
+ 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 ;\
+ fi ;\
fi ;\
$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) CC=$$CC modules