#
# This makefile builds the syscall library
#

include ../../user.mk

CC = gcc
AR = ar
CFLAGS = -nostdinc -fno-strict-aliasing -fno-builtin -Wall -Werror -gstabs+
OBJCOPY = objcopy

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

all: libsyscall.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

libsyscall.a: Makefile $(SYSCALL_OBJS)
	$(AR) rc libsyscall.a $(SYSCALL_OBJS)
	mv libsyscall.a ..

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