view miscutil/Makefile @ 965:2969032bdfac

fcup-smsend[mult]: fix buglet in K&R C NULL pointer passing The only 100% safe way to pass a NULL pointer as a function argument in K&R C is to cast 0 to a pointer type; failing to do so may cause mysterious bugs (invalid stack frames or garbage in argument registers) on 64-bit machines. This issue has already been fixed in most of FC host tools, but I just found some missed spots: passing of NULL UDH to PDU encoding functions in fcup-smsend[mult] in the case of single (not concatenated) SMS.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 01 Sep 2023 07:33:51 +0000
parents 8ddb16a37273
children
line wrap: on
line source

CC=	gcc
CFLAGS=	-O2
PROGS=	arfcn2ti fc-pulse-dtr fc-pulse-rts fc-rgbconv fc-serterm imei-luhn \
	make-imeisv mokosrec2bin srec-regions ti2arfcn
SCRIPTS=c139explore pirexplore

INSTALL_PREFIX=	/opt/freecalypso

INSTBIN=${INSTALL_PREFIX}/bin

all:	${PROGS}

SERTERM_OBJS=	fc-serterm.o ttypassthru.o ../libserial/libserial.a

arfcn2ti:	arfcn2ti.c
	${CC} ${CFLAGS} -o $@ $@.c

fc-pulse-dtr:	fc-pulse-dtr.c
	${CC} ${CFLAGS} -o $@ $@.c

fc-pulse-rts:	fc-pulse-rts.c
	${CC} ${CFLAGS} -o $@ $@.c

fc-rgbconv:	fc-rgbconv.c
	${CC} ${CFLAGS} -o $@ $@.c

fc-serterm:	${SERTERM_OBJS}
	${CC} ${CFLAGS} -o $@ ${SERTERM_OBJS}

ttypassthru.o:	../loadtools/ttypassthru.c
	${CC} ${CFLAGS} -c -o $@ $<

imei-luhn:	imei-luhn.c
	${CC} ${CFLAGS} -o $@ $@.c

make-imeisv:	make-imeisv.c
	${CC} ${CFLAGS} -o $@ $@.c

mokosrec2bin:	mokosrec2bin.c
	${CC} ${CFLAGS} -o $@ $@.c

srec-regions:	srec-regions.c
	${CC} ${CFLAGS} -o $@ $@.c

ti2arfcn:	ti2arfcn.c
	${CC} ${CFLAGS} -o $@ $@.c

install:
	mkdir -p ${INSTBIN}
	install -c ${PROGS} ${SCRIPTS} ${INSTBIN}

clean:
	rm -f ${PROGS} *.o *errs *.out