# Makefile for C++ Rserve clients.

SRC = Rcgi.cc Rconnection.cc
OBJ = $(SRC:%.cc=%.o)
DST = Rcgi
CC=gcc
CXX=g++ -std=gnu++14

LIBS=-lcrypt  $(PKG_LIBS)
CPPFLAGS=-DHAVE_CONFIG_H -I. $(PKG_CPPFLAGS)
CFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g
CXXFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g

all: $(DST)

Rcgi: Rconnection.o Rcgi.o
	$(CXX) $^ -o $@ $(LIBS)

debug:
	$(MAKE) CXXFLAGS=-g all

clean:
	rm -rf *~ *.o \#* .\#* $(DST)
