#
# Makefile for MSDOS/Borland C version 3.1 (dmake)
#
# Version: 1.4 (Jan 1994)
#

# Here we install the binaries:
BINDIR = c:\emtex

# Here we install the manuals:
MANDIR = c:\emtex\doc

# This are the built in paths
T1INPUTS = .\;c:\\emtex\\ps

CC = bcc
CCLD = tlink
SYSTEM = MSDOS
MODEL = h
CFLAGS =  -D$(SYSTEM) -v -w- -m$(MODEL) -DWORD16
T1HDR =  -I..\type1
T1LIB = ..\type1\type1.lib
STARTUP = c0$(MODEL)
CLIB =  c$(MODEL)
OLIBS = emu + math$(MODEL) + $(CLIB)

.c.obj:
	$(CC) $(CFLAGS) -c $*.c

all: ps2pk.exe pk2bm.exe

ps2pk.exe: ps2pk.obj encoding.obj pkout.obj filename.obj $(T1LIB)
	$(CCLD) /v $(STARTUP)+ps2pk+encoding+pkout+filename,ps2pk,\
               ,$(T1LIB)+$(OLIBS)

ps2pk.obj: ps2pk.c pkout.h filename.h
	$(CC) -DT1INPUTS="$(T1INPUTS)" $(CFLAGS) $(T1HDR) -c ps2pk.c

pk2bm.exe: pk2bm.obj pkin.obj
	$(CCLD) $(STARTUP)+pk2bm+pkin,pk2bm,,$(CLIB)

pktest.exe: pktest.obj pkout.obj
	$(CCLD) $(STARTUP)+pktest+pkout,pktest,,$(OLIBS)

mag.exe: mag.obj
	$(CCLD) $(STARTUP) + mag, mag, ,$(OLIBS)

pfb2pfa.exe: pfb2pfa.obj filename.obj
	$(CCLD) $(STARTUP)+pfb2pfa+filename,pfb2pfa,,$(CLIB)

$(T1LIB)::
[
	cd ..\type1
	$(MAKE) -f Makefile.bcc type1.lib
]

install: ps2pk.exe pk2bm.exe
	copy ps2pk.exe   $(BINDIR)\ps2pk.exe
	copy pk2bm.exe   $(BINDIR)\pk2bm.exe

install.man:
	copy ..\man\ps2pk.doc   $(MANDIR)
	copy ..\man\pk2bm.doc   $(MANDIR)

clean:
[
	rm *.obj *.map *.exe *.err
	cd ..\type1
	$(MAKE) -f Makefile.bcc clean
]
