CC=gcc -V2.5.90-940709

PROGS=g3vga gifvga

# See the color defines in vgaui.h
PAGE_COLOR=DARKGRAY
TEXT_COLOR=WHITE
BORDER_COLOR=RED
TITLE_FG_COLOR=YELLOW
TITLE_BG_COLOR=BLUE

# For another font look in your /usr/lib/kbd/consolefonts directory
# for others names. Leave the entries blank for the default font as you
# may not have the fonts that I have (like antique and script). Note how the
# extension may be left out as well. See the ./font/README file. 
TITLE_FONT=antique-16
PROMPT_FONT=script-16
INPUT_FONT=972.cp

# Name template is the way filenames are deciphered. Used only in the
# page goto facility in the viewer. The following suffices for "efax"
# page numbering. Leave it alone if you are unsure.
NAME_TEMPLATE="%s.%03d"

# For my debugging purposes only
#MDEBUG=1

CFLAGS=	-DPAGE_COLOR=$(PAGE_COLOR) \
	-DTEXT_COLOR=$(TEXT_COLOR) \
	-DBORDER_COLOR=$(BORDER_COLOR) \
	-DTITLE_FG_COLOR=$(TITLE_FG_COLOR) \
	-DTITLE_BG_COLOR=$(TITLE_BG_COLOR) \
	-DTITLE_FONT=\"$(TITLE_FONT)\" -DPROMPT_FONT=\"$(PROMPT_FONT)\" \
	-DINPUT_FONT=\"$(INPUT_FONT)\" \
	-DNAME_TEMPLATE=\"$(NAME_TEMPLATE)\" \
	-O2 -I. -Imisc -DMMAP #-m486
LDFLAGS=-s #-Wl,-qmagic
LDLIBS=-lvga

ifdef MDEBUG
CFLAGS+=-g -DMALLOC_TRACE -I../malloc
LDLIBS=-g -L/usr/src/svgalib/src -L../malloc -lvga -lmalloc_d
endif

all: $(PROGS)

vgaui.o: vgaui.c vgaui.h #Makefile

g3vga: vgaui.o g3decode.o misc/libvgamisc.a

g3decode.o: g3decode.c vgaui.h #Makefile

gifvga: vgaui.o gif/gifvga.o gif/xvgif.o misc/libvgamisc.a

$(PROGS):
	$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)

misc/libvgamisc.a:
	cd misc; make libvgamisc.a

clean:
	rm -f $(PROGS) *.o gif/*.o misc/*.o misc/libvgamisc.a misc/fontdemo
