# Makefile for DISPLAY and MODE

# set 
#   UPX=-rem 
# if you dont want to UPX the generated files
UPX=-rem
UPX=upx --8086

# the assembler:
NASM=nasm

############# WATCOM (untested) ##############
# the compiler:
# CC=wcl
# the flags:
# CFLAGS=-oas -s -wx -we -zq -fm -fe=

############# TURBO_C ########################
# -w warn all, -M mapfile -Z optimize registers -O optimize jumps
# -k- no standard stack frame -e... defines exe filename, must be
# last argument. -f- disables FPU usage. -mt uses tiny model
# and -lt passes "create com file" option to linker.
CC=tcc
CFLAGS=-w -M -f- -mt  -lt -e


CFILES=mode.c  modecon.c  modecp.c  modefunc.c  modeopt.c

######## targets: ########

all: mode.com display.com

display.com: display.asm
	$(NASM) display.asm -o display.com
	$(UPX) display.com

mode.com: $(CFILES) makefile
	$(CC) $(CFLAGS)mode $(CFILES)
	$(UPX) mode.com

clean:
	-del *.obj

