|
From: Jeremy F. <je...@go...> - 2005-02-10 00:24:41
|
CVS commit by fitzhardinge:
Make generation of core_arch_asm_offsets.h to work in a cross-build
environment. Distribute a native-built .dist version, and just copy
that if we can't run gen_offsets on the build machine.
M +21 -3 Makefile.am 1.23
--- valgrind/coregrind/x86/Makefile.am #1.22:1.23
@@ -16,5 +16,5 @@
jmp_with_stack.c \
libpthread.c \
- gen_offsets.c core_arch_asm_offsets.h
+ gen_offsets.c core_arch_asm_offsets.h.dist
BUILT_SOURCES = stage2.lds core_arch_asm_offsets.h
@@ -45,5 +45,23 @@
-e 's/0x08048000/kickstart_base/g' > $@ || rm -f $@
-# offsets
+# Generate offsets
+# Only update the existing core_arch_asm_offsets if gen_offsets ran,
+# and it produced a different file. Otherwise preserve the existing file.
core_arch_asm_offsets.h: gen_offsets
- ./gen_offsets > $@ || rm -f $@
+ -./gen_offsets > $@.new
+ @if [ -s $@.new ] && ! cmp $@ $@.new >/dev/null 2>&1; then \
+ echo Updated $@; \
+ mv $@.new $@; \
+ else \
+ rm -f $@.new; \
+ fi
+ @if ! [ -s $@ ]; then \
+ if ! cp $(srcdir)/$@.dist $@; then \
+ echo "Couldn't create $@"; exit 1; \
+ else \
+ echo "Copied $(srcdir)/$@.dist"; \
+ fi; \
+ fi
+
+core_arch_asm_offsets.h.dist: core_arch_asm_offsets.h
+ cp $< $@
|