From cd3ee89d386d37b5b4db34427f5e1dd9e0f63ad2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 6 Jul 2021 23:44:38 -0400 Subject: [PATCH] sim: unify callback.o building Now that the use of TARGET_xxx defines have been removed, we can move this to the common logic so we only build it once for multi-targets. --- sim/Makefile.in | 19 +++++++++++++++++++ sim/common/Make-common.in | 3 ++- sim/common/local.mk | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sim/Makefile.in b/sim/Makefile.in index f6bf4168ad1..1cea0604fd7 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -251,6 +251,7 @@ common_libcommon_a_AR = $(AR) $(ARFLAGS) common_libcommon_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_common_libcommon_a_OBJECTS = \ + common/common_libcommon_a-callback.$(OBJEXT) \ common/common_libcommon_a-portability.$(OBJEXT) \ common/common_libcommon_a-sim-load.$(OBJEXT) \ common/common_libcommon_a-target-newlib-errno.$(OBJEXT) \ @@ -844,6 +845,7 @@ common_libcommon_a_CPPFLAGS = \ -I.. common_libcommon_a_SOURCES = \ + common/callback.c \ common/portability.c \ common/sim-load.c \ common/target-newlib-errno.c \ @@ -1017,6 +1019,8 @@ common/$(am__dirstamp): common/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) common/$(DEPDIR) @: > common/$(DEPDIR)/$(am__dirstamp) +common/common_libcommon_a-callback.$(OBJEXT): common/$(am__dirstamp) \ + common/$(DEPDIR)/$(am__dirstamp) common/common_libcommon_a-portability.$(OBJEXT): \ common/$(am__dirstamp) common/$(DEPDIR)/$(am__dirstamp) common/common_libcommon_a-sim-load.$(OBJEXT): common/$(am__dirstamp) \ @@ -1147,6 +1151,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-portability.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-target-newlib-errno.Po@am__quote@ @@ -1202,6 +1207,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +common/common_libcommon_a-callback.o: common/callback.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-callback.o -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-callback.Tpo -c -o common/common_libcommon_a-callback.o `test -f 'common/callback.c' || echo '$(srcdir)/'`common/callback.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-callback.Tpo common/$(DEPDIR)/common_libcommon_a-callback.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/callback.c' object='common/common_libcommon_a-callback.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-callback.o `test -f 'common/callback.c' || echo '$(srcdir)/'`common/callback.c + +common/common_libcommon_a-callback.obj: common/callback.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-callback.obj -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-callback.Tpo -c -o common/common_libcommon_a-callback.obj `if test -f 'common/callback.c'; then $(CYGPATH_W) 'common/callback.c'; else $(CYGPATH_W) '$(srcdir)/common/callback.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-callback.Tpo common/$(DEPDIR)/common_libcommon_a-callback.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/callback.c' object='common/common_libcommon_a-callback.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-callback.obj `if test -f 'common/callback.c'; then $(CYGPATH_W) 'common/callback.c'; else $(CYGPATH_W) '$(srcdir)/common/callback.c'; fi` + common/common_libcommon_a-portability.o: common/portability.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-portability.o -MD -MP -MF common/$(DEPDIR)/common_libcommon_a-portability.Tpo -c -o common/common_libcommon_a-portability.o `test -f 'common/portability.c' || echo '$(srcdir)/'`common/portability.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/common_libcommon_a-portability.Tpo common/$(DEPDIR)/common_libcommon_a-portability.Po diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index e5c3484c047..4c830591764 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -229,6 +229,7 @@ EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \ $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) COMMON_OBJS_NAMES = \ + callback.o \ portability.o \ sim-load.o \ target-newlib-errno.o \ @@ -237,7 +238,7 @@ COMMON_OBJS_NAMES = \ 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) +LIB_OBJS = modules.o syscall.o targ-map.o $(COMMON_OBJS) $(SIM_OBJS) COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ diff --git a/sim/common/local.mk b/sim/common/local.mk index fdbdca444b3..2fd78264ba1 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -34,6 +34,7 @@ noinst_LIBRARIES += %D%/libcommon.a -I../bfd \ -I.. %C%_libcommon_a_SOURCES = \ + %D%/callback.c \ %D%/portability.c \ %D%/sim-load.c \ %D%/target-newlib-errno.c \ -- 2.30.2