# Makefile for SCM for EMX GCC 0.8e (Gnu CC port to OS/2 2.0 with i386).
# Copyright (C) 1993 soravi@Athena.MIT.EDU

# Changes for OS/2 2.0 and gcc/EMX 0.8e
# 1) IMPLINIT def has double quotes (")
# 2) RGXFLAGS def has double quotes (")
# 3) INITS def has double quotes (")
# 5) 'clean dependency
# 6) 'scm.exe dependency
#For EMX 0.8d, try the following (it worked for me a while back) :
#	1) Comment out definition of IMPLINIT from the makefile
#	2) compile the system (your stray backslash errors should go away)
#	3) set the following in the OS/2 environment (and later in CONFIG.SYS)
#		set SCM_INIT_PATH=C:\SCM\INIT.SCM
#		set SCHEME_LIBRARY_PATH=C:\SCM\SLIB

# Pathname where Init.scm resides.  This directory must also contain COPYING.
#### IMPLINIT=""\\Progs\\SCM\\Init.scm""
# If pathname where Init.scm resides is not known in advance then
# SCM_INIT_PATH is the environment variable whose value is the
# pathname where Init.scm resides.
# IMPLINIT=

CC = gcc

# -DRTL if this is a run-time library only (no interactive top level)
# -DRECKLESS if you want most scm error checking disabled.
# -O if you want the optimizing C compiler to be used.
# -m386 compiler will generate 386 instructions
# -m486 compiler will generate 486 instructions

CFLAGS = -O -m386

#FFLAGS are flags for inexact numbers (floating point)
# -DFLOATS turns on support for inexact numbers.
# -DENGNOT for engineering notation instead of scientific notation.

FFLAGS=-DFLOATS

# append any names of user extension files
# -lm for -DFLOATS
ELIBS=
LIBS=$(ELIBS) -lm

### RGXFLAGS=-I d:/progs/emx/include.cpp

# INITS= the initialization calls for user extension files.
#File:	INITS line:		functions defined:
#sc2.c	init_sc2\(\);	substring-move-left!, substring-move-right!,
#			substring-fill!, append!, and last-pair
#rgx.c	init_rgx\(\);	regcomp and regexec.

INITS=-DINITS="init_sc2();"

#you should not need to change below this line.

### DFLAG = -DIMPLINIT=$(IMPLINIT)
DFLAG=

ffiles = time.o repl.o scl.o sys.o eval.o subr.o sc2.o unif.o

scm.exe:	$(ffiles) scm.o
	$(CC) -o scm.exe $(ffiles) scm.o $(LIBS)
scm.o:	scm.c scm.h scmfig.h patchlvl.h
	$(CC) $(CFLAGS) -c $(FFLAGS) $(DFLAG) $(INITS) scm.c
sys.o:	sys.c scm.h scmfig.h setjump.h
	$(CC) $(CFLAGS) -c $(FFLAGS) sys.c
scl.o:	scl.c scm.h scmfig.h
	$(CC) $(CFLAGS) -c $(FFLAGS) scl.c
eval.o: eval.c scm.h scmfig.h
	$(CC) $(CFLAGS) -c $(FFLAGS) eval.c
repl.o:	repl.c scm.h scmfig.h setjump.h
	$(CC) $(CFLAGS) -c $(FFLAGS) repl.c
subr.o:	subr.c scm.h scmfig.h
	$(CC) $(CFLAGS) -c subr.c
time.o:	time.c scm.h
	$(CC) $(CFLAGS) -c time.c
unif.o:	unif.c scm.h scmfig.h
	$(CC) $(CFLAGS) -c unif.c
sc2.o:	sc2.c scm.h
	$(CC) $(CFLAGS) -c sc2.c
rgx.o:	rgx.c scm.h makefile.unix
	$(CC) $(CFLAGS) $(RGXFLAGS) -c rgx.c

clean:
	-del $(ffiles)
