
#	Proggies
CFLAGS = -mthrowback -Wall -mpoke-function-name -mlibscl -O2
CFLAGSV3M = $(CFLAGS) -march=armv3m -mtune=strongarm

CC = gcc
LIB = libfile
ASM = gcc

WOUMI = <WoumInclude$$Path>

#	Targets

all: a/libgp

#	Objects

cfiles = screen.o spr.o font.o sprplotgen.o simpspr.o paintspr.o
asmfiles = col.o scrplot.o

#	Library files

a/libgp: $(cfiles) $(asmfiles)
	$(LIB) -c a.libgp $(patsubst %.o,o.%,$(cfiles) $(asmfiles)) 

#	Object files

$(cfiles): %.o: %.c
	$(CC) -c $(CFLAGS) $< -o $@

$(asmfiles): %.o: %.s
	$(ASM) -c $(CFLAGS) $< -o $@

#	C files

screen.c: screen.h col.h $(WOUMI)lib.h.fixmath
	touch screen.c

spr.c: spr.h col.h
	touch spr.c

font.c: font.h col.h
	touch font.c

sprplotgen.c: spr.h col.h $(WOUMI)lib.h.sasm $(WOUMI)lib.h.error
	touch sprplotgen.c

simpspr.c: spr.h col.h
	touch simpspr.c

paintspr.c: spr.h col.h
	touch paintspr.c

#	Assembler files

col.s: gp.s
	touch col.s

scrplot.s: gp.s
	touch scrplot.s

plot.s: gp.s
	touch plot.s

#	Header files

spr.h: screen.h $(WOUMI)lib.h.fixmath
	touch spr.h

font.h: spr.h
	touch font.h
