# minimal makefile

TARGETS=treno
OBJS=treno.o mplib.o version.o netprintf.o

# Choose a signal paradigm.
# Default to the old signal() interface which works on most platforms.
# Note that most systems attempt to emulate most foreign signal mechanisms, so
# they appear to work even when non-optimal.

# If treno hangs, uncomment one of the following:
# SF=-DPOSIX_SIGNALS
# SF=-DBSD44_SIGNALS
# SF=-DSYSV_SIGNALS

CFLAGS=-g -O ${SF}
# version.h must be last
SRC=Makefile treno.1 treno.c mplib.h mplib.c netprintf.c version.c sharversion.h

all: ${TARGETS}

shar:
	rm -f sharversion.h version.h
	echo '#define SVERSION "Shar:'`date +"%D_%T"`'"' > sharversion.h
	cp sharversion.h version.h
	echo '#define VERSION "Edit:Never"' >> version.h
	shar -T -m ${SRC} version.h > treno.shar

clean:
	rm -rf ${OBJS} ${TARGETS}

treno:  ${OBJS}
	${CC} ${OBJS} -o treno

treno.o: treno.c mplib.h

mplib.o: mplib.c mplib.h

version.h: ${SRC}
	cp sharversion.h version.h
	echo '#define VERSION "Edit:'`date +"%D_%T"`'"' >> version.h

version.o: version.c version.h

netprintf.o: netprintf.c

showev:
