AR	=ar
AS	=as
# Choose the C compiler you want
CPP	=cc
#CPP	=gcc
# VIDEO7 flag should be used on weird non-standard, old cards like the Video7 I
# use to have.
# ie. if your card doesn't display the right things, or does not return to text
# mode properly, try setting VIDEO7, do 'make clean' then 'make' and test again
# -O for cc, -O2 for gcc
CFLAGS	= -O
#CFLAGS	= -O2

.c.o:
	$(CPP) $(CFLAGS) -c -o $*.o $<

.s.o:
	$(AS) $<

all:	libvga.a vgatest mytest

libvga.a: vga.o ioperm.o mmap.o port_in.o port_out.o
	$(AR) rcs libvga.a vga.o ioperm.o mmap.o port_in.o port_out.o
	cp libvga.a /usr/lib
	cp vga.h /usr/include

vgatest: libvga.a vgatest.o 
	$(CPP) $(CFLAGS) -o vgatest vgatest.o -lvga

mytest: libvga.a mytest.o 
	$(CPP) $(CFLAGS) -o mytest mytest.o -lvga

clean:
	rm -f *.o libvga.a vgatest mytest

vga.o: vga.c vga.h emulib.h
vgatest.o: vgatest.c vga.h emulib.h
