annotate Makefile @ 465:003e48f8ebe1

rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel I generally don't use NULL and use plain 0 instead, based on a "NULL considered harmful" discussion on the classiccmp mailing list many aeons ago (I couldn't find it, and I reason that it must have been 2005 or earlier), but a recent complaint by a packager sent me searching, and I found this: https://ewontfix.com/11/ While I don't give a @#$% about "modern" systems and code-nazi tools, I realized that passing a plain 0 as a pointer sentinel in execl is wrong because it will break on systems where pointers are longer than the plain int type. Again, I don't give a @#$% about the abomination of x86_64 and the like, but if anyone ever manages to port my code to something like a PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0 as a function argument where a pointer is expected most definitely won't work: if the most natural stack slot and SP alignment unit is 16 bits, fitting an int, with longs and pointers taking up two such slots, then the call stack will be totally wrong with a plain 0 passed for a pointer. Casting the 0 to (char *) ought to be the most kosher solution for the most retro systems possible.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Feb 2019 00:00:19 +0000
parents 940ab98efefd
children 8f3fe2d1fda5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
340
88fb194b4b61 top Makefile: uptools subdirectory added
Mychaela Falconia <falcon@freecalypso.org>
parents: 284
diff changeset
1 PROGDIR=ffstools loadtools miscutil ringtools rvinterf uptools
284
556bb8c860fa librftab added to top Makefile as dependency for ffstools and rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents: 249
diff changeset
2 LIBDIR= librftab libserial
249
d0a4c05d98dc libserial hooked into the top level Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents: 219
diff changeset
3 SUBDIR= ${PROGDIR} ${LIBDIR}
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 all: ${SUBDIR}
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
284
556bb8c860fa librftab added to top Makefile as dependency for ffstools and rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents: 249
diff changeset
7 ffstools: librftab
249
d0a4c05d98dc libserial hooked into the top level Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents: 219
diff changeset
8 loadtools: libserial
d0a4c05d98dc libserial hooked into the top level Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents: 219
diff changeset
9 miscutil: libserial
284
556bb8c860fa librftab added to top Makefile as dependency for ffstools and rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents: 249
diff changeset
10 rvinterf: librftab libserial
343
940ab98efefd top Makefile: uptools need libserial for atinterf
Mychaela Falconia <falcon@freecalypso.org>
parents: 340
diff changeset
11 uptools: libserial
249
d0a4c05d98dc libserial hooked into the top level Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents: 219
diff changeset
12
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 ${SUBDIR}: FRC
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 cd $@; ${MAKE} ${MFLAGS}
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 clean: FRC
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 rm -f a.out core errs
284
556bb8c860fa librftab added to top Makefile as dependency for ffstools and rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents: 249
diff changeset
18 for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 install: FRC
57
7cc2f2360922 top Makefile install rule: new packaging approach
Mychaela Falconia <falcon@freecalypso.org>
parents: 20
diff changeset
21 mkdir -p /opt/freecalypso
249
d0a4c05d98dc libserial hooked into the top level Makefile
Mychaela Falconia <falcon@freecalypso.org>
parents: 219
diff changeset
22 for i in ${PROGDIR}; do (cd $$i; ${MAKE} ${MFLAGS} install); done
57
7cc2f2360922 top Makefile install rule: new packaging approach
Mychaela Falconia <falcon@freecalypso.org>
parents: 20
diff changeset
23 if [ -d target-bin ]; then \
7cc2f2360922 top Makefile install rule: new packaging approach
Mychaela Falconia <falcon@freecalypso.org>
parents: 20
diff changeset
24 mkdir -p /opt/freecalypso/target-bin; \
7cc2f2360922 top Makefile install rule: new packaging approach
Mychaela Falconia <falcon@freecalypso.org>
parents: 20
diff changeset
25 install -c -m 644 target-bin/* /opt/freecalypso/target-bin; \
7cc2f2360922 top Makefile install rule: new packaging approach
Mychaela Falconia <falcon@freecalypso.org>
parents: 20
diff changeset
26 fi
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 FRC: