# This makefile.bc is intended for Borland C 3.1
# Contributed by Jim Hall <jhall1@isd.net>
#
# To compile, type:     make -fmakefile.bc
#
# I have not tested the bwx_iqc implementation:
#
#		To implement the bwx_iqc implementation (using specific
#		features for the IBM PC and compatibles), chainge each
#		instance of "bwx_tty" to "bwx_iqc".
#
PROJ=           bwbasic
#CC=             qcl
CC=             bcc

#
#		These are the normal flags I used to compile bwBASIC:
#
#CFLAGS=         -O -AL -W3 -Za -DMSDOS
CFLAGS=         -O -DDMSDOS -DANSI_C=1 -DHAVE_STRING=1 -DHAVE_STDLIB=1 -mh
#
#		The following flags can be used for debugging:
#
#CFLAGS=         -Od -AL -W3 -Za -Zr -Zi -DMSDOS

# Not needed: (jh)
#LFLAGS=         /NOE /ST:8192

# Split the OFILES macro into smaller pieces: (jh)
OFILES1=        bwbasic.obj bwb_int.obj bwb_tbl.obj bwb_cmd.obj bwb_prn.obj
OFILES2=        bwb_exp.obj bwb_var.obj bwb_inp.obj bwb_fnc.obj bwb_cnd.obj
OFILES3=        bwb_ops.obj bwb_dio.obj bwb_str.obj bwb_elx.obj bwb_mth.obj
OFILES4=        bwb_stc.obj bwb_par.obj bwx_tty.obj msdos.obj

HFILES=         bwbasic.h bwb_mes.h

all:            $(PROJ).exe

$(OFILES1):     $(HFILES)
$(OFILES2):     $(HFILES)
$(OFILES3):     $(HFILES)
$(OFILES4):     $(HFILES)

$(PROJ).exe:    $(OFILES1) $(OFILES2) $(OFILES3) $(OFILES4)
	echo $(OFILES1) > ofiles1.xxx
	echo $(OFILES2) > ofiles2.xxx
	echo $(OFILES3) > ofiles3.xxx
	echo $(OFILES4) > ofiles4.xxx
	$(CC) $(CFLAGS) -e$@ @ofiles1.xxx @ofiles2.xxx @ofiles3.xxx @ofiles4.xxx
	-del *.xxx



# Clean up: (jh)

clean:
	-del *.xxx

realclean: clean
	-del *.obj

distclean: realclean
	-del *.exe
