#
# Makefile for Quick Pager, OS2 EMX/GCC
#

CC	= gcc -c
CFLAGS	= -O2 -Zmtd  
LD	= gcc
LDFLAGS	= -s -Zmtd

#
# Inference Rules
#

.c.o :
	$(CC) $(CFLAGS) $*.c

#
# Files
#

HDRS = qpager.h screen.h

SRCS = qpager.c screen.c files.c lines.c kconv.c\
	display.c command.c search.c save.c

OBJS = qpager.o screen.o files.o lines.o kconv.o\
	display.o command.o search.o save.o

LIBS = -liconv

#
# Target to Build
#

all : qp.exe

test : test01.exe

#
# Object Dependencies
#

qpager.o  : qpager.c qpager.h screen.h

screen.o  : screen.c screen.h

files.o   : files.c qpager.h 

lines.o   : lines.c qpager.h

kconv.o   : kconv.c qpager.h

display.o : display.c qpager.h screen.h

command.o : command.c qpager.h screen.h

search.o  : search.c qpager.h screen.h

save.o    : save.c qpager.h screen.h

#
# Quick Pager Executable
#

qp.exe : qp.def $(OBJS)
	$(LD) $(LDFLAGS) -o qp.exe qp.def $(OBJS) $(LIBS)

#
# Test Programs
#

test01.exe : test01.o test01.def kconv.o lines.o
	$(LD) $(LDFLAGS) -o test01.exe test01.def test01.o kconv.o lines.o $(LIBS)

test01.o : test01.c qpager.h
