# Micro-X - X server for DOS
# Copyright (C) 1995 StarNet Communications Corp.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
# 
# StarNet Communications Corp.
# 550 Lakeside Dr. #3
# Sunnyvale CA 94086 US
# http://www.starnet.com
# x-dos@starnet.com

.SUFFIXES: .def

SRCS1 = scrinit.c egacmap.c egawindo.c egafont.c egapixma.c egagc.c egaspans.c egagetsp.c mfbclip.c
SRCS2 =	egapushp.c egaglblt.c egacurs.c mfbbres.c mfbhrzve.c mfbline.c output.c egapaint.c vgadrvr.c egabstor.c

SRCS = $(SRCS1) $(SRCS2)

OBJS1 = scrinit.obj egacmap.obj egafont.obj egapixma.obj egagc.obj output.obj mfbclip.obj
OBJS2 =	egapushp.obj egaglblt.obj mfbline.obj egapaint.obj vgadrvr.obj vga.obj egabstor.obj
OBJS3 = egacurs.obj egagetsp.obj egaspans.obj egawindo.obj mfbbres.obj mfbhrzve.obj
OBJS = $(OBJS1) $(OBJS2) $(OBJS3)

INCLUDES= -I..\..\..\..\..\x11 -I..\..\..\include -I..\..\mi
DEBUG=-d1
OPT =-zq
CFLAGS = $(INCLUDES) $(OPT) $(DEBUG)
MFLAGS=/MX /T
LIBFLAGS=-c
CC = wcc386
LIB = wlib

all : ega.lib .SYMBOLIC

ega.lib: $(OBJS)
	$(LIB) $(LIBFLAGS) -n ega +$(OBJS1)
	$(LIB) $(LIBFLAGS) ega +$(OBJS2)
	$(LIB) $(LIBFLAGS) ega +$(OBJS3)

ecopybit.obj: ecopybit.asm
	386asm -twocase -define invert ecopybit
	mv -Z ecopybit.obj einvert.obj
	386asm -twocase ecopybit

tags: $(SRCS)
	ctags $(SRCS1)
	ctags -a $(SRCS2)

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

.c.asm:
	$(CC) -c $(CFLAGS) -Hasm $*.c > $*.asm

vga.obj vga.asm:
	masm $(MFLAGS) $*;

clean:	.SYMBOLIC
	rm -f *.err *.lst *.map *.exe *.obj *.bak ega.lib
