# This is a make file that builds the library for
# kernel/lib/RNG
#
#
CC = gcc
AR = ar
CFLAGS = -nostdinc -fno-strict-aliasing -fno-builtin -Wall -Werror -g
OBJCOPY = objcopy

INCLUDES    = -I../inc -I../../inc

MT_OBJS = mt19937int.o

all: ../librand.a

%.o: Makefile %.c
	$(CC) -c -o $(*F).o $(CFLAGS) $(INCLUDES) $(*F).c
	$(OBJCOPY) -R .comment -R .note $(*F).o $(*F).o

%.o: Makefile %.S
	$(CC) -c -o $(*F).o $(CFLAGS) $(INCLUDES) $(*F).S
	$(OBJCOPY) -R .comment -R .note $(*F).o $(*F).o

../librand.a: Makefile $(MT_OBJS)
	$(AR) rc ../librand.a $(MT_OBJS)

clean:
	rm -f *.o *.d *.a
