mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
sim: hw-config.h: move generation to top-level
In order to compile arch objects from the top-level, we need to generate the hw-config.h header, so move that logic up to the top level first.
This commit is contained in:
@ -1193,12 +1193,14 @@ CLEANFILES = common/version.c common/version.c-stamp \
|
|||||||
testsuite/common/bits32m31.c testsuite/common/bits64m0.c \
|
testsuite/common/bits32m31.c testsuite/common/bits64m0.c \
|
||||||
testsuite/common/bits64m63.c
|
testsuite/common/bits64m63.c
|
||||||
DISTCLEANFILES =
|
DISTCLEANFILES =
|
||||||
MOSTLYCLEANFILES = core $(am__append_7) site-sim-config.exp \
|
MOSTLYCLEANFILES = core $(common_HW_CONFIG_H_TARGETS) $(patsubst \
|
||||||
testrun.log testrun.sum $(am__append_15) $(am__append_19) \
|
%,%/stamp-hw,$(SIM_ENABLED_ARCHES)) $(am__append_7) \
|
||||||
$(am__append_24) $(am__append_28) $(am__append_35) \
|
site-sim-config.exp testrun.log testrun.sum $(am__append_15) \
|
||||||
$(am__append_40) $(am__append_44) $(am__append_48) \
|
$(am__append_19) $(am__append_24) $(am__append_28) \
|
||||||
$(am__append_52) $(am__append_57) $(am__append_65) \
|
$(am__append_35) $(am__append_40) $(am__append_44) \
|
||||||
$(am__append_70) $(am__append_79) $(am__append_82)
|
$(am__append_48) $(am__append_52) $(am__append_57) \
|
||||||
|
$(am__append_65) $(am__append_70) $(am__append_79) \
|
||||||
|
$(am__append_82)
|
||||||
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
|
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
|
||||||
AM_CPPFLAGS = $(INCGNU) -I$(srcroot)/include -I../bfd -I.. \
|
AM_CPPFLAGS = $(INCGNU) -I$(srcroot)/include -I../bfd -I.. \
|
||||||
$(SIM_HW_CFLAGS) $(SIM_INLINE) -I$(srcdir)/common \
|
$(SIM_HW_CFLAGS) $(SIM_INLINE) -I$(srcdir)/common \
|
||||||
@ -1207,12 +1209,13 @@ AM_CPPFLAGS_FOR_BUILD = -I$(srcroot)/include $(SIM_HW_CFLAGS) \
|
|||||||
$(SIM_INLINE) -I$(srcdir)/common
|
$(SIM_INLINE) -I$(srcdir)/common
|
||||||
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
|
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
|
||||||
LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
|
LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
|
||||||
SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_4) \
|
SIM_ALL_RECURSIVE_DEPS = common/libcommon.a \
|
||||||
$(am__append_14) $(am__append_17) $(am__append_23) \
|
$(common_HW_CONFIG_H_TARGETS) $(am__append_4) $(am__append_14) \
|
||||||
$(am__append_26) $(am__append_34) $(am__append_39) \
|
$(am__append_17) $(am__append_23) $(am__append_26) \
|
||||||
$(am__append_43) $(am__append_46) $(am__append_51) \
|
$(am__append_34) $(am__append_39) $(am__append_43) \
|
||||||
$(am__append_55) $(am__append_64) $(am__append_69) \
|
$(am__append_46) $(am__append_51) $(am__append_55) \
|
||||||
$(am__append_77) $(am__append_81)
|
$(am__append_64) $(am__append_69) $(am__append_77) \
|
||||||
|
$(am__append_81)
|
||||||
SIM_INSTALL_DATA_LOCAL_DEPS =
|
SIM_INSTALL_DATA_LOCAL_DEPS =
|
||||||
SIM_INSTALL_EXEC_LOCAL_DEPS = $(am__append_30)
|
SIM_INSTALL_EXEC_LOCAL_DEPS = $(am__append_30)
|
||||||
SIM_UNINSTALL_LOCAL_DEPS = $(am__append_31)
|
SIM_UNINSTALL_LOCAL_DEPS = $(am__append_31)
|
||||||
@ -1248,6 +1251,7 @@ SIM_NEW_COMMON_OBJS = sim-arange.o sim-bits.o sim-close.o \
|
|||||||
sim-signal.o sim-stop.o sim-syscall.o sim-trace.o sim-utils.o \
|
sim-signal.o sim-stop.o sim-syscall.o sim-trace.o sim-utils.o \
|
||||||
sim-watch.o $(am__append_2)
|
sim-watch.o $(am__append_2)
|
||||||
SIM_HW_DEVICES = cfi core pal glue
|
SIM_HW_DEVICES = cfi core pal glue
|
||||||
|
common_HW_CONFIG_H_TARGETS = $(patsubst %,%/hw-config.h,$(SIM_ENABLED_ARCHES))
|
||||||
LIBIBERTY_LIB = ../libiberty/libiberty.a
|
LIBIBERTY_LIB = ../libiberty/libiberty.a
|
||||||
BFD_LIB = ../bfd/libbfd.la
|
BFD_LIB = ../bfd/libbfd.la
|
||||||
OPCODES_LIB = ../opcodes/libopcodes.la
|
OPCODES_LIB = ../opcodes/libopcodes.la
|
||||||
@ -3163,6 +3167,23 @@ common/version.c-stamp: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(src
|
|||||||
$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(@:-stamp=)
|
$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(@:-stamp=)
|
||||||
$(AM_V_at)touch $@
|
$(AM_V_at)touch $@
|
||||||
|
|
||||||
|
# FIXME This is one very simple-minded way of generating the file hw-config.h.
|
||||||
|
%/hw-config.h: %/stamp-hw ; @true
|
||||||
|
%/stamp-hw: Makefile
|
||||||
|
$(AM_V_GEN)set -e; \
|
||||||
|
( \
|
||||||
|
sim_hw="$(SIM_HW_DEVICES) $($(@D)_SIM_EXTRA_HW_DEVICES)" ; \
|
||||||
|
echo "/* generated by Makefile */" ; \
|
||||||
|
printf "extern const struct hw_descriptor dv_%s_descriptor[];\n" $$sim_hw ; \
|
||||||
|
echo "const struct hw_descriptor * const hw_descriptors[] = {" ; \
|
||||||
|
printf " dv_%s_descriptor,\n" $$sim_hw ; \
|
||||||
|
echo " NULL," ; \
|
||||||
|
echo "};" \
|
||||||
|
) > $@.tmp; \
|
||||||
|
$(SHELL) $(srcroot)/move-if-change $@.tmp $(@D)/hw-config.h; \
|
||||||
|
touch $@
|
||||||
|
.PRECIOUS: %/stamp-hw
|
||||||
|
|
||||||
# Alias for developers.
|
# Alias for developers.
|
||||||
@SIM_ENABLE_IGEN_TRUE@igen: $(IGEN)
|
@SIM_ENABLE_IGEN_TRUE@igen: $(IGEN)
|
||||||
|
|
||||||
|
@ -197,7 +197,6 @@ endif
|
|||||||
all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
|
all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
|
||||||
generated_files = \
|
generated_files = \
|
||||||
$(SIM_EXTRA_DEPS) \
|
$(SIM_EXTRA_DEPS) \
|
||||||
hw-config.h \
|
|
||||||
modules.c
|
modules.c
|
||||||
|
|
||||||
# Ensure that generated files are created early. Use order-only
|
# Ensure that generated files are created early. Use order-only
|
||||||
@ -212,22 +211,6 @@ endif
|
|||||||
# Dependencies.
|
# Dependencies.
|
||||||
-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
|
-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
|
||||||
|
|
||||||
# FIXME This is one very simple-minded way of generating the file hw-config.h
|
|
||||||
hw-config.h: stamp-hw ; @true
|
|
||||||
stamp-hw: Makefile.in $(srccom)/Make-common.in $(config.status) Makefile
|
|
||||||
$(ECHO_STAMP) hw-config.h
|
|
||||||
$(SILENCE) ( \
|
|
||||||
sim_hw="$(SIM_HW_DEVICES)" ; \
|
|
||||||
echo "/* generated by Makefile */" ; \
|
|
||||||
printf "extern const struct hw_descriptor dv_%s_descriptor[];\n" $$sim_hw ; \
|
|
||||||
echo "const struct hw_descriptor * const hw_descriptors[] = {" ; \
|
|
||||||
printf " dv_%s_descriptor,\n" $$sim_hw ; \
|
|
||||||
echo " NULL," ; \
|
|
||||||
echo "};" \
|
|
||||||
) > tmp-hw.h
|
|
||||||
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw-config.h
|
|
||||||
$(SILENCE) touch $@
|
|
||||||
|
|
||||||
test-hw-events: $(srccom)/hw-events.c libsim.a
|
test-hw-events: $(srccom)/hw-events.c libsim.a
|
||||||
$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
|
$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
|
||||||
$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
|
$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
|
||||||
@ -290,7 +273,6 @@ TAGS: force
|
|||||||
mostlyclean clean: $(SIM_EXTRA_CLEAN)
|
mostlyclean clean: $(SIM_EXTRA_CLEAN)
|
||||||
rm -f *.[oa] *~ core \
|
rm -f *.[oa] *~ core \
|
||||||
run$(EXEEXT) libsim.a \
|
run$(EXEEXT) libsim.a \
|
||||||
hw-config.h stamp-hw \
|
|
||||||
modules.c stamp-modules \
|
modules.c stamp-modules \
|
||||||
tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
|
tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
|
||||||
|
|
||||||
|
@ -110,6 +110,27 @@ SIM_NEW_COMMON_OBJS += \
|
|||||||
AM_MAKEFLAGS += SIM_HW_DEVICES_="$(SIM_HW_DEVICES)"
|
AM_MAKEFLAGS += SIM_HW_DEVICES_="$(SIM_HW_DEVICES)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# FIXME This is one very simple-minded way of generating the file hw-config.h.
|
||||||
|
%/hw-config.h: %/stamp-hw ; @true
|
||||||
|
%/stamp-hw: Makefile
|
||||||
|
$(AM_V_GEN)set -e; \
|
||||||
|
( \
|
||||||
|
sim_hw="$(SIM_HW_DEVICES) $($(@D)_SIM_EXTRA_HW_DEVICES)" ; \
|
||||||
|
echo "/* generated by Makefile */" ; \
|
||||||
|
printf "extern const struct hw_descriptor dv_%s_descriptor[];\n" $$sim_hw ; \
|
||||||
|
echo "const struct hw_descriptor * const hw_descriptors[] = {" ; \
|
||||||
|
printf " dv_%s_descriptor,\n" $$sim_hw ; \
|
||||||
|
echo " NULL," ; \
|
||||||
|
echo "};" \
|
||||||
|
) > $@.tmp; \
|
||||||
|
$(SHELL) $(srcroot)/move-if-change $@.tmp $(@D)/hw-config.h; \
|
||||||
|
touch $@
|
||||||
|
.PRECIOUS: %/stamp-hw
|
||||||
|
|
||||||
|
%C%_HW_CONFIG_H_TARGETS = $(patsubst %,%/hw-config.h,$(SIM_ENABLED_ARCHES))
|
||||||
|
MOSTLYCLEANFILES += $(%C%_HW_CONFIG_H_TARGETS) $(patsubst %,%/stamp-hw,$(SIM_ENABLED_ARCHES))
|
||||||
|
SIM_ALL_RECURSIVE_DEPS += $(%C%_HW_CONFIG_H_TARGETS)
|
||||||
|
|
||||||
LIBIBERTY_LIB = ../libiberty/libiberty.a
|
LIBIBERTY_LIB = ../libiberty/libiberty.a
|
||||||
BFD_LIB = ../bfd/libbfd.la
|
BFD_LIB = ../bfd/libbfd.la
|
||||||
OPCODES_LIB = ../opcodes/libopcodes.la
|
OPCODES_LIB = ../opcodes/libopcodes.la
|
||||||
|
Reference in New Issue
Block a user