#
# GPPF-Ultra Makefile
#

PROJECT=primcall

BASE_DIR=..\..

# BRender-Parameter Fixed, Release, Register
RENDERER=ZB
LIB_TYPE=wxrr
LIB_TYPE_NB=wrr
LIB_TYPE_EX=4gwrr
BASED=FIXED

CC=wcc386

CFLAGS= -zp4 -5r -fp5 -w4 -d2 -s &
 -DBASED_$(BASED)=1&
 -DRENDER_$(RENDERER)=1&
 -DDEBUG=0&
 -DHOST_BALTO&
 -I$(BASE_DIR)\inc&
 -I$(BASE_DIR)\dosio&
 -zq

AS=C:\TASM\tasm
ASFLAGS=  /l /c /m2 /zi /mx /D_DOS4GW /D__DOS__ /D__FLAT__ /t

OBJS=   primcall.obj

LIBS=&
	$(BASE_DIR)/lib/brfm$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brdb$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brmt$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brfw$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/brpm$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/dosio$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/brst$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/hst$(LIB_TYPE_EX).lib

#.obj : .\
#.c : .\
#.h: .\
#.exe: .\

# Default rules
#
# Cope with long command lines
#
.c.obj : .AUTODEPEND

	@set _ARGS=$(CFLAGS) $^&.c
	@echo   Compiling $*.c
	@$(CC) @_ARGS /fo=$*.obj

.asm.obj: .AUTODEPEND
	@echo  Assembling $*.asm
	@$(AS) $(ASFLAGS) $*.asm,,$*.LST

ALL: $(EXE_DIR)$(PROJECT).EXE

$(EXE_DIR)$(PROJECT).EXE: $(OBJS) $(PROJECT).lnk
	@echo.
	@echo Linking $(PROJECT).EXE
	@wlink @$(PROJECT).lnk

# Link response file
#

$(PROJECT).lnk: makefile
	@echo.
	@echo Creating Link-File
	@echo.
	@echo name $(EXE_DIR)$(PROJECT).EXE >$(PROJECT).LNK
	@echo system dos4g >>$(PROJECT).LNK
	@echo DEBUG ALL >>$(PROJECT).LNK
	@echo option map,dosseg,caseexact,quiet,stack=64k >>$(PROJECT).LNK
	@for %i in ($(OBJS)) do echo file %i >>$(PROJECT).LNK
	@for %i in ($(LIBS)) do echo library %i >>$(PROJECT).LNK
