Improve how redefine sleep in 1992/kivinen
Using a Makefile variable one can do for instance
make clobber SLEEP=30000 alt
to change the Z macro, the time to sleep.
This commit is contained in:
1 parent
2277d88ac5
commit
37a466224b
2 files changed
+9
-3
No files matched your search
@@ -59,7 +59,7 @@ ARCH=
|
||||
|
||||
# Defines that are needed to compile
|
||||
#
|
||||
CDEFINE= -DZ=20000
|
||||
CDEFINE= -DZ=${SLEEP}
|
||||
|
||||
# Include files that are needed to compile
|
||||
#
|
||||
@@ -138,6 +138,12 @@ ${PROG}: ${PROG}.c
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
# variable to control amount of time to sleep between writes for alt code.
|
||||
SLEEP= 20000
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS}
|
||||
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
|
||||
@@ -39,9 +39,9 @@ Also try changing the speed this game moves. For instance if you wish to change
|
||||
the `usleep(3)` value to `30000` from `20000`, try:
|
||||
|
||||
```sh
|
||||
make clobber CDEFINE="-DZ=30000" alt # make it slower
|
||||
make clobber SLEEP=30000 alt # make it slower
|
||||
|
||||
make clobber CDEFINE="-DZ=10000" alt # make it faster
|
||||
make clobber SLEEP=10000 alt # make it faster
|
||||
```
|
||||
|
||||
Then use the same syntax as above and described by the author.
|
||||
|
||||
Reference in new issue
Block a user