aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 579cd8a..1428b75 100644
--- a/Makefile
+++ b/Makefile
@@ -3,12 +3,19 @@ LIBCFLAGS =-c -fPIC -DBROCCOLI
CFLAGS =-c -DBROCCOLI
INC =-I/usr/local/include -I/usr/local/include -I./includes
LDFLAGS = -L/usr/local/lib -lbroccoli -pthread
-DEBUG =
SRC = midbro.c broevent.c fifoqueue.c
OBJ = $(patsubst %.c, build/%.o, $(SRC))
PREFIX = $(DESTDIR)/usr/local
+ifneq ($(DEBUG), 1)
+ CFLAGS += -O2
+ CPPFLAGS += -DNDEBUG
+else
+ CFLAGS += -g
+ CPPFLAGS += -DDEBUG
+endif
+
.PHONY: all dirs clean install uninstall lib/midbro bin/tests
all: dirs lib/midbro
@@ -23,7 +30,7 @@ midbro_test:
$(CC) test/midbro_test.c -I./includes -o bin/midbro_test -L./lib -lmidbro
build/%.o: src/%.c
- $(CC) $(LIBCFLAGS) $(DEBUG) $(INC) $< -o $@
+ $(CC) $(LIBCFLAGS) $(INC) $< -o $@
bin/tests: build/fifoqueue.o build/tests.o
$(CC) $^ -o bin/tests $(LDFLAGS)