CC		= gcc
CPP		= $(CC) -E
LD		= $(CC)
LDFLAGS		=
DEFS		=

# uncomment only two of the following lines
# compiling for Linux with optimizing
CFLAGS		= -funsigned-char -O2
DEFS		= -DTNT_LINUX
# compiling for Linux with debugging
#CFLAGS		= -funsigned-char -ggdb
#DEFS		= -DTNT_LINUX
# compiling for Linux with debugging and all warnings
#CFLAGS		= -funsigned-char -ggdb -Wall -pedantic
#DEFS		= -DTNT_LINUX
# compiling for ISC with optimizing
#CFLAGS		= -funsigned-char -O2 -D_POSIX_SOURCE
#DEFS		= -DTNT_ISC
# compiling for NetBSD with optimizing (not verified)
#CFLAGS		= -funsigned-char -O2
#DEFS		= -DTNT_NETBSD

# uncomment only one additional library line
# Libraries for Linux
LIBS		= -ltermcap
# Libraries for ISC
#LIBS		= -lcposix -linet -ltermcap

# comment out, if you don't want to use the Linux AX25 Kernel
DEFS		:= $(DEFS) -DUSE_AX25K
LIBS		:= $(LIBS) -lax25

CFLAGS		:= $(CFLAGS) $(DEFS)

HDRS	      = tnt.h \
		window.h \
		init.h \
		config.h \
		shell.h \
		keys.h \
		macro.h \
		connect.h \
		iface.h \
		ifacedef.h \
		xmon.h \
		monbox.h \
		boxlist.h \
		priv.h \
		comp.h \
		bcastadd.h \
		bcast.h \
		pastrix.h \
		dpglobal.h \
		boxglobl.h \
		p2cdef.h \
		ax25k.h

OBJS	      = main.o \
		serial.o \
		keyboard.o \
		display.o \
		window.o \
		file.o \
		codconv.o \
		init.o \
		remote.o \
		cookie.o \
		crc.o \
		shell.o \
		macro.o \
		connect.o \
		log.o \
		iface.o \
		xmon.o \
		monbox.o \
		boxlist.o \
		priv.o \
		comp.o \
		bcastadd.o \
		bcast.o \
		huffman.o \
		yapp.o \
		ax25k.o \
		ax25dump.o

SRCS	      = main.c \
		serial.c \
		keyboard.c \
		display.c \
		window.c \
		file.c \
		codconv.c \
		init.c \
		remote.c \
		cookie.c \
		crc.c \
		shell.c \
		macro.c \
		connect.c \
		log.c \
		iface.c \
		xmon.c \
		monbox.c \
		boxlist.c \
		priv.c \
		comp.c \
		bcastadd.c \
		bcast.c \
		huffman.c \
		yapp.c \
		ax25k.c \
		ax25dump.c

all:		tnt tntc

tnt:		$(OBJS)
		$(CC) $(CFLAGS) $(OBJS) $(LIBS) $(DEFS) -o tnt;

tntc:		tntc.o tnt.h
		$(CC) $(CFLAGS) tntc.o $(DEFS) -o tntc;

clean:
		rm -f *.orig *.o *~ .*~ tnt tntc .depend

dep:
		$(CPP) -M $(CFLAGS) $(SRCS) > .depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
