Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
commit G.
Signed-off-by: Jiang Xin <jiangxin@ossxp.com>
  • Loading branch information
Jiang Xin committed Dec 9, 2010
0 parents commit e80aa74
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README
@@ -0,0 +1,7 @@
DEMO program for git-scm-book.

This comment has been minimized.

Copy link
@ossxp-com

ossxp-com Feb 22, 2011

Collaborator

Now the book calls "Got Git".

This comment has been minimized.

Copy link
@tujianglin

tujianglin Oct 30, 2023

123


Changes
=======

* create node G.
* initialized.
1 change: 1 addition & 0 deletions doc/G.txt
@@ -0,0 +1 @@
2010年 12月 09日 星期四 13:45:52 CST
3 changes: 3 additions & 0 deletions src/.gitignore
@@ -0,0 +1,3 @@
*.o
hello
version.h
27 changes: 27 additions & 0 deletions src/Makefile
@@ -0,0 +1,27 @@
OBJECTS = main.o
TARGET = hello

all: $(TARGET)

$(TARGET): $(OBJECTS)
$(CC) -o $@ $^

main.o: version.h

version.h: new_header

new_header:
@sed -e "s/<version>/$$(git describe)/g" < version.h.in > version.h.tmp
@if diff -q version.h.tmp version.h >/dev/null 2>&1; then \
rm version.h.tmp; \
else \
echo "version.h.in => version.h" ; \
mv version.h.tmp version.h; \
fi

clean:
rm -f $(TARGET) $(OBJECTS) version.h

.PHONY: all clean

# vim: noet
10 changes: 10 additions & 0 deletions src/main.c
@@ -0,0 +1,10 @@
#include "version.h"
#include <stdio.h>

int
main()
{
printf( "Hello, world.\n" );
printf( "version: %s.\n", _VERSION );
return 0;
}
6 changes: 6 additions & 0 deletions src/version.h.in
@@ -0,0 +1,6 @@
#ifndef HELLO_WORLD_VERSION_H
#define HELLO_WORLD_VERSION_H

#define _VERSION "<version>"

#endif

0 comments on commit e80aa74

Please sign in to comment.