From 46255e607a386855c91c4ca5506a203a24b0b3a0 Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Tue, 28 Sep 2004 20:38:01 +0000 Subject: [PATCH] Redo the way 'munch' commands are handled. Provide 'munch' command to build executable for RTEMS MVME2100 target. --- configure/CONFIG_COMMON | 4 ++-- configure/RULES_BUILD | 6 +++--- configure/os/CONFIG.Common.RTEMS | 2 +- configure/os/CONFIG.Common.RTEMS-mvme2100 | 18 +++++++++++++++++- configure/os/CONFIG.Common.vxWorksCommon | 1 + configure/os/CONFIG.win32-x86.win32-x86 | 2 +- configure/os/CONFIG_SITE.Common.darwin-ppc | 2 +- configure/os/CONFIG_SITE.Common.linux-x86 | 1 + configure/os/CONFIG_SITE.Common.solaris-sparc | 3 +-- configure/os/CONFIG_SITE.linux-x86.Common | 1 + configure/os/CONFIG_SITE.solaris-sparc.Common | 1 + 11 files changed, 30 insertions(+), 11 deletions(-) diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index 89d4d5866..adba21cbf 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -284,8 +284,8 @@ ARFLAGS = ARCMD = $(AR) $(ARFLAGS) $(USR_ARFLAGS) $@ $(LIBRARY_LD_OBJS) #-------------------------------------------------- -# ld default -LDCMD = $(LD) -o $@ $^ +# 'Munch' link-edit +MUNCH_CMD = $(LD) -o $@ $^ #-------------------------------------------------- # Build compile line here diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index d95b26318..cbe5f07e5 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -287,13 +287,13 @@ $(LOADABLE_SHRLIBNAME):$(LOADABLE_SHRLIB_PREFIX)%$(LOADABLE_SHRLIB_SUFFIX): $(LI @$(RM) $@ $(PERL) $(TOOLS)/munch.pl < $< > $@ -$(MUNCHNAME):%.munch : %_ctdt$(OBJ) %$(EXE) +$(MUNCHNAME):%$(MUNCH_SUFFIX) : $(MUNCH_DEPENDS) %$(EXE) @$(RM) $@ - $(LDCMD) + $(MUNCH_CMD) $(OBJLIB_MUNCHNAME):%.munch : %_ctdt$(OBJ) %$(OBJ) @$(RM) $@ - $(LDCMD) + $(MUNCH_CMD) # Ext, app and module rules RULES_INCLUDE CONFIG_APP_INCLUDE: $(wildcard $(TOP)/configure/RELEASE*) diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS index 59b3abb8c..d4a485202 100644 --- a/configure/os/CONFIG.Common.RTEMS +++ b/configure/os/CONFIG.Common.RTEMS @@ -46,7 +46,7 @@ VALID_BUILDS = Ioc # through the following contortions to get the EPICS flags back. CFLAGS = $(CONFORM_CFLAGS) $(CROSS_CFLAGS) $(OPT_CFLAGS) $(DEBUG_CFLAGS)\ $(WARN_CFLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS)\ - $(CODE_CFLAGS) $(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS) + $(CODE_CFLAGS) $(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS) CXXFLAGS = $(CONFORM_CXXFLAGS) $(CROSS_CXXFLAGS) $(OPT_CXXFLAGS)\ $(DEBUG_CXXFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS)\ diff --git a/configure/os/CONFIG.Common.RTEMS-mvme2100 b/configure/os/CONFIG.Common.RTEMS-mvme2100 index 85edbf4ad..3827db606 100644 --- a/configure/os/CONFIG.Common.RTEMS-mvme2100 +++ b/configure/os/CONFIG.Common.RTEMS-mvme2100 @@ -6,6 +6,22 @@ # # All RTEMS targets use the same Makefile fragment # -RTEMS_TARGET_CPU=powerpc +RTEMS_TARGET_CPU = powerpc ARCH_DEP_CFLAGS += -DHAVE_PPCBUG + +MUNCH_SUFFIX = .boot +MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX)) +define MUNCH_CMD + $(RTEMS_BASE)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems + gzip -f9 rtems + $(RTEMS_BASE)/bin/$(LD_FOR_TARGET) -o $@ \ + $(PROJECT_RELEASE)/lib/bootloader.o \ + --just-symbols=$< \ + -b binary rtems.gz \ + -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ + -Map $<.map + rm -f rtems.gz +endef + include $(CONFIG)/os/CONFIG.Common.RTEMS +OP_SYS_LDLIBS += -lrtemsNfs diff --git a/configure/os/CONFIG.Common.vxWorksCommon b/configure/os/CONFIG.Common.vxWorksCommon index 4d23868d8..f3925ae08 100644 --- a/configure/os/CONFIG.Common.vxWorksCommon +++ b/configure/os/CONFIG.Common.vxWorksCommon @@ -49,6 +49,7 @@ MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX)) CTDT_SRCS = $(PRODNAME:%$(EXE)=%_ctdt.c) CTDT_OBJS = $(PRODNAME:%$(EXE)=%_ctdt$(OBJ)) NMS = $(PRODNAME:%$(EXE)=%.nm) +MUNCH_DEPENDS = %_ctdt$(OBJ) #------------------------------------------------------- # R3.13 compatability object library definitions diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index ce7660b07..9a6acb06f 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -215,7 +215,7 @@ DLL_DEF_FLAG = $(addprefix /def:,$(wildcard ../$(addsuffix .def,$*))) # LINK.shrlib = $(WINLINK) /nologo $(WIN32_DLLFLAGS) /implib:$*.lib /out:$*.dll $(DLL_DEF_FLAG) LINK.shrlib += $(LIBRARY_LD_OBJS) $(LIBRARY_LD_RESS) $(SHRLIB_LDLIBS) -LDCMD = $(CCC) /Fo $@ $^ +MUNCH_CMD = $(CCC) /Fo $@ $^ # adjust names of libraries to build diff --git a/configure/os/CONFIG_SITE.Common.darwin-ppc b/configure/os/CONFIG_SITE.Common.darwin-ppc index 5a2868b7c..3c72164fa 100644 --- a/configure/os/CONFIG_SITE.Common.darwin-ppc +++ b/configure/os/CONFIG_SITE.Common.darwin-ppc @@ -9,5 +9,5 @@ # # Other local options # -#OP_SYS_CFLAGS += -g +OP_SYS_CFLAGS += -g #COMMANDLINE_LIBRARY = READLINE diff --git a/configure/os/CONFIG_SITE.Common.linux-x86 b/configure/os/CONFIG_SITE.Common.linux-x86 index 139d744f8..9bc519cb7 100644 --- a/configure/os/CONFIG_SITE.Common.linux-x86 +++ b/configure/os/CONFIG_SITE.Common.linux-x86 @@ -20,3 +20,4 @@ # If readline is not installed comment the following line # to omit command-line editing and history support COMMANDLINE_LIBRARY = READLINE +OP_SYS_CFLAGS += -g diff --git a/configure/os/CONFIG_SITE.Common.solaris-sparc b/configure/os/CONFIG_SITE.Common.solaris-sparc index a12a47d7e..3140b3d99 100644 --- a/configure/os/CONFIG_SITE.Common.solaris-sparc +++ b/configure/os/CONFIG_SITE.Common.solaris-sparc @@ -8,5 +8,4 @@ # If readline is installed uncomment the following macro definition # to include command-line editing and history support # -#COMMANDLINE_LIBRARY = READLINE - +COMMANDLINE_LIBRARY = READLINE diff --git a/configure/os/CONFIG_SITE.linux-x86.Common b/configure/os/CONFIG_SITE.linux-x86.Common index 0fb27741f..f060d7d39 100644 --- a/configure/os/CONFIG_SITE.linux-x86.Common +++ b/configure/os/CONFIG_SITE.linux-x86.Common @@ -9,3 +9,4 @@ # JBA test override values #CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc #CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 +CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100 # RTEMS-mvme167 diff --git a/configure/os/CONFIG_SITE.solaris-sparc.Common b/configure/os/CONFIG_SITE.solaris-sparc.Common index e466ea1cd..42e3ca425 100644 --- a/configure/os/CONFIG_SITE.solaris-sparc.Common +++ b/configure/os/CONFIG_SITE.solaris-sparc.Common @@ -7,3 +7,4 @@ #INSTALL_LOCATION = /home/phoebus/JBA/testBaseNew +CROSS_COMPILER_TARGET_ARCHS += vxWorks-ppc604 vxWorks-ppc603 vxWorks-68040