# 
# This makefile create a static library with the interface for MySQL database.
#

# This macro should point the location of your rtems build
RTEMS_BUILD	        = /tools/build-i386-elf-rtems
# Specify the BSP in use
RTEMS_BSP           = pc386

PROJECT_RELEASE     = $(RTEMS_BUILD)/$(RTEMS_BSP)
PROJECT_TOOLS       = $(PROJECT_RELEASE)/build-tools

# export variables for sublevel makefiles
export CC CFLAGS AS LD AR STRIP

# Define this macro as the prefix for your cross-compiler
CROSS_COMPILE = i386-rtemself-

CC            = $(CROSS_COMPILE)gcc
AS            = $(CROSS_COMPILE)as
LD            = $(CROSS_COMPILE)ld
AR            = $(CROSS_COMPILE)ar
STRIP         = $(CROSS_COMPILE)strip
OBJCOPY       = $(CROSS_COMPILE)objcopy

# cc flags, includes
RTEMS_INC = -I$(PROJECT_RELEASE)/lib/include -I$(PROJECT_RELEASE)/lib/include/networking \
-I$(PROJECT_RELEASE)/lib/include/sys
PRJ_INC = -I../include  -I.. -I.

DEFINES  +=	-DENGLISH -DDBUG_OFF -DUNDEF_THREADS_HACK

CFLAGS = -O4 -Wall -Wno-unused $(DEFINES) $(PRJ_INC) $(RTEMS_INC) \
-fasm -g -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems 


MYSQL_CLIENT_FILES = my_init.o my_static.o my_malloc.o \
my_realloc.o my_create.o my_delete.o my_tempnam.o my_open.o \
mf_casecnv.o my_read.o my_write.o errors.o my_error.o my_lib.o \
my_getwd.o my_div.o mf_pack.o my_messnc.o mf_dirname.o mf_wcomp.o \
typelib.o safemalloc.o my_alloc.o getvar.o mf_format.o mf_path.o \
mf_unixpath.o my_fopen.o mf_loadpath.o my_pthread.o my_thr_init.o \
thr_mutex.o mulalloc.o string.o default.o my_compress.o array.o \
my_once.o list.o strmov.o strxmov.o strnmov.o strmake.o strend.o \
strfill.o ct_init.o is_prefix.o int2str.o str2int.o strinstr.o \
strcont.o strcend.o bchange.o bmove.o bmove_upp.o longlong2str.o \
dbug.o libmysql.o net.o password.o errmsg.o ctype-latin1.o


ALL = libmysql.a

all: $(ALL)

clean:
	rm -f *.o *.a

libmysql.a: $(MYSQL_CLIENT_FILES)
	$(AR) rcs libmysql.a $(MYSQL_CLIENT_FILES)




