# makefile for EULER
# This makefile is for Linux
# After that:
# make
# make noxeuler
# make install
# cd progs; euler
# or:
# cd progs; noxeuler
# view docs/euler.html with any Web browser.

# Changes for other systems:
# Change 8x13 to your favorite text font.
# Define -DRS6000 on IBM RS6000 machines.
# else provide -DSY_CLK_TCK=50 (clock ticks on your machine)
# else the program will time seconds only.
# Define -DSUN for Sun keybords
# Define -DFPE, if NaN and INF are not available by hardware
#               and program does crash on 1/0.
# Define -DCHDIR, if chdir makes troubles on make noxeuler.
# Define -DBACKSPACE, if backspace does not work, only delete
# Define -DSPECIAL_ALIGNMENT, if allignment is necessary
#               (in the CC command line)
# Additionally define -DALIGNMENT=xx, if xx is different from 8
#               (the default alignment factor)
#               (in the CC command line)

# If you do not have M_PI or PI and need pi with more than 16 digits
# define it -DPI=3.1415... (not necessary for 8 byte doubles)

CC=g++ -Wall -O2

# This is for printing the DOC on your local printer
# Set the number to the intended page length in lines
PRINTERPAGE=50

CFLAGS=-DCHDIR -DFONT=\"6x13\" -DGFONT=\"6x13\" -DSY_CLK_TCK=50 -DFPE

FILES= assign.o binary.o builtin.o edit.o express.o extend.o\
		fft.o funcs.o graphics.o helpf.o input.o interval.o\
		mainloop.o matheh.o output.o polynom.o scalp.o\
		spread.o stack.o store.o udf.o help.o special.o\
		feval.o meta.o psgraph.o

install: imported xeuler noxeuler
	cp euler.cfg help.txt xeuler noxeuler ../progs
	echo -----------------------------------------
	echo Start xeuler in the progs directory now !
	echo -----------------------------------------

imported: import.cpp
	g++ -o import import.cpp
	./import *.cpp *.h help.txt euler.cfg
	./import ../progs/*.e ../progs/*.en
	./import ../docs/*.html
	./import x11/*.cpp x11/*.h
	touch imported

xeuler: $(FILES) x11/sysdepx.o x11/rotated.o makefile
	$(CC) -o xeuler $(FILES) sysdepx.o rotated.o -lm -L/usr/X11/lib -lX11

noxeuler: $(FILES) sysdept.o makefile
	$(CC) -o noxeuler $(FILES) sysdept.o -lm

udf.o : header.h sysdep.h stack.h udf.cpp help.h
	$(CC) -c  udf.cpp

store.o : header.h store.h store.cpp
	$(CC) -c  store.cpp

stack.o : header.h stack.h stack.cpp
	$(CC) -c  stack.cpp

spread.o : header.h sysdep.h funcs.h interval.h spread.h stack.h spread.cpp
	$(CC) -c  spread.cpp

polynom.o : header.h polynom.h funcs.h matheh.h interval.h\
	express.h stack.h polynom.cpp
	$(CC) -c  polynom.cpp

output.o : header.h sysdep.h output.cpp
	$(CC) -c  output.cpp

matheh.o : header.h sysdep.h matheh.h stack.h matheh.cpp
	$(CC) -c  matheh.cpp

mainloop.o : header.h sysdep.h funcs.h graphics.h version.h\
	interval.h builtin.h stack.h meta.h mainloop.cpp
	$(CC) -c  mainloop.cpp

interval.o : header.h interval.h spread.h stack.h interval.cpp
	$(CC) -c  interval.cpp

input.o : header.h sysdep.h input.cpp
	$(CC) -c  input.cpp

helpf.o : header.h funcs.h helpf.h matheh.h interval.h stack.h helpf.cpp
	$(CC) -c  helpf.cpp

graphics.o : header.h sysdep.h funcs.h graphics.h stack.h meta.h graphics.cpp
	$(CC) -c  graphics.cpp

funcs.o : header.h sysdep.h funcs.h matheh.h polynom.h helpf.h\
	interval.h spread.h express.h stack.h funcs.cpp
	$(CC) -c  funcs.cpp

assign.o : header.h stack.h extend.h interval.h assign.cpp
	$(CC) -c  assign.cpp

binary.o : header.h stack.h binary.cpp
	$(CC) -c  binary.cpp

builtin.o : header.h builtin.h builtin.cpp
	$(CC) -c  builtin.cpp

edit.o : header.h sysdep.h graphics.h edit.cpp
	$(CC) -c  edit.cpp

express.o : header.h sysdep.h funcs.h interval.h builtin.h express.h stack.h express.cpp
	$(CC) -c  express.cpp

extend.o : header.h extend.h extend.cpp
	$(CC) -c  extend.cpp

feval.o : header.h stack.h builtin.h sysdep.h feval.cpp
	$(CC) -c  feval.cpp

fft.o : header.h matheh.h sysdep.h fft.cpp
	$(CC) -c  fft.cpp

scalp.o : header.h interval.h express.h stack.h scalp.cpp
	$(CC) -c  scalp.cpp

special.o : header.h stack.h spread.h special.cpp
	$(CC) -c  special.cpp

help.o : header.h help.h help.cpp
	$(CC) -c  help.cpp

x11/sysdepx.o : header.h sysdep.h x11/sysdepx.cpp help.cpp
	$(CC) $(CFLAGS) -c x11/sysdepx.cpp

x11/rotated.o : x11/rotated.cpp x11/rotated.h
	$(CC) $(CFLAGS) -c x11/rotated.cpp

sysdept.o : header.h sysdep.h meta.h sysdept.cpp
	$(CC) $(CFLAGS) -c sysdept.cpp

meta.o: sysdep.h meta.h psgraph.h meta.cpp
	$(CC) $(CFLAGS) -c meta.cpp

psgraph.o : psgraph.h psgraph.cpp
	$(CC) $(CFLAGS) -c psgraph.cpp	

clean:
	rm *.o xeuler noxeuler
