#"%Z% %M% %I% %D% %T%";

include ../../os_depend.mk
include ../../unix_command.mk
include ../../directory.mk
include ../../flags.mk

#---------------------------------------------------------------
#			C Compiler Options
#---------------------------------------------------------------
CFLAGS		= \
			$(OSDEPEND) \
			$(INCLUDES) \
			-I$(AKBINC) \
			$(AKBOPTS) \
			$(DEBUGOPTS)

#---------------------------------------------------------------
#
#		Objects
#
#---------------------------------------------------------------

#---------------------------------------------------------------
#			object files for akTrmMan Component
#---------------------------------------------------------------
HEADERS					=	\
						$(AKBINC)/trmm.h \
						$(AKBINC)/trextern.h \
						$(AKBINC)/trmmprot.h \
						$(LIBINC)/akbstruct.h \
						$(LIBINC)/akberror.h \
						$(LIBINC)/akbconst.h \
						$(LIBINC)/akbprot.h \
						$(LIBINC)/akbmacro.h \
						$(LIBINC)/akastruct.h \
						$(LIBINC)/akxmemtool.h \
						$(LIBINC)/akxlib.h

OBJS						=	\
							aktr01.o \
							aktr02.o \
							aktr03.o \
							aktr04.o \
							aktr05.o \
							aktr06.o \
							aktr07.o \
							vers.o date.o

COMLIBS					=	\
							$(LIBAKAS)/libakas.a \
							$(LIBAKB)/libakb.a \
							$(LIBAKX)/libakx.a

#OTHERLIBS  = -lsocket -lnsl -lmalloc

#---------------------------------------------------------------
#
#			LINKER target file
#
#---------------------------------------------------------------
TARGETFILE			= akTrmMan

#---------------------------------------------------------------
#
#		rules
#
#---------------------------------------------------------------
 all : $(TARGETFILE)

#---------------------------------------------------------------
#		rules for TARGETFILE
#---------------------------------------------------------------
$(TARGETFILE) : $(OBJS) $(COMLIBS) makefile
		$(CC) $(LDFLAGS) -o $@ \
		$(OBJS) $(COMLIBS) $(OTHERLIBS)
		@rm -f vers.o date.o date.c

release : $(OBJS) $(COMLIBS)
		$(CC) $(LDFLAGS) -o $(TARGETFILE) \
		$(OBJS) $(COMLIBS) $(OTHERLIBS)
		@rm -f vers.o date.o date.c vers.c

link :	vers.o date.o
		$(CC) $(LDFLAGS) -o $(TARGETFILE) \
		$(OBJS) $(COMLIBS) $(OTHERLIBS)
		@rm -f vers.o date.o date.c

vers.c : $(CONFDIR)/newvers.sh
		@sh $(CONFDIR)/newvers.sh

date.c : $(CONFDIR)/newdate.sh
		@sh $(CONFDIR)/newdate.sh

#---------------------------------------------------------------
#
#			basic sufixes
#
#---------------------------------------------------------------
.c.o : $(HEADERS) makefile
		$(CC) $(CFLAGS) -c $*.c

#---------------------------------------------------------------
#
#		other rules
#
#---------------------------------------------------------------
include ../../other_rules.mk

install : $(TARGETFILE)
		$(INSTALL) $(INSTFLGS) $(TARGETFILE) $(DEVELOPBIN)

#----------------------------------------------------------

aktr01.o : $(HEADERS) makefile
aktr02.o : $(HEADERS) makefile
aktr03.o : $(HEADERS) makefile
aktr04.o : $(HEADERS) makefile
aktr05.o : $(HEADERS) makefile
