## Copyright (c) 1999 Tano Fotang.
## See the file COPYING for info.
##
## make sure guile-config and gtk-config are in the right places.
##
## You may need to change some of the settings in this file.
## There's no autoconf.

CC=gcc
BIN	= sula
# any additional compiler options (include directories etc)
DEFS	= -g -Wall  -DDEBUG -D_GNU_SOURCE -DMUTABLE_IRC 
# any additional linker options
LDFLAGS = -s

#########################################################################
## - Choose an extension language -
## Guile: You require at least guile 1.3.1.
EXTLANG	= GUILE
GUILE_FLAGS=$(shell guile-config compile)
GUILE_LIBS=$(shell guile-config link)

###################################################################
## choose a GUI toolkit. Default: GTK
##
#WIDGET_SET= xforms
##

ifeq ($(WIDGET_SET),xforms)
# XF_LIB_DIR:		location of libforms.*
# XF_INCLUDE_DIR:	location of forms.h
# Skip this if xforms was installed in a
# standard location (/usr/{local, lib, X11, include}...).

#	XF_LIB		= -L/home/tano/work/src/xforms/xforms/FORMS
#	XF_INC		= -I/home/tano/work/src/xforms/xforms/FORMS
else
# GTK stuff.
# Please make sure the correct version of gtk-config lies along $PATH.
	WIDGET_LIB_DIR 	= $(shell gtk-config --libs)
	WIDGET_INCLUDE_DIR	= $(shell gtk-config --cflags)
endif
##################################################################
# there's no manpage :P
MAN_DIR = /usr/local/man
BINMODE = u=rwx,go=rx

# LIB_DIR:
# This is where help files etc will be installed. However,
# program will search only in the directory specified either in an X
# resource file, or by using the SET command. LIB_DIR will be the default.
# See *.Libdir set in sula.app-defaults or use cmdline option -libdir.
LIB_DIR=/usr/local/lib/sula

# where to install binary
BIN_DIR = /usr/local/bin
# where to install any documentation
DOCS_DIR = /usr/local/doc

# System-wide X resource directory. /usr/lib/X11/app-defaults is the
# standard. See man X.
RESOURCE_DIR =  /usr/lib/X11/app-defaults

# directory; program files (~/P_HOME)
P_HOME=.sula

# program initialisation. this one is an executable program. forget it.
P_SULARC=.sularc

# BUILD_DYNAMIC = yes or  no
# Choose to either statically link program, or build a dynamic
# version. I cant build a static version with GTK support.
# Ignore this useless option.
#BUILD_DYNAMIC=yes

#-- you may stop here --

ifeq ($(WIDGET_SET),xforms)
	ifeq ($(BUILD_DYNAMIC),no)
		WIDGET_LIB_DIR 	= $(XF_LIB) -static -lforms -dynamic -lXpm
	else
		WIDGET_LIB_DIR 	= $(XF_LIB) -lforms -lXpm
	endif
	WIDGET_INCLUDE_DIR	= $(XF_INC)
	CCCFLAG = -DUSE_XFORMS
	WIDGET_DEP_LIB=gui_xforms
else
	WIDGET_DEP_LIB=gui_gtk
  TK_DIR=gtk_tb
	CCCFLAG= -DUSE_GTK
endif

CCFLAGS= -O2 $(WIDGET_INCLUDE_DIR) $(CCCFLAG) \
	$(DEFS)  -I../include  -I/usr/local/include \
	-I/usr/X11R6/include
ifeq ($(EXTLANG),GUILE)
	LLIB	= -lguile -ldl $(GUILE_LIBS)
	CCFLAG	=$(GUILE_FLAGS) $(CCFLAGS) -D_$(EXTLANG)
else
	CCFLAG	=$(CCFLAGS)
endif
SYSLIB= $(WIDGET_LIB_DIR) $(LLIB) -L/usr/local/lib -L/usr/X11R6/lib -lX11  -lm 
MK_CFLAGS = -DPARANOID -DLIB_DIR=\"$(LIB_DIR)\" -DP_HOME=\"$(P_HOME)\" -DP_SULARC=\"$(P_SULARC)\"

#EOF
