#
# Makefile for Linux specific functions
#

include ../../Makeconfig

include ../../Makerules

LIB:=libc.a

ifndef OPTFLAGS
OPTFLAGS= -O6 -fomit-frame-pointer
endif

CFLAGS = $(WFLAGS) $(OPTFLAGS) $(INC) $(XCFLAGS)

INC= -I../../sysdeps/linux/i386 -I../..

SRCS=__stat.c __lstat.c __symlink.c __link.c __main.c \
	__environ.c errno.c __unlink.c
OBJS= $(SRCS:.c=.o)
ASMS= $(SRCS:.c=.s)

$(LIB): $(OBJS)
	$(AR) uvc $(LIB) $(OBJS)
	-$(AR) -dv $(LIB) __.SYMDEF
	$(REALRANLIB) -v $(LIB)

asm: $(ASMS)

obj: $(OBJS)

clean:
	$(RM) -f core *.o libc.a *.s *.i tmp_make foo

depend:
	$(CC) -M $(SRCS) > .depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
