# 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@

OBJS = strcpy.o strcat.o strncpy.o strlen.o memcpy.o memcmp.o strcmp.o \
       strrchr.o stricmp.o memset.o strchr.o strdup.o memchr.o strerror.o

all : $(OBJS)

clean :
	-Delete $(OBJS) QUIET

.PHONY : all clean

strcpy.o : string/strcpy.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strcat.o : string/strcat.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strncpy.o : string/strncpy.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strlen.o : string/strlen.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

memcpy.o : string/memcpy.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

memcmp.o : string/memcmp.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strcmp.o : string/strcmp.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strrchr.o : string/strrchr.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

stricmp.o : string/stricmp.c include/string.h internal/globals.h internal/systemcalls.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

memset.o : string/memset.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strchr.o : string/strchr.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strdup.o : string/strdup.c include/string.h include/stdlib.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

memchr.o : string/memchr.c include/string.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

strerror.o : string/strerror.c include/stdlib.h include/string.h include/errno.h internal/systemcalls.h internal/globals.h
	$(CC) $(ALL_CFLAGS) -c $< -o $@

