
CC=gcc

CFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v3 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2   

# for local development
#CFLAGS=$(CFLAGS) -fdiagnostics-color=always

SHAREDFLAGS=@SHAREDFLAGS@

DBLIBS=-L/usr/lib64/mysql -lmysqlclient -lz  -lzstd  -lssl  -lcrypto -lresolv -lm

DBFLAGS=-I/usr/include/mysql -m64 

TESTLIBS=-lcheck -lsubunit -lm -lrt -lpthread

DEFINITIONS=-DTESTING


test: test.c test-bootstrap.c ../src/ndo.c
	$(CC) $(CFLAGS) $(DBFLAGS) $^ -o $@ $(DEFINITIONS) $(DBLIBS) $(TESTLIBS)
