# Makefile for libRILc.
# Simple implementation of a standard C library (and a few other things).
# Copyright © 1993, 1997, 1998 Rask Ingemann Lambertsen.

# libRILc is freely distributable as described in the file DISTRIBUTION.

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH  = @top_srcdir@

CC = @CC@
AR = @AR@

PPC_AFLAGS  = -Wa,-mregnames
M68K_AFLAGS =

ALL_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir)/internal -I $(top_srcdir) $(CPPFLAGS)

M68KFLAGS = -m68020-60 -g
PPCFLAGS  = -mcpu=604 -mmultiple -g

CFLAGS = -O3 -fomit-frame-pointer -Wall $(@CPU@FLAGS)
ALL_CFLAGS = $(CFLAGS) $(ALL_CPPFLAGS)

prefix = @prefix@
exec_prefix = @exec_prefix@

INSTDIR_HEADERS = @includedir@/librilc
INSTDIR_LIBRARY = @libdir@/librilc

OBJS = fclose.o fflush.o fgetc.o fopen.o fseek.o fgets.o fread.o \
       fwrite.o fputc.o fprintf.o fputs.o __vrawdofmt.o \
       __float_vrawdofmt.o amiga_fprintf.o float_fprintf.o \
       __vrawscanf.o __float_vrawscanf.o fscanf.o float_fscanf.o \
       ferror.o perror.o resources.o startup.o

all : $(OBJS)

clean :
	-Delete $(OBJS) QUIET

.PHONY : all clean

fclose.o : stdio/fclose.c include/stdio.h include/errno.h stdio/globals.h internal/globals.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fflush.o : stdio/fflush.c include/stdio.h include/errno.h internal/systemcalls.h internal/globals.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fgetc.o : stdio/fgetc.c include/stdio.h include/errno.h internal/systemcalls.h internal/globals.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fopen.o : stdio/fopen.c include/stdio.h include/errno.h stdio/globals.h internal/globals.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fseek.o : stdio/fseek.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fgets.o : stdio/fgets.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fread.o : stdio/fread.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fwrite.o : stdio/fwrite.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fputc.o : stdio/fputc.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fprintf.o : stdio/fprintf.c include/stdio.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fputs.o : stdio/fputs.c include/stdio.h include/errno.h internal/globals.h internal/systemcalls.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

__vrawdofmt.o : stdio/__vrawdofmt.c include/stdio.h include/stdlib.h include/ctype.h include/math.h include/float.h include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

__float_vrawdofmt.o : stdio/__float_vrawdofmt.c stdio/__vrawdofmt.c include/stdio.h include/stdlib.h include/ctype.h include/math.h include/float.h include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

amiga_fprintf.o : stdio/amiga_fprintf.c include/stdio.h include/stdlib.h internal/systemcalls.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

float_fprintf.o : stdio/float_fprintf.c stdio/fprintf.c include/stdio.h internal/signalcheck.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

__vrawscanf.o : stdio/__vrawscanf.c include/stdio.h include/stdlib.h include/ctype.h include/math.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

__float_vrawscanf.o : stdio/__float_vrawscanf.c stdio/__vrawscanf.c include/stdio.h include/stdlib.h include/ctype.h include/math.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

fscanf.o : stdio/fscanf.c include/stdio.h 
	$(CC) $(ALL_CFLAGS) -c $< -o $@

float_fscanf.o : stdio/float_fscanf.c stdio/fscanf.c include/stdio.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

ferror.o : stdio/ferror.c include/stdio.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

resources.o : stdio/resources.c include/stdlib.h internal/systemcalls.h stdio/globals.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

perror.o : stdio/perror.c include/stdio.h include/errno.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

startup.o : stdio/startup.c memory/globals.h stdio/globals.h include/stdio.h stdio/startup.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

