# TReno makefile

CC=@CC@

DEFS=@DEFS@
LIBS=@LIBS@

CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@

SRC=     treno.c mplib.h mplib.c eventlog.h netprintf.c sharversion.h \
         showev.c version.c 

SOBJS=   showev.o
TOBJS=   treno.o mplib.o version.o netprintf.o

OBJS=    $(SOBJS) $(TOBJS)
TARGETS= treno showev

all: ${TARGETS}

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

treno:  $(TOBJS)
	$(CC) $(TOBJS) -o treno $(LIBS) $(LDFLAGS)

showev: $(SOBJS)
	$(CC) $(SOBJS) -o showev $(LIBS) $(LDFLAGS)


.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<

treno.o: treno.c mplib.h

mplib.o: mplib.c mplib.h

showev.o: showev.c

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

