Skip to content

Instantly share code, notes, and snippets.

@nodakai
Created November 30, 2015 11:31
Show Gist options
  • Select an option

  • Save nodakai/35d41d1ab8d10b0915d6 to your computer and use it in GitHub Desktop.

Select an option

Save nodakai/35d41d1ab8d10b0915d6 to your computer and use it in GitHub Desktop.
.PHONY: all clean force
all : app
app : aux.o main.o
$(CC) -o $@ $^
VPATH=a/aux
aux.o : aux.c
main.o : main.c version.h
version.h : force
( export LANG=C; \
echo -n 'const char VERSION[] = "'; \
{ \
svn info; \
svn status | grep -v '^?'; \
} | tr \\n @ | sed -e s/@/\\\\n/g ; \
echo '";'; \
) > $@.tmp
cmp -s $@.tmp $@ || mv $@.tmp $@
force:
clean:
rm -f *.o version.h{,.tmp}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment