Added support for dynamic versioning; added gitignore for bin directory.

This commit is contained in:
Brett Weir 2015-02-08 11:30:29 -08:00
parent f905a46461
commit 3834573f5e
3 changed files with 11 additions and 2 deletions

2
.gitignore vendored
View File

@ -27,3 +27,5 @@
*.i*86
*.x86_64
*.hex
bin/

View File

@ -11,6 +11,13 @@ $(OBJDIR)/ploader.o
OS?=macosx
VERSION := $(shell git describe --tags --long 2>/dev/null)
ifeq ($(VERSION),)
VERSION := '0.0.0'
endif
CFLAGS += -D'VERSION="$(VERSION)"'
ifeq ($(OS),linux)
CFLAGS+=-DLINUX
EXT=

View File

@ -276,7 +276,7 @@ int main(int argc, char *argv[])
static void Usage(void)
{
printf("\
p1load - a simple loader for the propeller - version 0.010, 2015-02-08\n\
p1load - a simple loader for the propeller - v%s, %s\n\
usage: p1load\n\
[ -b baud ] baud rate (default is %d)\n\
[ -D var=val ] set variable value\n\
@ -288,7 +288,7 @@ usage: p1load\n\
[ -T ] enter PST-compatible terminal mode\n\
[ -v ] verbose output\n\
[ -? ] display a usage message and exit\n\
file file to load\n", BAUD_RATE);
file file to load\n", VERSION, __DATE__, BAUD_RATE);
#ifdef RASPBERRY_PI
printf("\
\n\