Changeset fa0533a in rtems for make/custom


Ignore:
Timestamp:
12/17/07 00:35:52 (16 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
ba72882
Parents:
2eeb648c
Message:

2007-12-17 Chris Johns <chrisj@…>

  • custom/mcf5235.cfg, custom/mrm332.cfg, custom/pc386.cfg: Split the make-exe and make-cxx-exe into bsp-link-c, bsp-link-cxx and bsp-post-link make macros. This allow external autotools support.
Location:
make/custom
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • make/custom/mcf5235.cfg

    r2eeb648c rfa0533a  
    3333# is currently required.
    3434
     35define bsp-link-c
     36        $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \
     37            -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
     38endef
     39
     40define bsp-link-cxx
     41        $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \
     42            -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
     43endef
     44
     45define bsp-post-link
     46        $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) $(basename $@).nxe
     47        $(SIZE) $(basename $@)$(EXEEXT)
     48endef
     49
    3550define make-exe
    36         $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \
    37             -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS)
    38         $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@
    39         $(SIZE) $(basename $@).nxe
     51       $(bsp-link-c)
     52       $(bsp-post-link)
    4053endef
     54
    4155define make-cxx-exe
    42         $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \
    43             -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS)
    44         $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@
    45         $(SIZE) $(basename $@).nxe
     56       $(bsp-link-cxx)
     57       $(bsp-post-link)
    4658endef
    4759
  • make/custom/mrm332.cfg

    r2eeb648c rfa0533a  
    2727# in the image.
    2828CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM
     29endif
    2930
    3031#  This is a good way to get debug information.  The output file is large
    3132#  though and greatly slows the build process so only do this if needed.
    3233#       $(OBJDUMP) -dxC $(basename $@).nxe > $(basename $@).dump
     34#
     35#  chrisj: This is questionable. Why not keep unstipped ELF files
     36#          about the use objdump and nm to get at the debug
     37#          information rather than subject everyone to this.
     38#
    3339
    34 define make-exe
    35         $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).pxe \
     40define bsp-link-c
     41        $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@)$(EXEEXT) \
    3642            $(LINK_OBJS) $(LINK_LIBS)
     43endef
     44define bsp-link-cxx
     45        $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@)$(EXEEXT) \
     46            $(LINK_OBJS) $(LINK_LIBS)
     47endef
     48
     49ifeq ($(MRM_IN_ROM),yes)
     50define bsp-post-link
    3751        $(OBJCOPY) --adjust-section-vma \
    3852          .data=`m68k-rtems-objdump --section-headers $(basename $@).pxe | \
     
    4458                /\.text/ { base = $$4 ; size = $$3 };\
    4559                END { printf("0x%x", h2d(base) + h2d(size)) }'\
    46                ` $(basename $@).pxe $(basename $@).nxe
    47         $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec
     60               ` $(basename $@).pxe $(basename $@)$(EXEEXT)
     61        $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec
    4862        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
    49             $(PACKHEX) > $(basename $@).exe
     63            $(PACKHEX) > $(basename $@).nxe
    5064        $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum
    5165        $(NM) -g -n $(basename $@).nxe > $(basename $@).num
    52         $(SIZE) $(basename $@).nxe
     66        $(SIZE) $(basename $@)$(EXEEXT)
    5367endef
    5468else
    55 define make-exe
    56         $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \
    57             $(LINK_OBJS) $(LINK_LIBS)
    58         $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec
     69define bsp-post-link
     70        $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec
    5971#       m68k-rtems-objdump -dxC $(basename $@).nxe > $(basename $@).dump
    6072        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
    61             $(PACKHEX) > $(basename $@).exe
    62         $(NM) -g -n $(basename $@).nxe > $(basename $@).num
    63         $(SIZE) $(basename $@).nxe
     73            $(PACKHEX) > $(basename $@).nxe
     74        $(NM) -g -n $(basename $@)$(EXEEXT) > $(basename $@).num
     75        $(SIZE) $(basename $@)$(EXEEXT)
    6476endef
    6577endif
    6678
     79define make-exe
     80       $(bsp-link-c)
     81       $(bsp-post-link)
     82endef
     83
     84define make-cxx-exe
     85       $(bsp-link-cxx)
     86       $(bsp-post-link)
     87endef
     88
    6789# Miscellaneous additions go here
  • make/custom/pc386.cfg

    r2eeb648c rfa0533a  
    4646# is currently required.
    4747
    48 define make-exe
     48define bsp-link-c
    4949        $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
    50             -o $(basename $@).nxe \
     50            -o $(basename $@)$(EXEEXT) \
    5151            $(LINK_OBJS) $(LINK_LIBS)
     52endef
     53
     54define bsp-link-cxx
     55        $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
     56            -o $(basename $@)$(EXEEXT) \
     57            $(LINK_OBJS) $(LINK_LIBS)
     58endef
     59
     60define bsp-post-link
    5261        $(OBJCOPY) -O elf32-i386 \
    5362            --remove-section=.rodata \
    5463            --remove-section=.comment \
    5564            --remove-section=.note \
    56             --strip-unneeded $(basename $@).nxe $@
     65            --strip-unneeded $(basename $@)$(EXEEXT) $(basename $@).nxe
    5766        $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
    5867        $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
     
    7079#           -o $@ $(LINK_OBJS) $(LINK_LIBS)
    7180endef
     81
     82define make-exe
     83       $(bsp-link-c)
     84       $(bsp-post-link)
     85endef
     86
    7287define make-cxx-exe
    73         $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \
    74            -Wl,-Ttext,$(RELOCADDR) -o $(basename $@).nxe \
    75             $(LINK_OBJS) $(LINK_LIBS)
    76         $(OBJCOPY) -O elf32-i386 \
    77             --remove-section=.rodata \
    78             --remove-section=.comment \
    79             --remove-section=.note \
    80             --strip-unneeded $(basename $@).nxe $@
    81         $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
    82         $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
    83           $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
    84         $(NM) -g -n $(basename $@).nxe > $(basename $@).num
    85         $(SIZE) $(basename $@).nxe
     88       $(bsp-link-cxx)
     89       $(bsp-post-link)
    8690endef
    8791
Note: See TracChangeset for help on using the changeset viewer.