Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
DEBUG?= -g -ggdb
CFLAGS?= -O2 -Wall -W -std=c99
LDFLAGS= -lm

# Uncomment the following two lines for coverage testing
#
# CFLAGS+=-fprofile-arcs -ftest-coverage
# LDFLAGS+=-lgcov
# if DEBUG env var is set, we compile with "debug" cflags
ifeq ($(DEBUG),1)
CFLAGS += -g -ggdb -fno-omit-frame-pointer
LDFLAGS += -g -ggdb
endif

# if COV env var is set, we compile with "coverage" cflags
ifeq ($(COV),1)
CFLAGS+=-fprofile-arcs -ftest-coverage
LDFLAGS+=-lgcov
endif

all: rax-test rax-oom-test

Expand All @@ -14,13 +20,13 @@ rax-test.o: rax.h
rax-oom-test.o: rax.h

rax-test: rax-test.o rax.o rc4rand.o crc16.o
$(CC) -o $@ $^ $(LDFLAGS) $(DEBUG)
$(CC) -o $@ $^ $(LDFLAGS)

rax-oom-test: rax-oom-test.o rax.o
$(CC) -o $@ $^ $(LDFLAGS) $(DEBUG)
$(CC) -o $@ $^ $(LDFLAGS)

.c.o:
$(CC) -c $(CFLAGS) $(DEBUG) $<
$(CC) -c $(CFLAGS) $<

clean:
rm -f rax-test rax-oom-test *.gcda *.gcov *.gcno *.o