pkg target and some improvements added
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Thu, 31 Mar 2011 13:35:25 +0000 (15:35 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Thu, 31 Mar 2011 13:35:25 +0000 (15:35 +0200)
makefile

index 5fe3e27..d605310 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,17 +1,24 @@
 #
 #  Project #PRJNAME#
 #
+
+VER=0.0.1
 EXE=#PRJNAME#
 OBJ=#PRJNAME#.o
+PKGNAME=#PRJNAME#
+TARGET=$(EXE)
 
 CC?=gcc
 
-ALL: #PRJNAME#
+ALL: $(TARGET)
 
 #PRJNAME#: #PRJNAME#.c #PRJNAME#.h
-       $(CC) -o #PRJNAME# #PRJNAME#.c
+       $(CC) -o $@ $<
 
 clean:
-       rm -f $(EXE) $(OBJ) *~
+        rm -f $(EXE) $(OBJ) *~ $(TARGET)
+
+pkg:
+        tar -zcv --transform="s,^,$(PKGNAME)-$(VER)/,"  -f ../$(PKGNAME)_$(VER).tgz *
 
-.PHONY: clean ALL
+.PHONY: clean pkg ALL