# RTEMS Makefile for Parrot
#
# Chris Johns <chrisj@rtems.org>
#
# This is sample makefile to show the commands needed to get Parrot to build
# for RTEMS. The makefile cross compiles the source created by the Parrot build
# system when building for an FC9 Linux box. The Parrot build system genetates
# the source from PMC files so the Linux build is performed before running make
# with this file. The RTEMS currently only supports the i386 or PC BSP as this
# is the architecture of the native Linux build of Parrot.
#
# RTEMS is defined by the canoncial form of <arch>-rtems<version> where <arch>
# can be i386, m68k, arm, PowerPC, sparc and more. The version is the RTEMS
# version.
#

VPATH = $(PARROT_SRC)

ARCH = i386
VERSION = 4.10
BSP = pc586

RTEMS_TRIPLE = $(ARCH)-rtems$(VERSION)

RTEMS_PATH = /local/ccj/rtems/bsp/$(VERSION)
BSP_PATH = $(RTEMS_PATH)/$(BSP)/$(RTEMS_TRIPLE)/$(BSP)
BSP_INC = $(BSP_PATH)/lib/include
BSP_LIB = $(BSP_PATH)/lib

CC = $(RTEMS_TRIPLE)-gcc
AR = $(RTEMS_TRIPLE)-ar

CFLAGS = -I $(BSP_INC) -O2 -g

SRC = \
	src/string/api.c \
	src/ops/core_ops.c \
	src/ops/core_ops_switch.c \
	src/byteorder.c \
	src/string/charset.c \
	src/core_pmcs.c \
	src/datatypes.c \
	src/debug.c \
	src/dynext.c \
	src/embed.c \
	src/string/encoding.c \
	src/events.c \
	src/exceptions.c \
	src/exit.c \
	src/extend.c \
	src/extend_vtable.c \
	src/gc/alloc_memory.c \
	src/gc/api.c \
	src/gc/generational_ms.c \
	src/gc/incremental_ms.c \
	src/gc/gc_ms.c \
	src/gc/gc_inf.c \
	src/gc/mark_sweep.c \
	src/gc/system.c \
	src/global.c \
	src/global_setup.c \
	src/hash.c \
	src/hll.c \
	src/call/pcc.c \
	src/interp/inter_cb.c \
	src/interp/inter_create.c \
	src/interp/inter_misc.c \
	src/call/ops.c \
	src/call/context.c \
	src/key.c \
	src/library.c \
	src/list.c \
	src/longopt.c \
	src/misc.c \
	src/multidispatch.c \
	src/nci.c \
	src/oo.c \
	src/packfile.c \
	src/packout.c \
	src/pic_jit.c \
	src/pic.c \
	src/platform.c \
	src/pmc_freeze.c \
	src/pmc.c \
	src/runcore/main.c \
	src/runcore/cores.c \
	src/runcore/profiling.c \
	src/scheduler.c \
	src/spf_render.c \
	src/spf_vtable.c \
	src/string/primitives.c \
	src/sub.c \
	src/thread.c \
	src/runcore/trace.c \
	src/tsq.c \
	src/utils.c \
	src/vtables.c \
	src/warnings.c \
	src/packfile/pf_items.c \
	src/ops/core_ops_cg.c \
	src/ops/core_ops_cgp.c \
	src/gc/alloc_resources.c \
	src/string/charset/ascii.c \
	src/string/charset/binary.c \
	src/string/charset/iso-8859-1.c \
	src/string/charset/tables.c \
	src/string/charset/unicode.c \
	src/io/core.c \
	src/io/api.c \
	src/io/utf8.c \
	src/io/buffer.c \
	src/io/unix.c \
	src/io/win32.c \
	src/io/portable.c \
	src/io/filehandle.c \
	src/io/socket_api.c \
	src/io/socket_unix.c \
	src/io/socket_win32.c \
	src/pmc/default.c \
	src/pmc/null.c \
	src/pmc/env.c \
	src/pmc/key.c \
	src/pmc/unmanagedstruct.c \
	src/pmc/managedstruct.c \
	src/pmc/exception.c \
	src/pmc/parrotlibrary.c \
	src/pmc/parrotinterpreter.c \
	src/pmc/parrotthread.c \
	src/pmc/lexpad.c \
	src/pmc/timer.c \
	src/pmc/pointer.c \
	src/pmc/sub.c \
	src/pmc/continuation.c \
	src/pmc/retcontinuation.c \
	src/pmc/coroutine.c \
	src/pmc/eval.c \
	src/pmc/nci.c \
	src/pmc/float.c \
	src/pmc/integer.c \
	src/pmc/bigint.c \
	src/pmc/bignum.c \
	src/pmc/complex.c \
	src/pmc/string.c \
	src/pmc/boolean.c \
	src/pmc/array.c \
	src/pmc/fixedintegerarray.c \
	src/pmc/iterator.c \
	src/pmc/fixedstringarray.c \
	src/pmc/hash.c \
	src/pmc/orderedhash.c \
	src/pmc/os.c \
	src/pmc/file.c \
	src/pmc/addrregistry.c \
	src/pmc/arrayiterator.c \
	src/pmc/callsignature.c \
	src/pmc/capture.c \
	src/pmc/class.c \
	src/pmc/codestring.c \
	src/pmc/context.c \
	src/pmc/cpointer.c \
	src/pmc/eventhandler.c \
	src/pmc/exceptionhandler.c \
	src/pmc/exporter.c \
	src/pmc/filehandle.c \
	src/pmc/fixedbooleanarray.c \
	src/pmc/fixedfloatarray.c \
	src/pmc/fixedpmcarray.c \
	src/pmc/handle.c \
	src/pmc/hashiterator.c \
	src/pmc/hashiteratorkey.c \
	src/pmc/lexinfo.c \
	src/pmc/multisub.c \
	src/pmc/namespace.c \
	src/pmc/object.c \
	src/pmc/orderedhashiterator.c \
	src/pmc/packfile.c \
	src/pmc/packfileannotation.c \
	src/pmc/packfileannotations.c \
	src/pmc/packfileconstanttable.c \
	src/pmc/packfiledirectory.c \
	src/pmc/packfilefixupentry.c \
	src/pmc/packfilefixuptable.c \
	src/pmc/packfilerawsegment.c \
	src/pmc/packfilesegment.c \
	src/pmc/parrotrunningthread.c \
	src/pmc/pccmethod_test.c \
	src/pmc/pmcproxy.c \
	src/pmc/resizablebooleanarray.c \
	src/pmc/resizablefloatarray.c \
	src/pmc/resizableintegerarray.c \
	src/pmc/resizablepmcarray.c \
	src/pmc/resizablestringarray.c \
	src/pmc/role.c \
	src/pmc/scalar.c \
	src/pmc/scheduler.c \
	src/pmc/schedulermessage.c \
	src/pmc/sockaddr.c \
	src/pmc/socket.c \
	src/pmc/stringhandle.c \
	src/pmc/stringiterator.c \
	src/pmc/task.c \
	src/pmc/undef.c \
	src/string/encoding/fixed_8.c \
	src/string/encoding/ucs2.c \
	src/string/encoding/utf16.c \
	src/string/encoding/utf8.c \
	compilers/imcc/imcparser.c \
	compilers/imcc/imclexer.c \
	compilers/imcc/imc.c \
	compilers/imcc/main.c \
	compilers/imcc/symreg.c \
	compilers/imcc/instructions.c \
	compilers/imcc/cfg.c \
	compilers/imcc/reg_alloc.c \
	compilers/imcc/sets.c \
	compilers/imcc/debug.c \
	compilers/imcc/optimizer.c \
	compilers/imcc/pbc.c \
	compilers/imcc/parser_util.c \
	compilers/imcc/pcc.c

all: libparrot.a

libparrot.a: $(addsuffix .o, $(basenames $(SRC)))
	echo $(basenames $(SRC))
	$(AR) ar $?
