#
# This is the Makefile for Ipe itself
#
# First set INCLUDE_DIRS and LIB_DIRS for the Motif and X libraries.
#
# If you are compiling on an SGI, set MIXED to the correct mode
#
# Finally, set LIBRARIES.
# If you have none of the architectures listed below, I suggest you
# start with the setting for a Sun Sparcstation.
# You may need to add "-lPW" if you get missing symbols "regcmp", "regex".
# (You have to omit "-lPW" if you get a missing symbol "Error".)
#
# Then type "make" to create ipe
#

# if you don't have an SGI or if you want pure X on an SGI:
MIXED		=
# SGI only: create the canvas as a GL window
# MIXED		= -DMIXED
# SGI only: GL window, and use GL NURBS calls to draw spline outlines
# MIXED		= -DMIXED -DSPLINES_USE_NURBS

# The C++ compiler
CC		= g++

# define GFLAGS if you use g++
#GFLAGS  =
GFLAGS	= -fno-for-scope

# Need to find X and Motif
INCLUDE_DIRS	= -I../Plageo -I/usr/local/include/Xm
LIB_DIRS	= -L../Plageo -L/usr/lib/X11R5 -L/usr/local/lib/

# on a Dec Alpha, add -DNO_XMSTRINGS to CFLAGS
# if you get an error with signal handlers,
# add -DLONG_SIGNAL_HANDLER_ARG to CFLAGS
CFLAGS		= $(GFLAGS) -O $(MIXED) $(INCLUDE_DIRS)
LFLAGS		= $(LIB_DIRS) -s

# LIBRARIES when linking the mixed model (SGI Irix 4)
# LIBRARIES	= -lXirisw -lXm -lXt -lfm_s -lgl_s -lPW -lplageo -lm

# LIBRARIES for a pure X executable:

# SGI, Irix 4
# LIBRARIES	= -lXm -lXt -lX11 -lPW -lplageo -lm

# HP700, HP-UX 9.0.1
# LIBRARIES	= -lXm -lXt -lX11 -lplageo -lM

# Sun Sparcstation, SunOs4.1
# LIBRARIES	= -lXm -lXt -lX11 -lplageo -lm

# Dec Alpha with Dec 'cxx' compiler
# LIBRARIES	= -lXm -lXt -lX11 -lplageo -lm -ldnet_stub

# Linux 
# LIBRARIES       = -lXm -lXt -lX11 -lXext -lplageo -lm
# Linux with static libraries
LIBRARIES       = -L/usr/X11R6/lib/ -lXm -lXt -lX11 -lXext -lplageo -lm -lSM -lICE -lXpm -lX11

#
#----------------------------------------------------------------------
#

#
# .C suffix is not know to sun make
#
.SUFFIXES: .C

OBJS		= main.o colors.o data.o icon.o graphics.o fonts.o\
		callback.o interface.o menus.o configuration.o \
		resources.o mexplain.o operations.o ium.o\
		canvas.o snapping.o selecting.o moving.o\
		preview.o transform.o postscript.o struc.o file.o\
		line.o text.o group.o circle.o box.o mark.o\
		spline.o arc.o bitmap.o segments.o property.o\
		thererays.o

EXE		= ipe

all: $(EXE)

$(EXE): $(OBJS) 
	$(CC) $(OBJS) $(LFLAGS) $(LIBRARIES) -o $(EXE)

.C.o:
	$(CC) $(CFLAGS) -c $<

clean:
	-/bin/rm -f $(OBJS) $(EXE)

