|
|
|
@ -45,6 +45,12 @@ srcsim = $(srcdir)/.. |
|
|
|
|
|
|
|
include $(srcroot)/gdb/silent-rules.mk |
|
|
|
|
|
|
|
ifeq ($(V),0) |
|
|
|
ECHO_STAMP = @echo " GEN " |
|
|
|
else |
|
|
|
ECHO_STAMP = @: |
|
|
|
endif |
|
|
|
|
|
|
|
# Helper code from gnulib. |
|
|
|
GNULIB_PARENT_DIR = ../.. |
|
|
|
include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc |
|
|
|
@ -240,7 +246,7 @@ remote_sim_h = $(srcroot)/include/sim/sim.h |
|
|
|
all: libsim.a run$(EXEEXT) .gdbinit |
|
|
|
|
|
|
|
libsim.a: $(LIB_OBJS) |
|
|
|
rm -f libsim.a |
|
|
|
$(SILENCE) rm -f libsim.a |
|
|
|
$(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS) |
|
|
|
$(ECHO_RANLIB) $(RANLIB) libsim.a |
|
|
|
|
|
|
|
@ -261,10 +267,11 @@ gentmap: gentmap.o |
|
|
|
|
|
|
|
targ-vals.h targ-map.c: stamp-tvals |
|
|
|
stamp-tvals: gentmap |
|
|
|
rm -f tmp-tvals.h tmp-tmap.c |
|
|
|
./gentmap -h >tmp-tvals.h |
|
|
|
$(ECHO_STAMP) targ-vals.h |
|
|
|
$(SILENCE) ./gentmap -h >tmp-tvals.h |
|
|
|
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-tvals.h targ-vals.h |
|
|
|
./gentmap -c >tmp-tmap.c |
|
|
|
$(ECHO_STAMP) targ-tmap.c |
|
|
|
$(SILENCE) ./gentmap -c >tmp-tmap.c |
|
|
|
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-tmap.c targ-map.c |
|
|
|
$(SILENCE) touch $@ |
|
|
|
|
|
|
|
@ -411,19 +418,16 @@ 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.in $(srccom)/Make-common.in $(config.status) Makefile |
|
|
|
rm -f tmp-hw.h |
|
|
|
echo "/* generated by Makefile */" > tmp-hw.h |
|
|
|
sim_hw="$(SIM_HW_DEVICES)"; \ |
|
|
|
for hw in $$sim_hw ; do \ |
|
|
|
echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \ |
|
|
|
done >> tmp-hw.h |
|
|
|
echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h |
|
|
|
sim_hw="$(SIM_HW_DEVICES)"; \ |
|
|
|
for hw in $$sim_hw ; do \ |
|
|
|
echo " dv_$${hw}_descriptor," ; \ |
|
|
|
done >> tmp-hw.h |
|
|
|
echo " NULL," >> tmp-hw.h |
|
|
|
echo "};" >> tmp-hw.h |
|
|
|
$(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 *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 $@ |
|
|
|
|
|
|
|
@ -434,8 +438,8 @@ test-hw-events: $(srccom)/hw-events.c libsim.a |
|
|
|
# See sim_pre_argv_init and sim_module_install in sim-module.c for more details. |
|
|
|
modules.c: stamp-modules ; @true |
|
|
|
stamp-modules: Makefile $(SIM_OBJS:.o=.c) |
|
|
|
@echo Generating $@ |
|
|
|
@LANG=C ; export LANG ; \ |
|
|
|
$(ECHO_STAMP) modules.c |
|
|
|
$(SILENCE) LANG=C ; export LANG ; \ |
|
|
|
LC_ALL=C ; export LC_ALL ; \ |
|
|
|
sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ | sort >$@.l-tmp |
|
|
|
@set -e; (\ |
|
|
|
@ -450,7 +454,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c) |
|
|
|
echo 'const int sim_modules_detected_len = ARRAY_SIZE (sim_modules_detected);'; \ |
|
|
|
) >$@.tmp |
|
|
|
$(SILENCE) $(SHELL) $(srcroot)/move-if-change $@.tmp modules.c |
|
|
|
@rm -f $@.l-tmp $@.tmp |
|
|
|
$(SILENCE) rm -f $@.l-tmp $@.tmp |
|
|
|
$(SILENCE) touch $@ |
|
|
|
|
|
|
|
# CGEN support. |
|
|
|
|