diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | common.mk | 2 | ||||
-rw-r--r-- | flash_erase.c | 1 | ||||
-rw-r--r-- | include/common.h | 1 | ||||
-rw-r--r-- | nanddump.c | 1 | ||||
-rw-r--r-- | nandwrite.c | 1 |
7 files changed, 13 insertions, 4 deletions
@@ -50,6 +50,7 @@ # # Generated include files # +/include/version.h # stgit generated dirs patches-* @@ -1,6 +1,8 @@ # -*- sh -*- +VERSION = 1.4.5 + CPPFLAGS += -I./include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) ifeq ($(WITHOUT_XATTR), 1) @@ -36,6 +38,8 @@ TARGETS = $(BINS) TARGETS += lib/libmtd.a TARGETS += ubi-utils/libubi.a +OBJDEPS = $(BUILDDIR)/include/version.h + include common.mk clean:: @@ -49,6 +53,7 @@ endif find $(BUILDDIR)/ -xdev \ '(' -name '*.[ao]' -o -name '.*.c.dep' ')' \ -exec rm -f {} + + rm -f $(BUILDDIR)/include/version.h $(MAKE) -C $(TESTS) clean install:: ${BINS} ${SCRIPTS} @@ -63,6 +68,11 @@ tests:: cscope: cscope -bR +$(BUILDDIR)/include/version.h: $(BUILDDIR)/include/version.h.tmp + $(Q)cmp -s $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@ +$(BUILDDIR)/include/version.h.tmp: + $(Q)echo '#define VERSION "$(VERSION)"' > $@ + # # Utils in top level # @@ -75,7 +75,7 @@ $(BUILDDIR)/%.a: $(Q)$(AR) cr $@ $^ $(Q)$(RANLIB) $@ -$(BUILDDIR)/%.o: %.c +$(BUILDDIR)/%.o: %.c $(OBJDEPS) ifneq ($(BUILDDIR),$(CURDIR)) $(Q)mkdir -p $(dir $@) endif diff --git a/flash_erase.c b/flash_erase.c index e0d2d4c..220f85a 100644 --- a/flash_erase.c +++ b/flash_erase.c @@ -19,7 +19,6 @@ */ #define PROGRAM_NAME "flash_erase" -#define VERSION "2.1.0" #include <inttypes.h> #include <stdio.h> diff --git a/include/common.h b/include/common.h index 7ea282c..65ec086 100644 --- a/include/common.h +++ b/include/common.h @@ -25,6 +25,7 @@ #include <string.h> #include <fcntl.h> #include <errno.h> +#include "version.h" #ifndef PROGRAM_NAME # error "You must define PROGRAM_NAME before including this header" @@ -14,7 +14,6 @@ */ #define PROGRAM_NAME "nanddump" -#define VERSION "1.31" #define _GNU_SOURCE #include <ctype.h> diff --git a/nandwrite.c b/nandwrite.c index 6e986c5..1700d61 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -20,7 +20,6 @@ */ #define PROGRAM_NAME "nandwrite" -#define VERSION "$Revision: 1.32 $" #define _GNU_SOURCE #include <ctype.h> |