#-----------------------------------------------------------------------------
# Makefile.in for Unix version of tnimage
# Tabs must be used to separate fields
# Makefile is created automatically by 'configure'.
#-----------------------------------------------------------------------------

RM = rm -f

# Add    -static    to end of the CFLAGS line to get a statically-linked version.
# Remove -Wall      if your compiler complains about complex.h (This occurs with
#                   some older versions of gcc).

# Remove lex.yy.o and y.tab.o here, remove -ll below, and remove the line
# #define HAVE_LEX from xmtnimage.h if you don't have flex or lex.

OBJS = xdata*.o lex.yy.o y.tab.o
LDFLAGS=
INCLUDES=-I. -I/usr/include -I/usr/include/X11  -I/usr/include -I/usr/include/Xbae 
LIBS=-L  -lm /usr/lib/x86_64-linux-gnu/libXbae.so -lXm -lXpm -lXext -lXt -lX11 -lgmp -L  -lm -ll -lm -lXext  /usr/lib/x86_64-linux-gnu/libXbae.so -lXm -lXpm -lXext -lXt -lX11 -lgmp -lfl 
CC=g++
CFLAGS=-O3 -Wall
YACC=bison -y

# Can't use a 'rule' to make .o files because not all make's handle it.
# If flex is used on calculator.l, lex.yy.c must be edited manually. See
# comments in calculator.y.



# Can't use a 'rule' to make .o files because not all make's handle it.

all:: xdata 
xdata.o:  xdata.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata.cc
xdata1.o:  xdata1.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata1.cc
xdata2.o:  xdata2.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata2.cc
xdata3.o:  xdata3.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata3.cc
xdata4.o:  xdata4.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata4.cc
xdata5.o:  xdata5.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata5.cc
xdata6.o:  xdata6.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata6.cc
xdata7.o:  xdata7.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata7.cc
xdata8.o:  xdata8.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata8.cc
xdata9.o:  xdata9.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata9.cc
xdata10.o:  xdata10.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata10.cc
xdata11.o:  xdata11.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata11.cc
xdata12.o:  xdata12.cc
	$(CC) -c $(CFLAGS) $(INCLUDES) xdata12.cc
y.tab.o: y.tab.c
	$(CC) -c -x c++ $(CFLAGS) $(INCLUDES) y.tab.c
y.tab.c: calculator.y
	$(YACC) -d calculator.y  
lex.yy.o: lex.yy.c
	cp lex.yy.c.bak lex.yy.c
	$(CC) -c -x c++ $(CFLAGS) $(INCLUDES) lex.yy.c
install:
	./Install


# Each line here after the .o's must start with a tab.
xdata: xdata.o xdata1.o xdata2.o xdata3.o xdata4.o xdata5.o xdata6.o xdata7.o\
	xdata8.o xdata9.o xdata10.o xdata11.o xdata12.o lex.yy.o y.tab.o
	$(RM) $@ 
	$(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS) $(LDFLAGS)

clean:
	$(RM) ./xdata
	echo Cleaning up...
	$(RM) *.o 

distclean:
	echo Distribution cleaning...
	$(RM)  config.cache config.status config.log 
	find . -name makefile -exec rm {} \; -print
