#
# OSLab module 3: process management makefile
#
# Choice of compiler (1 - Engineering network or 2 - stand alone)

COMPILER=1

# COM - the compiler to use (bcc)
# DIR - the directory to use (either borlandc or campus bc45)

!if $(COMPILER) == 1
COM=bcc
DIR=g:\apps\bc45
BIN=g:\apps\bc45\bin
!elif $(COMPILER) == 2
COM=bcc
DIR=\borlandc
!else
!error Unknown compiler
!endif

#

obj: m3.exe

hwdata.obj: hwdata.c procmgmt.c mainline.c regproc.c module3.h
    $(BIN)\$(COM) -mc -c hwdata.c

procmgmt.obj: procmgmt.c procmgmt.h module3.h
    $(BIN)\$(COM) -mc -c procmgmt.c
    $(BIN)\tlib ..\oslab -+procmgmt.obj

regproc.obj: regproc.c module3.h
    $(BIN)\$(COM) -mc -c regproc.c
    $(BIN)\tlib ..\oslab -+regproc.obj

mainline.obj: mainline.c module3.h
    $(BIN)\$(COM) -mc -c mainline.c

#
# Process test routine - compiled and linked explicitly
#

m3.exe: m3.obj hwdata.obj procmgmt.obj regproc.obj mainline.obj
    $(BIN)\tlink $(DIR)\lib\c0c hwdata mainline m3, m3, m3, ..\oslab $(DIR)\lib\cc

#    \tc\lib\emu \tc\lib\maths \tc\lib\cs

m3.obj: m3.c
    $(BIN)\$(COM) -mc -c m3.c
