redmine

revisioning added

# dynamical headers:
revision.h
# objects:
*.o
... ...
... ... @@ -24,18 +24,21 @@ binary=clsync
binarydebug=$(binary)-debug
all: $(objs)
all: updaterevision $(objs)
$(CC) $(NORMSYSTEMCFLAGS) $(CFLAGS) $(LDFLAGS) $(objs) -o $(binary)
%.o: %.c
$(CC) $(NORMSYSTEMCFLAGS) $(CFLAGS) $(INC) $< -c -o $@
debug:
debug: updaterevision
$(CC) $(NORMSYSTEMCFLAGS) -DFANOTIFY_SUPPORT $(DEBUGCFLAGS) $(INC) $(LDFLAGS) *.c -o $(binarydebug)
onoldsystem:
onoldsystem: updaterevision
$(CC) $(OLDSYSTEMCFLAGS) $(CFLAGS) $(INC) $(LDFLAGS) *.c -o $(binary)
updaterevision:
(echo -n '#define REVISION '; git log | grep -c ^commit) > revision.h
clean:
rm -f $(binary) $(binarydebug) $(objs)
rm -rf example/testdir example/rules
... ...
... ... @@ -27,6 +27,7 @@
#define VERSION_MAJ 0
#define VERSION_MIN 0
#include "revision.h"
#include <stdio.h>
#include <stdlib.h>
... ...
... ... @@ -57,7 +57,7 @@ int syntax() {
}
int version() {
printf("clsync v%i.%i\n\t"AUTHOR"\n", VERSION_MAJ, VERSION_MIN);
printf("clsync v%i.%i.%i\n\t"AUTHOR"\n", VERSION_MAJ, VERSION_MIN, REVISION);
exit(0);
}
... ...