sim: unify sim-load.o building
authorMike Frysinger <vapier@gentoo.org>
Mon, 7 Jun 2021 05:48:06 +0000 (01:48 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 13 Jun 2021 03:49:41 +0000 (23:49 -0400)
Since this file does not rely on any port-specific settings, move it
up to building as part of the common step so we only do it once in a
multibuild.

sim/ChangeLog
sim/Makefile.in
sim/common/ChangeLog
sim/common/Make-common.in
sim/common/defs.h
sim/common/local.mk

index b90b13a0760ec769116d97421dac040e4e0c14a9..063469c653e0f1b4792b3ab7bd2227eea127919b 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * Makefile.in: Regenerate.
+
 2021-06-12  Mike Frysinger  <vapier@gentoo.org>
 
        * m4/sim_ac_platform.m4: Delete sys/select.h.
index 290268cfba2b71dff8647f53b8b896739a069df8..dbfde78da597bb26ff9da4c2a68e88d2bb909e80 100644 (file)
@@ -227,7 +227,9 @@ am__v_AR_1 =
 common_libcommon_a_AR = $(AR) $(ARFLAGS)
 common_libcommon_a_LIBADD =
 am__dirstamp = $(am__leading_dot)dirstamp
-am_common_libcommon_a_OBJECTS = common/version.$(OBJEXT)
+am_common_libcommon_a_OBJECTS =  \
+       common/common_libcommon_a-sim-load.$(OBJEXT) \
+       common/common_libcommon_a-version.$(OBJEXT)
 common_libcommon_a_OBJECTS = $(am_common_libcommon_a_OBJECTS)
 igen_libigen_a_AR = $(AR) $(ARFLAGS)
 igen_libigen_a_LIBADD =
@@ -329,6 +331,10 @@ DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 AM_V_CC = $(am__v_CC_@AM_V@)
@@ -743,7 +749,14 @@ pkginclude_HEADERS = \
        $(srcroot)/include/sim/callback.h \
        $(srcroot)/include/sim/sim.h
 
+common_libcommon_a_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DSIM_COMMON_BUILD \
+       -I../bfd \
+       -I..
+
 common_libcommon_a_SOURCES = \
+       common/sim-load.c \
        common/version.c
 
 @SIM_ENABLE_IGEN_TRUE@igen_libigen_a_SOURCES = \
@@ -858,7 +871,9 @@ common/$(am__dirstamp):
 common/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) common/$(DEPDIR)
        @: > common/$(DEPDIR)/$(am__dirstamp)
-common/version.$(OBJEXT): common/$(am__dirstamp) \
+common/common_libcommon_a-sim-load.$(OBJEXT): common/$(am__dirstamp) \
+       common/$(DEPDIR)/$(am__dirstamp)
+common/common_libcommon_a-version.$(OBJEXT): common/$(am__dirstamp) \
        common/$(DEPDIR)/$(am__dirstamp)
 
 common/libcommon.a: $(common_libcommon_a_OBJECTS) $(common_libcommon_a_DEPENDENCIES) $(EXTRA_common_libcommon_a_DEPENDENCIES) common/$(am__dirstamp)
@@ -972,7 +987,8 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-sim-load.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-version.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/filter.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/filter_host.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/gen-engine.Po@am__quote@
@@ -1013,6 +1029,34 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+common/common_libcommon_a-sim-load.o: common/sim-load.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common/common_libcommon_a-sim-load.o -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-sim-load.Tpo -c -o common/common_libcommon_a-sim-load.o `test -f 'common/sim-load.c' || echo '$(srcdir)/'`common/sim-load.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-sim-load.Tpo common/$(DEPDIR)/common_libcommon_a-sim-load.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common/sim-load.c' object='common/common_libcommon_a-sim-load.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common/common_libcommon_a-sim-load.o `test -f 'common/sim-load.c' || echo '$(srcdir)/'`common/sim-load.c
+
+common/common_libcommon_a-sim-load.obj: common/sim-load.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common/common_libcommon_a-sim-load.obj -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-sim-load.Tpo -c -o common/common_libcommon_a-sim-load.obj `if test -f 'common/sim-load.c'; then $(CYGPATH_W) 'common/sim-load.c'; else $(CYGPATH_W) '$(srcdir)/common/sim-load.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-sim-load.Tpo common/$(DEPDIR)/common_libcommon_a-sim-load.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common/sim-load.c' object='common/common_libcommon_a-sim-load.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common/common_libcommon_a-sim-load.obj `if test -f 'common/sim-load.c'; then $(CYGPATH_W) 'common/sim-load.c'; else $(CYGPATH_W) '$(srcdir)/common/sim-load.c'; fi`
+
+common/common_libcommon_a-version.o: common/version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common/common_libcommon_a-version.o -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-version.Tpo -c -o common/common_libcommon_a-version.o `test -f 'common/version.c' || echo '$(srcdir)/'`common/version.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-version.Tpo common/$(DEPDIR)/common_libcommon_a-version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common/version.c' object='common/common_libcommon_a-version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common/common_libcommon_a-version.o `test -f 'common/version.c' || echo '$(srcdir)/'`common/version.c
+
+common/common_libcommon_a-version.obj: common/version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common/common_libcommon_a-version.obj -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-version.Tpo -c -o common/common_libcommon_a-version.obj `if test -f 'common/version.c'; then $(CYGPATH_W) 'common/version.c'; else $(CYGPATH_W) '$(srcdir)/common/version.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-version.Tpo common/$(DEPDIR)/common_libcommon_a-version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common/version.c' object='common/common_libcommon_a-version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(common_libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common/common_libcommon_a-version.obj `if test -f 'common/version.c'; then $(CYGPATH_W) 'common/version.c'; else $(CYGPATH_W) '$(srcdir)/common/version.c'; fi`
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
        @$(NORMAL_INSTALL)
        @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
index 19e93bbe492dc9b8edca103d1590737582e02b92..5d713c63bf4ff29f1c03b8c4debdf986e1462288 100644 (file)
@@ -1,3 +1,12 @@
+2021-06-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * Make-common.in (SIM_NEW_COMMON_OBJS): Move sim-load.o to ...
+       (COMMON_OBJS_NAMES): ... here.  Rename var from COMMON_OBJS.
+       (COMMON_OBJS): Redefine.
+       * defs.h [SIM_COMMON_BUILD]: Do not include ../config.h.
+       * local.mk (%C%_libcommon_a_CPPFLAGS): New variable.
+       (%C%_libcommon_a_SOURCES): Add %D%/sim-load.c.
+
 2021-06-12  Mike Frysinger  <vapier@gentoo.org>
 
        * dv-sockser.c: Include sys/select.h.
index 999b1eea00a95ca640809167fea7f3d1e8b2ec60..8454d165830f0e7b5d4174228d81e764c882789c 100644 (file)
@@ -179,7 +179,6 @@ SIM_NEW_COMMON_OBJS = \
        sim-hrw.o \
        sim-io.o \
        sim-info.o \
-       sim-load.o \
        sim-memopt.o \
        sim-model.o \
        sim-module.o \
@@ -254,7 +253,10 @@ LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB)
 EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
        $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
 
-COMMON_OBJS = ../common/version.o
+COMMON_OBJS_NAMES = \
+       sim-load.o \
+       version.o
+COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
 
 LIB_OBJS = callback.o modules.o syscall.o targ-map.o $(COMMON_OBJS) $(SIM_OBJS)
 
index 4b5da7bfa3696248b7d13b8d055a700efde2d399..21ad2a44d3ba94a4539ff06cd6a85422b4cf4170 100644 (file)
@@ -37,6 +37,8 @@
 /* Include arch-specific sim's various configure tests.  */
 #include "config.h"
 
+#ifndef SIM_COMMON_BUILD
+
 /* Reset macros that our config.h will provide.  */
 #undef PACKAGE
 #undef PACKAGE_BUGREPORT
@@ -52,3 +54,5 @@
 #endif
 
 #endif
+
+#endif
index 357be755578ff28f02df3fe720e831a8a0796d35..a340febfcdd1973c74a0ae4a6b017ac089d5e61a 100644 (file)
@@ -28,7 +28,13 @@ SIM_ALL_RECURSIVE_DEPS += \
 # NB: libcommon.a isn't used directly by ports.  We need a target for common
 # objects to be a part of, and ports use the individual objects directly.
 noinst_LIBRARIES += %D%/libcommon.a
+%C%_libcommon_a_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DSIM_COMMON_BUILD \
+       -I../bfd \
+       -I..
 %C%_libcommon_a_SOURCES = \
+       %D%/sim-load.c \
        %D%/version.c
 
 %D%/version.c: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcdir)/%D%/create-version.sh