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

CFLAGS= -I.. -I../nlib $(COPT)

LIBOBJS = ../libemfw.a ../libemtn.a
LMFOBJS = assert.o cpbidir.o ipaddr.o cfargcount.o			\
          cfgroupid.o cfuserid.o cfhosts.o cfint.o cfstr.o setug.o	\
          emi.o emo.o fastdaemon.o fastdaemon2.o fastpname.o fastheap.o \
          findcmd.o findhash.o findhash2.o hash.o pidfile.o		\
          lwrcmpn.o lwrcmpz.o lwrcopy.o lwrmatch.o lwrtable.o		\
          uprcopy.o uprtable.o version.o versionchk.o chksnprintf.o
LMTOBJS = tncore.o tndfa.o tngetc.o tngets.o tnhelp.o tnprintf.o	\
          tnputc.o tnputs.o
HDFOBJS = lwrtable.h uprtable.h
MKTOBJS = maketable
ALLOBJS = $(MKTOBJS) $(HDFOBJS) $(LMFOBJS) $(LMTOBJS) $(LIBOBJS)

all: $(ALLOBJS)

../libemfw.a: $(LMFOBJS)
	$(OFWTKAR)

../libemtn.a: $(LMTOBJS)
	$(OFWTKAR)

$(LMFOBJS): $(HDFOBJS)

lwrtable.h: $(MKTOBJS)
	./maketable -l >lwrtable.h

uprtable.h: $(MKTOBJS)
	./maketable -u >uprtable.h

maketable: ../nlib/maketable
	ln -fs ../nlib/maketable ./maketable
