summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-25 05:47:08 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:31:33 +0200
commite1c831a43ac1945db5a52ee6873856b9399dca76 (patch)
treebea8e7dd5459714c2f010e3267ba0e28c934dddc /Makefile
parentca8277c6f507e54a043b84a8df9c55ac39a83c6e (diff)
Add a PROFILE mode
* Makefile: Change FOOFLAGS defaults to appropriate values when $(PROFILE) is defined. * rootdir.c: Add an "exit" file, which causes exit to be called when looked up, so that profiling data can be written to disk.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b8c055f..a397522 100644
--- a/Makefile
+++ b/Makefile
@@ -6,13 +6,21 @@ LIBS = -lnetfs -lps
CC = gcc
CFLAGS = -Wall -g
CPPFLAGS =
+LDFLAGS =
+
+ifdef PROFILE
+CFLAGS= -g -pg
+CPPFLAGS= -DPROFILE
+LDFLAGS= -static
+LIBS= -lnetfs -lfshelp -liohelp -lps -lports -lthreads -lihash -lshouldbeinlibc
+endif
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
all: $(TARGET)
$(TARGET): $(OBJS)
- $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
clean:
$(RM) $(TARGET) $(OBJS)