mirror of
https://github.com/ggrandou/abootimg.git
synced 2024-11-23 09:53:32 +08:00
Fix version.h creation.
Only create version.h if file not present and only try to read git version if .git present.
This commit is contained in:
parent
f8525d5c9e
commit
63ad881fac
12
Makefile
12
Makefile
@ -1,8 +1,16 @@
|
|||||||
|
|
||||||
all: abootimg
|
all: abootimg
|
||||||
|
|
||||||
abootimg: abootimg.c bootimg.h
|
version.h:
|
||||||
echo '#define VERSION_STR "$(shell git describe --tags --abbrev=0)"' > version.h
|
if [ ! -f version.h ]; then \
|
||||||
|
if [ -d .git ]; then \
|
||||||
|
echo '#define VERSION_STR "$(shell git describe --tags --abbrev=0)"' > version.h; \
|
||||||
|
else \
|
||||||
|
echo '#define VERSION_STR ""' > version.h; \
|
||||||
|
fi \
|
||||||
|
fi
|
||||||
|
|
||||||
|
abootimg: abootimg.c bootimg.h version.h
|
||||||
gcc -g -O2 -Wno-unused-result -o abootimg abootimg.c -DHAS_BLKID -lblkid
|
gcc -g -O2 -Wno-unused-result -o abootimg abootimg.c -DHAS_BLKID -lblkid
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user