summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-03 00:13:46 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-03 00:13:46 +0000
commitef91aac6887e82b77ca3dff8bcffaffab0a8ec08 (patch)
tree6f6db2314ca66fe045b4df3aec7f60464f2bece7 /Makefile
parenta6d3594d395a61cfab97a69ebcf85bff71875f2f (diff)
Add profiling. Also some trivial optimisations to skip memcpying.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0e8ed49a..d953f085 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 2007-10-01 14:53:29 nicm Exp $
+# $Id: Makefile,v 1.10 2007-10-03 00:13:46 nicm Exp $
.SUFFIXES: .c .o .y .h
.PHONY: clean
@@ -25,6 +25,11 @@ YACC= yacc -d
CC= cc
INCDIRS+= -I. -I- -I/usr/local/include
CFLAGS+= -DBUILD="\"$(VERSION) ($(DATE))\"" -DMETA="'${META}'"
+.ifdef PROFILE
+# Don't use ccache
+CC= /usr/bin/gcc
+CFLAGS+= -pg -DPROFILE -O0
+.endif
.ifdef DEBUG
CFLAGS+= -g -ggdb -DDEBUG
LDFLAGS+= -Wl,-E
@@ -40,6 +45,9 @@ INSTALLBIN= install -g bin -o root -m 555
INSTALLMAN= install -g bin -o root -m 444
LDFLAGS+= -L/usr/local/lib
+.ifdef PROFILE
+LDFLAGS+= -pg
+.endif
LIBS+= -lutil -lncurses
OBJS= ${SRCS:S/.c/.o/:S/.y/.o/}