#
# CONFIG.Common.RTEMS-beatnik
# Author: Dayle Kotturi <dayle@slac.stanford.edu>
#
# All RTEMS targets use the same Makefile fragment
#
EXE = .elf
RTEMS_BSP = beatnik
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120

MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
	$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef

include $(CONFIG)/os/CONFIG.Common.RTEMS

RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)

%.sym: %$(EXE)
	$(XSYMS) $^ $@

%.bin: %$(EXE)
	$(OBJCOPY) -Obinary $^ $@

#PRODTARGETS+=$(INSTALL_RTEMSSYMS) $(INSTALL_RTEMSIMGS)
