Browse files

More useful compiler flags.

Make the default to build with optimizations. Add a "make debug"
target for building with debugging symbols.
  • Loading branch information...
Keith Rarick
Keith Rarick committed Oct 16, 2007
1 parent be1e525 commit 4e1fa218047146d0e577cdee498bb8a8ed898473
Showing with 9 additions and 4 deletions.
  1. +9 −4 Makefile
@@ -1,14 +1,19 @@
program := beanstalkd
-export CFLAGS := -g -pg -Wall -Werror
-#export CFLAGS := -O2 -Wall -Werror
-export LDFLAGS := -pg -levent
+export CFLAGS := -O2 -Wall -Werror
+export LDFLAGS := -levent
sources := $(shell ls *.c | fgrep -v $(program))
objects := $(sources:.c=.o)
tests := $(sources:%=tests/test_%)
all: $(program)
+debug: export CFLAGS := -g -pg -Wall -Werror
+debug: export LDFLAGS := -pg -levent
+debug: all
+check: export CFLAGS := -g -pg -Wall -Werror
+debug: export LDFLAGS := -pg -levent
check: tests/cutcheck $(objects)
@@ -28,7 +33,7 @@ clean:
rm -f $(program) *.o .*.d tests/*.o tests/cutcheck* core gmon.out
-.PHONY: all check clean
+.PHONY: all debug check clean
# This tells make how to generate dependency files
.%.d: %.c

0 comments on commit 4e1fa21

Please sign in to comment.