
TOP = @TOP@
SRC = $(TOP)

INCS = -I$(TOP) -I$(TOP)/OSLib -I.

CC = @CC@
LD = @LD@
CFLAGS = $(INCS) @CFLAGS@
LDFLAGS = @LDFLAGS@
ARFLAGS = @ARFLAGS@

#SRCS = vdpdraw.pl
SRCS = generatevdpdrawrow.c generatevdpdrawrowtext.c
EXECS = $(SRCS:%.c=%)
GENSRCS = $(TOP)/vdpdrawrow.c $(TOP)/vdpdrawrowtext.c


all: compile

%: %.c  $(TOP)/v9t9_config.h
	$(CC) $(CFLAGS) -o $@.o $<
	gcc -o $@ $@.o 

$(SRC)/vdpdrawrow.c: generatevdpdrawrow
	./$< > $@

$(SRC)/vdpdrawrowtext.c: generatevdpdrawrowtext
	./$< > $@

#exec:
#	perl vdpdraw.pl >$(SRC)/vdpdrawrow.c
#	perl vdpdraw.pl -six >$(SRC)/vdpdrawrowtext.c

#$(SRC)/vdpdrawrow.c $(SRC)/vdpdrawrowtext.c: exec

clean: 
	rm -f $(EXECS) $(GENSRCS) *.o *.obj

dep: 

config:

compile: $(EXECS) $(GENSRCS)

