[PATCH/submitted,10/10] sim: ppc: move defines.h generation to the top-level
Checks
Commit Message
Since we rely on the top-level config.h now, the defines.h generation
step should live here too.
---
sim/Makefile.in | 19 +++++++++++++------
sim/ppc/Makefile.in | 10 ++--------
sim/ppc/local.mk | 9 +++++++++
3 files changed, 24 insertions(+), 14 deletions(-)
@@ -489,7 +489,7 @@ PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
-$(TARGETLIB): tmp-igen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): tmp-igen tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
@@ -562,12 +562,6 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c
options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
-defines.h: tmp-defines; @true
-tmp-defines: Makefile
- $(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < ../config.h > tmp-defines.h
- $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
- $(SILENCE) touch $@
-
#
# Rules to create the built c source code files
#
@@ -685,7 +679,7 @@ clean mostlyclean:
rm -f tmp-* *.[oasi] core $(BUILT_SRC_WO_CONFIG)
distclean realclean: clean
- rm -f TAGS Makefile config.cache config.status defines.h stamp-h config.log
+ rm -f TAGS Makefile config.cache config.status stamp-h config.log
maintainer-clean: distclean
rm -f *~ *.log core *.core
@@ -33,6 +33,15 @@ SIM_ALL_RECURSIVE_DEPS += common/libcommon.a
noinst_PROGRAMS += %D%/run
+SIM_ALL_RECURSIVE_DEPS += %D%/defines.h
+%D%/defines.h: %D%/stamp-defines ; @true
+%D%/stamp-defines: config.h Makefile
+ $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin
+ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h
+ $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += %D%/defines.h %D%/stamp-defines
+
%D%/spreg.c: @MAINT@ %D%/ppc-spr-table %D%/spreg-gen.py %D%/$(am__dirstamp)
$(AM_V_GEN)$(srcdir)/%D%/spreg-gen.py --source $@.tmp
$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(srcdir)/%D%/spreg.c