diff options
Diffstat (limited to 'hello_world_ada/Makefile.anybsp')
-rw-r--r-- | hello_world_ada/Makefile.anybsp | 55 |
1 files changed, 43 insertions, 12 deletions
diff --git a/hello_world_ada/Makefile.anybsp b/hello_world_ada/Makefile.anybsp index add3e36..2d6972f 100644 --- a/hello_world_ada/Makefile.anybsp +++ b/hello_world_ada/Makefile.anybsp @@ -1,44 +1,75 @@ # -# Makefile for hello world example -- any BSP without special help +# Makefile for Ada sockets example # -# Directly produces an executable for any BSP which directly runs +# Directly produces an executable for a BSP which directly runs # the format (usually ELF) produced by just linking an application. +# There are a couple of BSP families which require just a bit of +# assistance that this Makefile knows about -- gen5200 and pc386. # The executables produced by this Makefile should run on at least the # following BSPs: # arm/edb7312 +# i386/pc386 # mips/jmr3904 +# powerpc/icecube # powerpc/psim # powerpc/score603e # sparc/erc32 -# sparc/sis +# sparc/leon2 +# sparc/leon3 +# +# Some BSPs require extra manipulation of the ELF file before it can +# be run on the target hardware. # -MAIN=hello +PROGRAM=hello include $(RTEMS_MAKEFILE_PATH)/Makefile.inc - include $(RTEMS_CUSTOM) include $(PROJECT_ROOT)/make/leaf.cfg +# GEN5200 Specific Information ifeq ($(RTEMS_BSP_FAMILY),gen5200) -LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS) + LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS) +endif + +# PC386 Specific Information +ifeq ($(RTEMS_BSP_FAMILY),pc386) + HEADERADDR=0x00097E00 + START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin + START16ADDR=0x00097C00 + RELOCADDR=0x00100000 + LINKARGS+= -Wl,-Ttext,$(RELOCADDR) endif # Tool helpers -rtemsdir=${RTEMS_MAKEFILE_PATH} GNATMAKE=$(AS:as=gnatmake) -CARGS =-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) +CARGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) CARGS+=-DGNAT_MAIN_STACKSPACE=100 -all: init.o - $(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g \ +all: $(PROGRAM) + +$(PROGRAM): init.o *.adb + $(GNATMAKE) -v -O -gnata -gnatE -gnato $(@) -g \ + -I../src \ -bargs -Mgnat_main \ -largs $(CARGS) $(LINKARGS) init.o - $(SIZE) $(MAIN) + $(SIZE) $(@) +ifeq ($(RTEMS_BSP_FAMILY),pc386) + mv $(@) $(@).obj + $(OBJCOPY) -O elf32-i386 \ + --remove-section=.rodata \ + --remove-section=.comment \ + --remove-section=.note \ + --strip-unneeded $(@).obj $(@) + $(OBJCOPY) -O binary $(@).obj $(@).bin + $(RTEMS_MAKEFILE_PATH)/build-tools/bin2boot -v $(@).bt $(HEADERADDR) \ + $(START16FILE) $(START16ADDR) 0 $(@).bin $(RELOCADDR) 0 +else +endif init.o: init.c $(CC) $(CFLAGS) $(CPU_CFLAGS) -c init.c clean: - rm -f b~$(MAIN).* *.o *.ali $(MAIN) + rm -f b~*.* *.o *.ali $(EXAMPLES) rm -f *.num *.exe *.obj *.bin *.bt |