Makefile: -O3 and debug build

Build standard builds with -O3.
Add a "debug" target with -Og and asan.

Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9
This commit is contained in:
Jenda 2018-07-30 21:41:08 +02:00
parent 9514389ef5
commit 05fa2d54bb
1 changed files with 5 additions and 1 deletions

View File

@ -1,8 +1,12 @@
CFLAGS=-g -O0 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I.
CFLAGS=-g -O3 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I.
LDLIBS=`pkg-config --libs libosmocore 2> /dev/null` -losmocore
all: conv_enc_test crc_test tetra-rx float_to_bits tunctl
debug: CFLAGS := -lasan $(CFLAGS) -fsanitize=address -fno-omit-frame-pointer -g -Og
debug: LDLIBS := -lasan $(LDLIBS)
debug: all
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@