build system: add a target dist to makefile

Generate a tarbal for wmfs with make dist
Version set to date +%Y%m in setlocalversion

Move .PHONY BEFORE phony targets

Signed-off-by: Philippe Pepiot <phil@philpep.org>
This commit is contained in:
Philippe Pepiot 2011-04-16 21:36:27 +02:00
parent e57a6c5e62
commit 12aa86e914
2 changed files with 8 additions and 4 deletions

View File

@ -48,13 +48,14 @@ ${MAN}.gz: ${MAN}
.c.o:
${CC} -c ${CFLAGS} $< -o $@
.PHONY: all clean distclean install uninstall dist
clean:
rm -f ${OBJS} wmfs ${MAN}.gz
distclean: clean
rm -f Makefile
install: all
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}${PREFIX}/bin
@ -80,7 +81,7 @@ uninstall:
rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfs/wmfsrc
rmdir ${DESTDIR}${XDG_CONFIG_DIR}/wmfs/
.PHONY: all clean distclean install uninstall
dist:
@echo "Generate wmfs-`date +%Y%m`.tar.gz"
git archive --format=tar --prefix=wmfs-`date +%Y%m`/ master | gzip -c > wmfs-`date +%Y%m`.tar.gz

View File

@ -70,3 +70,6 @@ if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then
# All done with svn
exit
fi
# default version
printf -- '-%s' "`date +%Y%m`"