# Note: this module requires ncurses. If your system has old curses library 
# only, you should install ncurses separately.

GMKPATH = ..
include $(GMKPATH)/Makefile.config

CFLAGS = $(COPT) -I$(NCURSES_INCDIR) -I$(NCURSES_INCDIR)/.. \
         -I.. -I../nlib -DAUTHSRV_SOCK_PATH=\"$(AUTHSRV_SOCK_PATH)\"
LDFLAGS = $(LDFL) -L.. -L$(SSL_LIBDIR) -L$(NCURSES_LIBDIR) -lform -lncurses \
          -lfwall $(AUXLIB)

BINOBJS = auth_telnetd auth_cons
MANOBJS = auth_telnetd.8
TNDOBJS = main.o state.o termstat.o slc.o sys_term.o utility.o global.o login.o \
          telnetd.o env.o auth_console.o
CNSOBJS = cons.o auth_console.o login.o env.o
ALLOBJS = $(TNDOBJS) $(CNSOBJS) $(BINOBJS) $(MANOBJS)

all: $(ALLOBJS)

auth_telnetd: $(TNDOBJS) ../libfwall.a
	$(OFWTKLINK) $(TNDOBJS)

auth_cons: $(CNSOBJS) ../libfwall.a
	$(OFWTKLINK) $(CNSOBJS)
