#    WIPORT2 Makefile
#
#    Copyright (c) 1994--1998 Alexandru Dan Corlan, Marius Seritan
# 
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU Library General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    In short, you can use and modify this program. You can
#    distribute the program with or without your modifications if you want,
#    but you must not require licence fees and must provide the
#    full source code with the distribution. If you make an application program
#    which just calls functions from this library you may distribute that
#    application program without source code, but also as an linkable object file, 
#    and must distribute also this library with source code.
#
#    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 Library General Public License for more details.
#
#    You should have received a copy of the GNU Library General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
############################################################
# Makefile for the WIPORT library
#
############################################################

# call with `make'         under MSDOS
#           `LINUX=1 make' for vga support under Linux
#           `XWIN=1  make' for X11 support under Unix

XWIN=1

CC=gcc

ifdef XWIN
CFLAGS=-I. -I/home/dcorlan/work/grx23/include/
GRXLIB=-L/usr/include/X11 -L/usr/X11R6/lib -lgrx20X -lX11 -lm
else
ifdef LINUX
CFLAGS=-I. 
GRXLIB=-L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib /usr/local/lib/libgrx20.a -lvga -lm
else
CFLAGS=-I. -DMSDOS
GRXLIB=-lgrx
endif
endif

# end of the user customizable rules

all: wiptime.o wiport2x.o wiport2l.o wipall2.o wipres.o

WIPOBJ=wiport2x.o wipall2.o
libwip2.a: $(WIPOBJ)
	rm -f libwip2.a
	ar r libwip2.a $(WIPOBJ)

clean: 
	rm *.a *.o

# rules to compile the traditional test program
# for the wiport library under various operating systems

trywip: trywip.o libwip2.a
	$(CC) -o trywip trywip.o libwip2.a $(GRXLIB)

# dependecies 
wiptime.o: wiptime.c wiptime.h
wipall2.o: wipall2.c wipall2.h
wiport2l.o: wiport2l.c wipall2.h wiport2.h
wiport2x.o: wiport2x.c wipall2.h wiport2.h
trywip.o: trywip.c wipall2.h wiport2.h


