FreeCalypso > hg > freecalypso-tools
annotate rvinterf/etmsync/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 | 322e75a1c8b9 |
children | 1d5bd9a06781 |
rev | line source |
---|---|
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 CC= gcc |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 CFLAGS= -O2 -I../include |
278
31d056f37647
fc-readcal written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
276
diff
changeset
|
3 PROGS= fc-dspapidump fc-fsio fc-memdump fc-readcal fc-tmsync |
49
642da3373772
rvinterf/*/Makefile: move to /opt/freecalypso
Mychaela Falconia <falcon@freecalypso.org>
parents:
27
diff
changeset
|
4 INSTBIN=/opt/freecalypso/bin |
642da3373772
rvinterf/*/Makefile: move to /opt/freecalypso
Mychaela Falconia <falcon@freecalypso.org>
parents:
27
diff
changeset
|
5 INSTHELP=/opt/freecalypso/helpfiles |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
420
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
7 LIBINTERF= ../libinterf/libinterf.a |
286
88a4ebed160d
fc-tmsync converted to link with librftab
Mychaela Falconia <falcon@freecalypso.org>
parents:
278
diff
changeset
|
8 LIBRFTAB= ../../librftab/librftab.a |
88a4ebed160d
fc-tmsync converted to link with librftab
Mychaela Falconia <falcon@freecalypso.org>
parents:
278
diff
changeset
|
9 |
420
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
10 DSPDUMP_OBJS= dspapidump.o interf.o memops.o simplemain.o ${LIBINTERF} |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
11 |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
12 FSIO_OBJS= cl_des.o dispatch.o fdcmd.o fileio.o fsbasics.o fscmdtab.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
13 fserr.o fsiomain.o fsmisc.o fsnew.o fspath.o fsread.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
14 fsupload.o fsuploadrf.o fswrite.o help.o hostmkdir.o interf.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
15 memcmd.o memops.o pirimei.o pirmagnetite.o rfcap.o stddirs.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
16 symlink.o ${LIBINTERF} ${LIBRFTAB} |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
420
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
18 MEMDUMP_OBJS= interf.o memdump.o memops.o ${LIBINTERF} |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
19 |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
20 READCAL_OBJS= hostmkdir.o interf.o l1tmops.o readcal.o ${LIBINTERF} |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
420
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
22 TMSYNC_OBJS= cl_des.o dispatch.o interf.o l1tmcmd.o l1tmops.o memcmd.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
23 memops.o piradccal.o pirimei.o tmscmdtab.o tmsmain.o \ |
322e75a1c8b9
rvinterf/etmsync converted to use libinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
24 ${LIBINTERF} ${LIBRFTAB} |
269
20ed7a320b12
fc-tmsync skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
153
diff
changeset
|
25 |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 all: ${PROGS} |
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 fc-dspapidump: ${DSPDUMP_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ${CC} ${CFLAGS} -o $@ ${DSPDUMP_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 fc-fsio: ${FSIO_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 ${CC} ${CFLAGS} -o $@ ${FSIO_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
153
9925fba699be
fc-olddump replaced with fc-memdump
Mychaela Falconia <falcon@freecalypso.org>
parents:
49
diff
changeset
|
34 fc-memdump: ${MEMDUMP_OBJS} |
9925fba699be
fc-olddump replaced with fc-memdump
Mychaela Falconia <falcon@freecalypso.org>
parents:
49
diff
changeset
|
35 ${CC} ${CFLAGS} -o $@ ${MEMDUMP_OBJS} |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
278
31d056f37647
fc-readcal written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
276
diff
changeset
|
37 fc-readcal: ${READCAL_OBJS} |
31d056f37647
fc-readcal written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
276
diff
changeset
|
38 ${CC} ${CFLAGS} -o $@ ${READCAL_OBJS} |
31d056f37647
fc-readcal written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
276
diff
changeset
|
39 |
269
20ed7a320b12
fc-tmsync skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
153
diff
changeset
|
40 fc-tmsync: ${TMSYNC_OBJS} |
20ed7a320b12
fc-tmsync skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
153
diff
changeset
|
41 ${CC} ${CFLAGS} -o $@ ${TMSYNC_OBJS} |
20ed7a320b12
fc-tmsync skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
153
diff
changeset
|
42 |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 install: ${PROGS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 mkdir -p ${INSTBIN} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 install -c ${PROGS} ${INSTBIN} |
25
75cd626cf379
rvinterf/etmsync/Makefile: install fsio.help
Mychaela Falconia <falcon@freecalypso.org>
parents:
16
diff
changeset
|
46 mkdir -p ${INSTHELP} |
26
b301b75de0e0
install misc files into /usr/local/share/freecalypso as non-executable
Mychaela Falconia <falcon@freecalypso.org>
parents:
25
diff
changeset
|
47 install -c -m 644 fsio.help ${INSTHELP} |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 clean: |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 rm -f *.o *.out *errs ${PROGS} |