# $Id$

PROJNAME = csbase
APPNAME  = sgad

# Com a definição de WITH_LUA, não é necessário compilar os arquivos .lua
DEFINES = WITH_LUA
#SRCLUA = verbose.lua \
#         lib/shellExtension.lua \
#         sga-daemon.lua   \
#         sga-services.lua \
#         sga-command.lua  \
#         main.lua

OILLIB=${OILDIR}/lib/${TEC_UNAME}
LUASOCKET2LIB=${LUASOCKET2DIR}/lib/${TEC_UNAME}

INCLUDES += . ${OILINC} ${LUASOCKET2INC}
LDIR += ${OILLIB} ${LUASOCKET2LIB}

SRC = sgad.cpp
EXPCFG = sgad-cnf.lua sgad-cnfavc.lua sga-daemon

ifeq "$(TEC_SYSNAME)" "Win32"
  APPTYPE=console

  SRC += lib/Windows.cpp
  LIBS += oilall luasocket wsock32
else
  SLIB += $(OILLIB)/liboilall.a $(LUASOCKET2LIB)/libluasocket.a
# LIBS += oilall luasocket
  LIBS += dl
  SRC += lib/Unix.cpp
endif

ifeq "$(TEC_SYSNAME)" "Linux"
  LFLAGS += -static
endif

ifeq "$(TEC_UNAME)" "IRIX6465"
#   CPPC = CC
#   STDFLAGS = -LANG:std -OPT:Olimit_opt=on -G 4 -LANG:ansi-for-init-scope -woff 1682,1110,1116,1014,1681 
endif

ifeq "$(TEC_UNAME)" "AIX43"
  CFLAGS += -g
#  LDIR += $(GCC_EXEC_PREFIX)
#  LFLAGS += -Wl,-brtl,-bbigtoc
#  LFLAGS += -Bstatic
endif

ifeq "$(TEC_SYSNAME)" "SunOS"
  LIBS += socket nsl
  LFLAGS += -static-libgcc
endif

ifeq "$(CC)" "g++"
   CPPFLAGS += -ftemplate-depth-42 -fpermissive $(INCS) 
endif

USE_RCS = Yes
USE_LUA51 = Yes
USE_STATIC = Yes
