# TurboC/PureC-Makefile for Ruby
# Copyright (c) 1992 Markus M. Nick, Mainz 41
#
# this is the makefile to compile Ruby with PureC
# it requires UNIXMODE = 'L' or "more"

# please adapt RUBY_ROOT   --   bitte RUBY_ROOT anpassen
# in the file PATHS

__PureC__ = 1

include ..\..\paths

# options for the c compiler
COPTS =

# the names of the compiler, the archiver etc
CC = pcc
AR = plink
AS = pasm
CLINK = plink
RM = rm

# compiler, linker and archiver options
CFLAGS = -Y -P -R -D__STDC__=1 -I$(PureC_INCLUDES) $(COPTS) -O=#<- no space
LFLAGS = -G -L -Y -O=#<- no space
ARFLAGS = -J -O=#<- no space
ASFLAGS = -Y -O=#<- no space

# special compiler for ruby.c and ruby_pop.c
RU_CC = $(CC)
RU_CFLAGS = $(CFLAGS)
RU_C_ONLY = $(C_ONLY)

# special compiler flags for ruby.c
RUBY_C_FLAGS = -U__STDC__

# compiler specific objects 
OBJ_SPECIAL = rsr_regs.o

# the name of the library
RUBYLIBNAME = ruby.lib

# the name of the example program
TESTPRG = example

# the startup object (usually crt0.o or so)
CL_INIT = $(PureC_LIBS)\pcstart.o

# the libraries
# `plink.cfg' contains a list of the purec libraries
LIBS = -C=plink.cfg


# include the stuff for all compilers
include ..\..\mincl

## test ##
test : $(TEST)
$(TEST) : example.o $(OBJ_STUFF) $(RUBYLIB)
	echo $(CL_INIT) example.o $(OBJ_STUFF) >foo.cfg
	$(CLINK) $(LFLAGS)a.prg -C=foo.cfg $(RUBYLIB) $(LIBS)
	mv a.prg $(TEST)
	rm foo.cfg


rsr_regs.o : $(RUBY_ROOT)\purec\rsr_regs.s
	$(AS) $(ASFLAGS)$@ $<

# -eof-

