#
# This makefile builds the thread library
#

include ../../user_libs.mk

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

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

.PHONY: all clean

all: libthread.a

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

libthread.a: Makefile $(THREAD_OBJS) ../../user_libs.mk
	$(AR) rc libthread.a $(THREAD_OBJS)
	mv libthread.a ..

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