# $Id: Makefile,v 1.5 2004/07/18 01:13:01 db Exp db $
#
.ifndef PREFIX
PREFIX=	"/usr/local
.endif
.ifndef	CC
CC	= 	cc
.endif
.ifndef CPPFLAGS
CPPFLAGS =
.endif
.ifndef	CFLAGS
CFLAGS	=	-g
.endif
CFLAGS += -g
INCLUDE=	-Ikiss -Iax25 -Itlmdecode -Ietlm

default:	all

all:	BSDecode

#
#
kiss/kiss.o::
	(cd kiss;make kiss.o)

etlm/tty.o::
	(cd etlm;make tty.o)

tlmdecode/tlmdecode.o::
	(cd tlmdecode;make tlmdecode.o)

tlmdecode/csvlib.o::
	(cd tlmdecode;make csvlib.o)

ax25/ax25.o:
	(cd ax25; make ax25.o)

ax25/ax25kissinput.o:
	(cd ax25; make ax25kissinput.o)


SRC =	BSDecode.c 

OBJS =	BSDecode.o
OBJS += kiss/kiss.o
OBJS += etlm/tty.o
OBJS += tlmdecode/tlmdecode.o
OBJS += tlmdecode/csvlib.o
OBJS += ax25/ax25.o
OBJS += ax25/ax25kissinput.o

LIBS = -lm

BSDecode:	${OBJS}
		${CC} ${CFLAGS} -o BSDecode ${OBJS} ${LIBS}

install:	BSDecode
	install BSDecode ${PREFIX}/bin/BSDecode
	install doc/BSDecode.1 ${PREFIX}/man/man1

.c.o:
	${CC} ${CPPFLAGS} ${CFLAGS} ${INCLUDE} -c $<

,v.c:
	co $<

clean:
	(cd kiss;make clean)
	(cd etlm;make clean)
	(cd ax25;make clean)
	(cd tlmdecode;make clean)
	rm -f *.o *.a BSDecode *core *~ \#*

.PHONY:	clean build
