# make chemesthetics with the SAS/Lattice C 5.10, Metalworx 29-Feb-92
#
# warning!!!! Do not invoke global optimizer GO (-O) on palettereq.c and
#	      eingabe.c, on my system it always leads to crashes!
#

# if you change the math model you have to adapt the following macros...
#MATH=FPU81
#WITHFILE=chemest_fpu81.with
#FLOATFLAGS=-f8
# ...until here!

#uncomment the next three lines if you want to have Motorola FFP instructions
#and comment the valid specifications
MATH=FFP
WITHFILE=chemest.with
FLOATFLAGS=-ff

#MATH=IEEE
#WITHFILE=chemest_ieee.with
#FLOATFLAGS=-fi

LANG=ENGLISH
OPTFLAGS=-O
CROSSFLAGS=
CFLAGS=-d$(LANG) -d$(MATH) $(FLOATFLAGS) -cfstu $(CROSSFLAGS) -Hpre.sym\
 -iINCLUDE:pdomain -j132 -q5
CFLAGS2=-d$(LANG) -d$(MATH) $(FLOATFLAGS) -cfstu $(CROSSFLAGS)\
 -iINCLUDE:pdomain -j132 -q5

# flags: -d$(LANG)           define language symbol at compile time
#	 -d2		     enable debugging mode 2
#	 -ff		     use FFP floating point routines
#	 -csut		     delete duplicate string constants, treat all
#			     chars as unsigned, enable warnings for non-
#			     defined structure or union tags
#	 -Hpre.sym	     use precompiled includes for faster compilation
#	 -i...		     set my own Include dir to be searched too
#	 -j132		     suppress warning #132 (tokens after #endif)
#	 -O		     invoke global optimizer
#	 -mt		     minimaze code for time
#	 -qdh0: 	     place quad (temporary) file in dh0:
#	 -q5		     stop compile after 5 errors

OFILES=chemest.o control.o eingabe.o rev.o credits.o requests.o\
 rout:palettereq.o metalworx.o globalstructs.o statistics.o prefs.o\
 license.o sysinfo.o rout:_main.o saveiff.o ilbmw.o diskio.o zeit_angabe.o

all: chemest

chemest: pre.sym $(OFILES)
  BLINK WITH $(WITHFILE)
  increv

pre.sym: pre.c mathlibs.h INCLUDE:pdomain/exlibprotos.h
  lc -cfsu -d$(MATH) -iINCLUDE:pdomain -j132 -ph -opre.sym -q5 pre.c

chemest.o: chemest.c chemest.h mathlibs.h
  lc $(CFLAGS) $(OPTFLAGS) chemest

control.o: control.c mathlibs.h
  lc $(CFLAGS) $(OPTFLAGS) control

eingabe.o: eingabe.c eingabe.h mathlibs.h
  lc $(CFLAGS) eingabe

rev.o: rev.c
  lc rev

credits.o: credits.c credits.h messages.h

globalstructs.o: globalstructs.c radio1.h radio2.h

metalworx.o: metalworx.c metalworx.h
  lc $(CFLAGS) $(OPTFLAGS) -ca metalworx

statistics.o: statistics.c
  lc $(CFLAGS) $(OPTFLAGS) -ca statistics

prefs.o: prefs.c prefs.h mathlibs.h LoadPrefs1.h LoadPrefs2.h SavePrefs1.h\
 SavePrefs2.h default1.h default2.h
  lc -ca $(CFLAGS) $(OPTFLAGS) prefs

license.o: license.c license.h
  lc -ca $(CFLAGS) $(OPTFLAGS) license

requests.o: requests.c
  lc -ca $(CFLAGS) $(OPTFLAGS) requests

rout:palettereq.o: rout:palettereq.c rout:palettereq.h

sysinfo.o: sysinfo.c
  lc -ca $(CFLAGS) $(OPTFLAGS) sysinfo.c

diskio.o: diskio.c cdmicon.h mathlibs.h
  lc -ca $(CFLAGS) $(OPTFLAGS) diskio.c

zeit_angabe.o: zeit_angabe.c zeit_angabe.h mathlibs.h
  lc -ca $(CFLAGS) $(OPTFLAGS) zeit_angabe.c

titel.o: titel.c titel.h titelbild.h
  lc -ca $(CFLAGS2) $(OPTFLAGS) titel.c
