# implicit rules for ST-MAKE:
# $Id: turbo.rul 2.2 1991/07/08 11:27:34 trh Exp $

RULE-VERSION = 2.2 [Turbo C 2.03]  08-Jul-91  T.R.Hageman

# Location of the Turbo C executables:
BIN	= c:\tc\\

# Location of the include files:
INC	= c:\tc\h\\

# Location of the libraries:
LIB	= c:\tc\lib\\

# Assembler:
AS	= $(BIN)mas.ttp

# C compiler:
CC	= $(BIN)tcc.ttp -I$(INC)x -I$(INC)
CFLAGS	=

# Linker:
LD	= $(BIN)tlink.ttp
LDFLAGS	=

LOAD1ST = $(LIB)1
LOADLIBES = $(LIB)trh.lib $(LIB)std.lib

# Yacc
YACC	= c:\bin\bison.ttp
YFLAGS	=

# Lex
LEX	= c:\bin\flex.ttp
LFLAGS	=

# Implicit rules:
.SUFFIXES: .tos .ttp .prg .o .s .c .l .y

.c.o:
	$(CC) $(CFLAGS) $<

.s.o:
	$(AS) $(ASFLAGS) $< -o=$*.obj
	$(LD) -j -g $*.obj -o=$@	# strip local symbols
	@-$(RM) $*.obj

# Bison outputs correct file name right away
.y.c:
	$(YACC) $(YFLAGS) $<
	
.y.o:
	$(YACC) $(YFLAGS) $<
	$(CC) $(CFLAGS) $*.c
	@-$(RM) $*.c

# Flex can spit out result file to stdout
.l.c:
	$(LEX) $(LFLAGS) -t $< >$@

.l.o:
	$(LEX) $(LFLAGS) -t $< >$*.c
	$(CC) $(CFLAGS) $*.c
	@-$(RM) $*.c

.o.tos .o.ttp .o.prg:
	$(LD) $(LDFLAGS) -o=$@ $(LOAD1ST) $< $(LOADLIBES)

.c.tos .c.ttp .c.prg:
	$(CC) $(CFLAGS) $*.c
	$(LD) $(LDFLAGS) -o=$@ $(LOAD1ST) $* $(LOADLIBES)
	$(RM) $*.o
