# Misc. options, depending on the SETTINGS file

ifeq ($(DEBUG_LEVEL),profile)
    DEBUG_FLAGS=-pg -DPROFILE -DDEBUG
    PROFILE_LD_FLAGS=-pg
    OPTIM_LEVEL=debug
    CIAODEBUG=-debug
    OPTIM_FLAGS=
endif


# Optimizations for LINUX 386

ifeq ($(OPTIM_LEVEL),optimized)
    OPTIM_FLAGS=-O2 -Wall $(shell $(SYSDEP_FILES)/gcc_m_or_f_options)
endif


# Threads and locks in LINUX
ifeq ($(USE_THREADS),yes)
    LD_THREAD_LIB=-lpthread
    LD_LOCK_LIB=
ifeq ($(USE_POSIX_LOCKS),yes)
    THREAD_FLAG=-D_REENTRANT -DTHREADS
else
    THREAD_FLAG=-D_REENTRANT -DTHREADS
endif
else
    LD_THREAD_LIB=
    THREAD_FLAG=
endif

FOREIGN_FILES_FLAG=-DFOREIGN_FILES

# C compiler
CC=gcc

# Linker
LD=ld

# C compiler options for generating shared libraries code
CCSHARED=-fPIC

# Linker options for shared objects
LDSHARED=-shared

# Linker options to combine objects
LDCOMBINE=-r

# Include path at compile time
LDRPATH=-rpath

# Name of the standard ciao library
CIAOLIBNAME=libciao.so

LIBS=-lm $(LD_THREAD_LIB) $(LD_LOCK_LIB) $(DEBUG_LIBS)

# LINUX linker specific options
# "-rdynamic" allows the dynamic libraries symbols to be resolved against
# those defined in ciaoengine

LDFLAGS=-rdynamic $(PROFILE_LD_FLAGS)

STAT_LIBS=

ARCHNAME=i86

# Operating system version
OSNAME=LINUX

# How to install an make directories
MKDIR="mkdir -p"
INSTALL=install

# Making etags
ETAGS=etags -t *.[ch]

DEFAULTYPE=dyn
