#!/usr/bin/sh
# Copyright(c)'1994-2009 by The Givaro group
# This file is part of Givaro.
# Givaro is governed by the CeCILL-B license under French law
# and abiding by the rules of distribution of free software. 
# see the COPYRIGHT file for more details.


prefix=/usr
exec_prefix=/usr
includedir=/usr/include
libdir=/usr/lib64

CXX = g++
AR  = ar

OPTFLAGS = -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   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer     
GMP_CFLAGS = 
GMP_LIBS   =  -lgmp -lgmpxx

GIVARO_CXXFLAGS = -I${includedir}
GIVARO_LIBDIR = -L${libdir}
GIVARO_LIBS = -lgivaro 

CXXFLAGS += ${OPTFLAGS} 

CXXFLAGS += ${GIVARO_CXXFLAGS} ${GMP_CFLAGS}
LDFLAGS += ${GIVARO_LIBDIR} ${GMP_LIBDIR}
LOADLIBES += ${GIVARO_LIBS} ${GMP_LIBS}

LOADLIBES += ${OPTLIBES}

.SUFFIXES: .o .C .cpp

.C.o:
	${CXX} ${CXXFLAGS} -o $@ -c $<  

.cpp.o:
	${CXX} ${CXXFLAGS} -o $@ -c $<  

.C:
	${CXX} ${CXXFLAGS} $(LDFLAGS) -o $@ $<  $(LOADLIBES)

.cpp:
	${CXX} ${CXXFLAGS} $(LDFLAGS) -o $@ $<  $(LOADLIBES)
