diff options
Diffstat (limited to 'driver/Makefile')
-rw-r--r-- | driver/Makefile | 8 |
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 |