Improve how to redefine macros in 2001/kev

Now one can do

    make clobber PORT=37337 SPEED=50 everything

The l_ macro can also be redefined with the 'L' variable but this is not
recommended especially if you don't know what you're doing so it's
barely mentioned in the README.md file.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-07 10:43:49 -08:00
1 parent 515105864d
commit b8473b5b6a
2 files changed
+13 -6

No files matched your search

+7 -1
View File
@@ -57,9 +57,15 @@ CSTD= -std=gnu99
#
ARCH=
# variables for the macros for easier redefining
#
PORT= 5455
SPEED= 100
L= "socket(il.sin_family=AF_INET,SOCK_STREAM,0)"
# Defines that are needed to compile
#
CDEFINE= -DPORT=5455 -DSPEED=100 -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)"
CDEFINE= -DPORT=${PORT} -DSPEED=${SPEED} -Dl_=${L}
# Include files that are needed to compile
#
+6 -5
View File
@@ -42,23 +42,24 @@ If you need to change the speed you can reconfigure it like (say
for over a network and not the same host):
```sh
make clobber CDEFINE="-DSPEED=50" all # original default value which is very fast
make clobber SPEED=50 all # original default value which is very fast
```
If you wish to change the port you can do so like:
```sh
make clobber CDEFINE="-DPORT=3773" all
make clobber PORT=3773 all
```
Of course if you want a port < 1024 you'll need to be root so don't do that.
And if you know what you're doing you can redefine the call to the `socket(2)`
syscall with the `l_` macro. Of course you can do more than one at the same
time. For instance to change the speed and port:
syscall with the `l_` macro, changing the `L` variable like one would `PORT`. Of
course you can do more than one at the same time. For instance to change the
speed and port:
```sh
make clobber CDEFINE="-DSPEED=512 -DPORT=3773" all
make clobber SPEED=512 PORT=3773 all
```
If you have `xterm` try on one system: