lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


 * Fixed incorrect version string in library.

 * Compiles with -O2 rather than no optimization.

 * Added 'debug' target.  This may not work for non-GNU makes.

Signed-off-by: David Favro <lua@meta-dynamic.com>
---
 Makefile |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index ba7b0e4..f23b03d 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ PACKAGE=	luaposix
 LIBVERSION=	11
 RELEASE=	$(LUAVERSION).$(LIBVERSION)
 
-GIT_REV		:= $(shell test -d .git && git describe --always)
+GIT_REV		:= $(shell test -d .git && git describe --tag --always)
 ifeq ($(GIT_REV),)
 FULL_VERSION	:= $(RELEASE)
 else
@@ -25,7 +25,8 @@ endif
 
 WARN=		-pedantic -Wall
 INCS=		-I$(LUAINC)
-CFLAGS+=	-fPIC $(INCS) $(WARN) -DVERSION=\"$(FULL_VERSION)\"
+OPTFLAGS:=	-O2
+CFLAGS+=	-fPIC $(INCS) $(WARN) -DVERSION=\"$(FULL_VERSION)\" $(OPTFLAGS)
 
 MYNAME=		posix
 MYLIB= 		$(MYNAME)
@@ -61,6 +62,10 @@ tree:	$T
 clean:
 	rm -f $(OBJS) $T core core.* a.out $(TARGZ)
 
+debug:
+	# The --no-print-directory option is non-POSIX, works with GNU make.
+	@$(MAKE) --no-print-directory "OPTFLAGS=-g"
+
 install: $T
 	$(INSTALL) -d $(DESTDIR)/$(LUALIB)
 	$(INSTALL) $T $(DESTDIR)/$(LUALIB)/$T
-- 
1.7.0.4