CC=gcc
MAKE=make

CFLAGS=-Wall -pedantic -ansi -g -Werror -fsigned-char `aalib-config --cflags`
LDFLAGS=`aalib-config --libs`

OBJ=aadrawline.o aadrawcircle.o aadrawellipse.o aadrawpoly.o aarenderframe.o
ARCHIVE_NAME=aa_helper.a

ifeq ($(DEBUG), 1)
CFLAGS += -g -Werror
endif

all: arfile
	@echo 'Use "make test" to make & run tests'

test: arfile test.o
	$(CC) -o test $(CXXFLAGS) $(LDFLAGS) test.o $(ARCHIVE_NAME)
	./test

arfile: $(OBJ)
	ar -r $(ARCHIVE_NAME) $(OBJ)
	ranlib $(ARCHIVE_NAME)

clean:
	rm -f *.o *.a core test
