##!dmake -f

# main goal of this Makefile:
# CDP

# source in the Free-Dos initialization 
.INCLUDE .FIRST .IGNORE : fd_init.mk ../fd_init.mk ../../fd_init.mk

#
#Project related settings
#
.IF $(_COMPILER) == MC
PRG = cdp_inst.com
.ELSE
PRG = cdp_inst.exe
.ENDIF
SRC = cdp_inst.c decrypt.c
OBJ = decrypt.obj cdp_inst.obj
HDR = decrypt.h
MYCFLAGS = # TEST=YES
MSGLIB !:= msg.lib
MSGDCL !:= yerror.h
LDLIBS = $(MSGLIB) $(FDLIB)\$(_MODEL)_$(LNG).lib $(FDLIB)\Fd_$(_MODEL).lib

#
#First target
#
all : $(CFG) $(PRG)	# copy library into Free-Dos library dir

.INIT : $(CFG) tags refs errlist # Will make the utilizing files

#
#C initialization file
#
.IF $(CFG)
# Compiler configuration file, for Borland C only
# options: no Windows, no RTTI, use pre-compiled headers, no floating point

CONFIGURATION = -W-	\
-X-	\
-H	\
-I.;$(INCDIR)	\
-L.;$(LIBDIR)	\
-H=assign.csm	\
-f-	\
-ff-	\
-m$(_MODEL)

.IF $(_COMPILER) == BC45
CONFIGURATION += -RT-
.ENDIF

$(CFG) : $(MAKEFILE:s/-f//)
	Cat $(mktmp $(CONFIGURATION:t"\n")\n) >$@

.ENDIF


$(PRG) .SWAP : $(MSGLIB) $(OBJ)
.IF $(_COMPILER) == MC
	$(LD) $(LDCOMFLAG) $(LDFLAGS) $(MCDIR)\Pc86rl_t @$(mktmp $(OBJ:t" ") \n), $@, NUL,@$(mktmp $(LDLIBS:t" ") $(MCDIR)\Mclib\n)
.ELSE
	$(CC) -e$@ @$(mktmp $(OBJ:t"\n") $(LDLIBS:t"\n")\n)
.ENDIF

#MAKEDEP START
cdp_inst.obj : cdp_inst.c \
	decrypt.h
decrypt.obj : decrypt.c
#MAKEDEP STOP

clobber ::
	$(RM) $(RMFLAGS) *.man *.tx

# source in the Free-Dos standard targets 
.INCLUDE .FIRST .IGNORE : fd_exit.mk ../fd_exit.mk ../../fd_exit.mk
