# > Makefile for make!

GCCflags =  -i
Linkflags = -aif -o $@
Libs =  gcc:o.gcc Unix:UnixLib.o

Dependencies = -mamu

CC = gcc $(GCCflags)
Link = ld $(Linkflags) $(Libs)


.SUFFIXES: .o .c .cc .s .i .y .h
.c.o:
	$(CC) $(Dependencies) -c -o $@ $<
.cc.o:
	$(CC) $(Dependencies) -c -o $@ $<
.cc.s: 
	$(CC) $(Dependencies) -S -o $@ $<
.c.s:  
	$(CC) $(Dependencies) -S -o $@ $<
.cc.i: 
	$(CC) $(Dependencies) -E -o $@ $<
.c.i:  
	$(CC) $(Dependencies) -E -o $@ $<


#############################################################################


#LINKS= C:o.Stubs   C:o.Risc_OSlib
LINKS = gpp:o.c++ gcc:o.gcc Unix:o.UnixLib


#CFLAGS = -c -darc -IUnix: -JUnix:
CFLAGS = -darc -IUnix:


SRCS	=	check.c input.c macro.c main.c \
		make.c reader.c rules.c riscsupp.c\
		error.c h.h


OBJS	=	check.o input.o macro.o main.o \
		make.o reader.o rules.o riscsupp.o\
		error.o 

!Runimage:	$(OBJS) 
	$(Link) $(OBJS) 
	

# $(LINKS)

$(OBJS):h.h

checkout:
	co $(SRCS)	


# Dynamic dependencies:
o.reader:	c.reader
o.reader:	Unix:h.string
o.reader:	Unix:sys.h.types
o.reader:	Unix:h.errno
o.reader:	h.h
o.reader:	Unix:h.stdlib
o.reader:	Unix:h.stdio
o.reader:	Unix:h.stdarg
o.error:	c.error
o.error:	h.h
o.error:	Unix:h.string
o.error:	Unix:sys.h.types
o.error:	Unix:h.errno
o.error:	Unix:h.stdlib
o.error:	Unix:h.stdio
o.error:	Unix:h.stdarg
o.check:	c.check
o.check:	h.h
o.check:	Unix:h.string
o.check:	Unix:sys.h.types
o.check:	Unix:h.errno
o.check:	Unix:h.stdlib
o.check:	Unix:h.stdio
o.check:	Unix:h.stdarg
o.input:	c.input
o.input:	Unix:h.stdio
o.input:	Unix:h.stdarg
o.input:	Unix:sys.h.types
o.input:	h.h
o.input:	Unix:h.string
o.input:	Unix:h.errno
o.input:	Unix:h.stdlib
o.macro:	c.macro
o.macro:	h.h
o.macro:	Unix:h.string
o.macro:	Unix:sys.h.types
o.macro:	Unix:h.errno
o.macro:	Unix:h.stdlib
o.macro:	Unix:h.stdio
o.macro:	Unix:h.stdarg
o.main:	c.main
o.main:	Unix:h.stdio
o.main:	Unix:h.stdarg
o.main:	Unix:sys.h.types
o.main:	Unix:sys.h.os
o.main:	h.h
o.main:	Unix:h.string
o.main:	Unix:h.errno
o.main:	Unix:h.stdlib
o.rules:	c.rules
o.rules:	h.h
o.rules:	Unix:h.string
o.rules:	Unix:sys.h.types
o.rules:	Unix:h.errno
o.rules:	Unix:h.stdlib
o.rules:	Unix:h.stdio
o.rules:	Unix:h.stdarg
o.make:	c.make
o.make:	Unix:h.unistd
o.make:	Unix:h.time
o.make:	Unix:sys.h.types
o.make:	Unix:h.fcntl
o.make:	Unix:h.termio
o.make:	Unix:sys.h.stat
o.make:	h.h
o.make:	Unix:h.string
o.make:	Unix:h.errno
o.make:	Unix:h.stdlib
o.make:	Unix:h.stdio
o.make:	Unix:h.stdarg
o.make:	Unix:sys.h.os
o.make:	Unix:h.string
o.riscsupp:	h.h
o.riscsupp:	Unix:h.errno
o.riscsupp:	Unix:h.stdlib
o.riscsupp:	Unix:h.stdio
o.riscsupp:	Unix:h.stdarg
o.riscsupp:	Unix:sys.h.os
