# Makefile
# For the Extended DOS Utilities

# Copyright (C) 1996 James Hall




# The version, where "XYY" means "X.YY":

Version=014






# Define the compiler, and a #define for the compiler:
#    MS_QUICK_C            Microsoft Quick C (works with 2.5)

CFLAGS=-O
Compiler=-DMS_QUICK_C

CC=QCL /batch /nologo $(Compiler) $(CFLAGS)
#CC=QCL /batch $(Compiler) $(CFLAGS)

# Define the graphics library (for certain compilers)

Graphics=G.LIB
#Graphics=C:\QC25\LIB\GRAPHICS.LIB

# Define all utils to compile:

UTILS=echo.exe clear.exe wait.exe rem.exe ver.exe more.exe type.exe \
date.exe time.exe test.exe choose.exe tee.exe

# Macros for file management:

ZIP=C:\INFOZIP\ZIP -9k


# Suffix rules:

.SUFFIXES:
.SUFFIXES: .c .obj .exe

.c.obj:
	$(CC) -c $<


# Targets to compile:

all: $(UTILS)


echo.exe: echo.obj
	$(CC) echo.obj

clear.exe: clear.obj
	$(CC) clear.obj

wait.exe: wait.obj getkey.obj
	$(CC) wait.obj getkey.obj

rem.exe: rem.obj
	$(CC) rem.obj

ver.exe: ver.obj
	$(CC) ver.obj

more.exe: type.c getkey.obj x_putc.obj x_getc.obj \
gop.obj x_height.obj utils.h
	$(CC) /DPROG_MORE -o $@ type.c getkey.obj x_putc.obj x_getc.obj \
gop.obj x_height.obj $(Graphics)

type.exe: type.c getkey.obj x_putc.obj x_getc.obj \
gop.obj x_height.obj utils.h
	$(CC) /DPROG_TYPE -o $@ type.c getkey.obj x_putc.obj x_getc.obj \
gop.obj x_height.obj $(Graphics)

date.exe: date.obj getdate.obj
	$(CC) date.obj getdate.obj

time.exe: time.obj gettime.obj
	$(CC) time.obj gettime.obj

test.exe: test.obj
	$(CC) test.obj

choose.exe: choose.obj getkey.obj
	$(CC) choose.obj getkey.obj

tee.exe: tee.obj
	$(CC) tee.obj


# Clean-up:

realclean: clean
	DEL *.EXE

clean:
	DEL *.OBJ

distrib: all
	$(ZIP) UTLX-$(Version).ZIP *.EXE
	$(ZIP) UTLS-$(Version).ZIP *.C *.H Makefile

backup: distrib
	COPY *.ZIP A:
