diff options
Diffstat (limited to 'openpicc')
-rw-r--r-- | openpicc/Makefile | 7 | ||||
-rwxr-xr-x | openpicc/scripts/mkcompile_h | 24 |
2 files changed, 29 insertions, 2 deletions
diff --git a/openpicc/Makefile b/openpicc/Makefile index d3faac0..9070422 100644 --- a/openpicc/Makefile +++ b/openpicc/Makefile @@ -118,11 +118,14 @@ $(DEMO_APP_THMUB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h $(FREERTOS_THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@ -$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h +$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h config/board.h config/compile.h $(CC) -c $(CFLAGS) $< -o $@ clean : touch Makefile find -name '*.o' -exec rm \{\} \; - rm -f openpicc.bin openpicc.elf openpicc.map openpicc.asm + rm -f openpicc.bin openpicc.elf openpicc.map openpicc.asm config/compile.h +.PHONY: config/compile.h +config/compile.h: + scripts/mkcompile_h > config/compile.h diff --git a/openpicc/scripts/mkcompile_h b/openpicc/scripts/mkcompile_h new file mode 100755 index 0000000..22ac262 --- /dev/null +++ b/openpicc/scripts/mkcompile_h @@ -0,0 +1,24 @@ +#!/bin/sh + +MAX_LEN=32 +TRUNCATE="sed -e s/\(.\{1,$MAX_LEN\}\).*/\1/" + +DATE=`LC_ALL=C LANG=C date +%Y%m%d-%H%M%S` +BY=`whoami` +HOST=`hostname | $TRUNCATE` +BYHOST=`echo ${BY}@${HOST} | $TRUNCATE` +SVNREV=`svn info | grep \^Revision: | cut -c 11-` + +svn st | grep \^M >/dev/null + +[ "$?" -eq "0" ] && SVNREV=${SVNREV}-unclean + +echo "#ifndef _COMPILE_H" +echo "#define _COMPILE_H" +echo +echo /\* This file is auto generated \*/ +echo \#define COMPILE_DATE \"${DATE}\" +echo \#define COMPILE_BY \"${BYHOST}\" +echo \#define COMPILE_SVNREV \"${SVNREV}\" +echo +echo "#endif /* _COMPILE_H */" |