Improve how to redefine macros in 2006/monge
Now one can do
make clobber WIDTH=500 HEIGHT=500 ITERATIONS=512 alt
or whatever.
This commit is contained in:
1 parent
209410fa83
commit
a6aa0332cd
2 files changed
+11
-5
No files matched your search
+7
-1
@@ -143,8 +143,14 @@ ${PROG}: ${PROG}.c
|
|||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
|
# variables to help redefine width, height or iterations in alt version
|
||||||
|
#
|
||||||
|
WIDTH= 400
|
||||||
|
HEIGHT= 300
|
||||||
|
ITERATIONS= 128
|
||||||
|
|
||||||
${PROG}.alt: ${PROG}.alt.c
|
${PROG}.alt: ${PROG}.alt.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} -DW=${WIDTH} -DH=${HEIGHT} -DI=${ITERATIONS} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ Make sure you have the SDL1 (not SDL2!) development environment installed.
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
There is alternate code that lets you redefine the width and height and number
|
There is alternate version that lets you redefine the width and height and number
|
||||||
of iterations to use. See [alternate code](#alternate-code) below.
|
of iterations to use. See [Alternate code](#alternate-code) below.
|
||||||
|
|
||||||
|
|
||||||
### Bugs and (Mis)features:
|
### Bugs and (Mis)features:
|
||||||
@@ -67,13 +67,13 @@ of the variables `W`, `H` and `I`. The defaults are (respectively) 400, 300 and
|
|||||||
the same then do:
|
the same then do:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make clobber CDEFINE="-DW=500 -DH=500" alt
|
make clobber WIDTH=500 HEIGHT=500 alt
|
||||||
```
|
```
|
||||||
|
|
||||||
If you wish to keep the dimensions the same but change the iterations to 512:
|
If you wish to keep the dimensions the same but change the iterations to 512:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make clobber CDEFINE="-DI=512" alt
|
make clobber ITERATIONS=512 alt
|
||||||
```
|
```
|
||||||
|
|
||||||
If you specify a value less than 1 for any of these it sets it back to the
|
If you specify a value less than 1 for any of these it sets it back to the
|
||||||
|
|||||||
Reference in new issue
Block a user