mirror of
https://github.com/fail0verflow/mini.git
synced 2025-02-20 05:22:42 +01:00
add git version numbers for ccat and MINI
This commit is contained in:
parent
48109e684b
commit
6c08b4b5be
7
Makefile
7
Makefile
@ -19,15 +19,20 @@ include ../../common.mk
|
|||||||
|
|
||||||
all: $(TARGET_BIN)
|
all: $(TARGET_BIN)
|
||||||
|
|
||||||
|
main.o: main.c git_version.h
|
||||||
|
|
||||||
$(TARGET_BIN): $(TARGET) $(ELFLOADER)
|
$(TARGET_BIN): $(TARGET) $(ELFLOADER)
|
||||||
@echo "MAKEBIN $@"
|
@echo "MAKEBIN $@"
|
||||||
@$(MAKEBIN) $(ELFLOADER) $< $@
|
@$(MAKEBIN) $(ELFLOADER) $< $@
|
||||||
|
|
||||||
upload: $(TARGET_BIN)
|
upload: $(TARGET_BIN)
|
||||||
@$(WIIDEV)/bin/bootmii -a $<
|
@$(WIIDEV)/bin/bootmii -a $<
|
||||||
|
|
||||||
|
git_version.h:
|
||||||
|
echo 'const char git_version[] = "'`./describesimple.sh`'";' > git_version.h
|
||||||
|
|
||||||
clean: myclean
|
clean: myclean
|
||||||
|
|
||||||
myclean:
|
myclean:
|
||||||
-rm -f $(TARGET_BIN)
|
-rm -f $(TARGET_BIN) git_version.h
|
||||||
|
|
||||||
|
17
describesimple.sh
Executable file
17
describesimple.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check for git and a git repo.
|
||||||
|
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
||||||
|
comm=`git log --pretty=oneline -n1 ../mini | awk ' { print $1 }'`
|
||||||
|
if tagver=`git describe --exact-match --match bootmii-\* $comm 2>/dev/null`; then
|
||||||
|
printf "%s" "BootMii v"`printf "%s" $tagver | awk '{ sub (/bootmii-/, ""); print;}'`
|
||||||
|
else
|
||||||
|
printf "%s" ""`printf "%s" \`git describe --abbrev=4 --match bootmii-\* $comm | awk '{ sub (/bootmii-/, ""); print;}'\``
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Are there uncommitted changes?
|
||||||
|
git update-index --refresh --unmerged > /dev/null
|
||||||
|
git diff-index --quiet HEAD ../mini || printf "%s" '*'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
3
main.c
3
main.c
@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "nand.h"
|
#include "nand.h"
|
||||||
#include "boot2.h"
|
#include "boot2.h"
|
||||||
|
#include "git_version.h"
|
||||||
|
|
||||||
#define PPC_BOOT_FILE "/bootmii/ppcboot.elf"
|
#define PPC_BOOT_FILE "/bootmii/ppcboot.elf"
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ u32 _main(void *base)
|
|||||||
(void)base;
|
(void)base;
|
||||||
|
|
||||||
gecko_init();
|
gecko_init();
|
||||||
gecko_printf("mini v0.2 loading\n");
|
gecko_printf("mini v0.2 (%s) loading\n", git_version);
|
||||||
|
|
||||||
gecko_printf("Initializing exceptions...\n");
|
gecko_printf("Initializing exceptions...\n");
|
||||||
exception_initialize();
|
exception_initialize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user