include $(CYBORNPATH)/build/cyborn.mk

# make with ROMVERSION=117 to use the functions built into the boot rom instead
# of the libraries - this will save space and will be faster since boot located
# code doesn't have wait states or delays in memory reads.


ifeq "$(BOOTROM_VERSION)" "117"
ROMFUNCS =  romfuncs117.o
else
ROMFUNCS =  memset.o \
            memcpy.o \
            memmove.o \
            strcmp.o \
            strncmp.o \
            strlen.o \
            strcpy.o \
            strncpy.o \
            strstr.o  \
            strcat.o \
            strchr.o \
            strrchr.o \
            strstarts.o \
            strends.o \
            skipws.o \
            atoi.o \
            atoul.o \
            xtoi.o \

endif



OBJFILES =  $(ROMFUNCS) \
            romdata.o \
            rand.o \
            dummies.o \
            lib1funcs.o \
            init_malloc.o \
            malloc.o \
            calloc.o \
            strdup.o \
            free.o \
            itoa.o \
            realloc.o\


libc.a: $(OBJFILES)
	$(TOOLPATH)ar.exe -rcs $@ $(OBJFILES)
	cp $@ $(LIBPATH)



clean:
	rm *.o *.a


