Skip to content

Commit e80aa74

Browse files
author
Jiang Xin
committedDec 9, 2010
commit G.
Signed-off-by: Jiang Xin <jiangxin@ossxp.com>
0 parents  commit e80aa74

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed
 

‎README

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DEMO program for git-scm-book.
Has conversations. Original line has conversations.
2+
3+
Changes
4+
=======
5+
6+
* create node G.
7+
* initialized.

‎doc/G.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2010年 12月 09日 星期四 13:45:52 CST

‎src/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.o
2+
hello
3+
version.h

‎src/Makefile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
OBJECTS = main.o
2+
TARGET = hello
3+
4+
all: $(TARGET)
5+
6+
$(TARGET): $(OBJECTS)
7+
$(CC) -o $@ $^
8+
9+
main.o: version.h
10+
11+
version.h: new_header
12+
13+
new_header:
14+
@sed -e "s/<version>/$$(git describe)/g" < version.h.in > version.h.tmp
15+
@if diff -q version.h.tmp version.h >/dev/null 2>&1; then \
16+
rm version.h.tmp; \
17+
else \
18+
echo "version.h.in => version.h" ; \
19+
mv version.h.tmp version.h; \
20+
fi
21+
22+
clean:
23+
rm -f $(TARGET) $(OBJECTS) version.h
24+
25+
.PHONY: all clean
26+
27+
# vim: noet

‎src/main.c

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "version.h"
2+
#include <stdio.h>
3+
4+
int
5+
main()
6+
{
7+
printf( "Hello, world.\n" );
8+
printf( "version: %s.\n", _VERSION );
9+
return 0;
10+
}

‎src/version.h.in

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef HELLO_WORLD_VERSION_H
2+
#define HELLO_WORLD_VERSION_H
3+
4+
#define _VERSION "<version>"
5+
6+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.