Merge pull request #786 from xexyl/2001-anonymous-try-me-64
Add alt supplementary program to 2001/anonymous
This commit is contained in:
4 files changed
+16
-5
No files matched your search
@@ -5,3 +5,4 @@ ten.bak.od
|
|||||||
ten.bak.txt
|
ten.bak.txt
|
||||||
ten.od
|
ten.od
|
||||||
ten.txt
|
ten.txt
|
||||||
|
anonymous.ten.64
|
||||||
@@ -117,10 +117,10 @@ PROG= ${ENTRY}
|
|||||||
#
|
#
|
||||||
OBJ= ${PROG}.o
|
OBJ= ${PROG}.o
|
||||||
DATA=
|
DATA=
|
||||||
TARGET= ${PROG} ${PROG}.ten
|
TARGET= ${PROG} ${PROG}.ten ${PROG}.ten.64
|
||||||
#
|
#
|
||||||
ALT_OBJ=
|
ALT_OBJ= ${PROG}.ten.64.o
|
||||||
ALT_TARGET=
|
ALT_TARGET= ${PROG}.ten.64
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@@ -156,6 +156,11 @@ ${PROG}.ten: ${PROG}.ten.c
|
|||||||
@echo
|
@echo
|
||||||
${CC} ${CFLAGS} -m32 $< -o $@ ${LIBS}
|
${CC} ${CFLAGS} -m32 $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}.ten.64: ${PROG}.ten.c
|
||||||
|
@echo "WARNING: the file created by this rule will NOT work with the entry itself;"
|
||||||
|
@echo "this is because it works ONLY on 32-bit ELF binaries! This however at least"
|
||||||
|
@echo "lets you see the supplementary program in action."
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ What happens if you try it on another file like [anonymous.c](anonymous.c)? Can
|
|||||||
you recompile it okay? What if you run it on `anonymous` itself? Can you run the
|
you recompile it okay? What if you run it on `anonymous` itself? Can you run the
|
||||||
program successfully after it without recompiling?
|
program successfully after it without recompiling?
|
||||||
|
|
||||||
|
NOTE: if the 32-bit version cannot be compiled the script will at least run the
|
||||||
|
alternate version of the [anonymous.ten](anonymous.ten.c) program.
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
make clobber all >/dev/null 2>&1
|
make clobber alt all >/dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
TARGET="anonymous.ten"
|
TARGET="anonymous.ten"
|
||||||
@@ -27,5 +27,8 @@ if [[ -f "$TARGET" ]]; then
|
|||||||
diff -s ten.txt ten.bak.txt
|
diff -s ten.txt ten.bak.txt
|
||||||
else
|
else
|
||||||
echo "cannot compile anonymous.ten.c as 32-bit, sorry."
|
echo "cannot compile anonymous.ten.c as 32-bit, sorry."
|
||||||
exit 1
|
echo "will run 64-bit version directly."
|
||||||
|
sleep 3
|
||||||
|
echo "$ ./$TARGET.64"
|
||||||
|
./"$TARGET".64
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user