# 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 = systemcalls.o signalcheck.o __seterrno.o

all : $(OBJS)

clean :
	-Delete $(OBJS) QUIET

.PHONY : all clean

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

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

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

