-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from chewi/fail-mbr-automake
Move compile-mbr.sh script into fail-mbr's automake
- Loading branch information
Showing
3 changed files
with
39 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,34 @@ clean-local: | |
|
||
distclean-local: clean-local | ||
|
||
fail-mbr.bin: | ||
sh $(srcdir)/compile-mbr.sh | ||
if X86 | ||
fail-mbr.image: fail-mbr.S | ||
$(CC) -c "$<" -o "$@" | ||
|
||
fail-mbr.bin: fail-mbr.image | ||
$(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .note.gnu.property -R .reginfo -R .rel.dyn "$<" "$@" | ||
|
||
## Check that this file is the same as the original fail-mbr: | ||
@echo "Checking the file:" | ||
$(OBJDUMP) -D -b binary -mi386 -Maddr16,data16 "$@" > f1.obj | ||
$(OBJDUMP) -D -b binary -mi386 -Maddr16,data16 "$(srcdir)/[email protected]" > f2.obj | ||
|
||
## The regular expression is used to reject lines which contain either: | ||
## - the name of the file, "fail-mbr" | ||
## - a line separator output by diff, "---" | ||
## - the OP code "xor %ax,%ax" which may begin by 0x31 or 0x33 | ||
## - a numerical offset output by diff, ^[a-f0-9]*$ | ||
@if diff f1.obj f2.obj | grep -qEv 'fail-mbr|---|xor %ax,%ax|^[a-f0-9]*$$'; then \ | ||
echo "files $@ and [email protected] differ significantly:"; \ | ||
diff f1.obj f2.obj; \ | ||
exit 1; \ | ||
else \ | ||
echo "'[email protected]' and '[email protected]' have no significant differences."; \ | ||
rm f1.obj f2.obj; \ | ||
exit 0; \ | ||
fi | ||
else | ||
fail-mbr.bin: fail-mbr.bin.orig | ||
@echo "The architecture is not x86, so the file '$@' is not compiled" | ||
cp -vp "$<" "$@" | ||
endif |
This file was deleted.
Oops, something went wrong.