#
#  Makefile for Unix (x)ew.  
#  
#  Common Unix defines.  You will probably have DOT_INI defined.

COMMON_DEF = -DUNIX -DDOT_INI


#  To compile the X version, use these.  You need the XForms
#  library (v. 0.81, see http://bloch.phys.uwm.edu/pub/forms/).
#  If you have a sound device, set -DAUDIO_DEVICE=\"/dev/dsp\",
#  or whatever your devicename is.  If not, don't define it.

VERSION_DEF = -DWITH_XFORMS -DAUDIO_DEVICE=\"/dev/dsp\"
LIBS = -lforms -lX11 -lm


#  To compile the (n)curses version, uncomment these, and remove 
#  the 'n' as appropriate.   You must run "make ew".

# VERSION_DEF = -DNCURSE
# LIBS = -lncurses


#  I use gcc if possible :

CC = gcc
GCCFLAGS = -Wall -ansi -pedantic -Wstrict-prototypes
LD = gcc


#  You may have to add appropriate -I/dir flags here, 
#  to find the header files you need (forms.h, curses.h,...)

INCLUDE = -I/kjemi/include


# Here you might want to specify the location of the libraries:

LDFLAGS= -L/kjemi/lib/X11 -L/usr/X11/lib  $(LIBS)


#  You shouldn't need to change anything below:

CFLAGS= -O $(GCCFLAGS) $(COMMON_DEF) $(VERSION_DEF) $(INCLUDE) 


RM = rm -f

OBS   = ew.o xew_m.o xew_f.o makexpm.o fixpal.o
C_OBS = ew.o

xew:	$(OBS)
	$(LD)  -o xew $(OBS) $(LDFLAGS)

# for distribution only:
static:	$(OBS)
	$(LD) -o xew.st $(OBS) /kjemi/lib/X11/libforms.a -L/usr/X11/lib -lXpm -lX11 -lm 

ew:	$(C_OBS)
	$(LD)  -o ew $(C_OBS) $(LDFLAGS)

clean:
	$(RM) ew xew a.out *.o core 

