CFLAGS=-g -std=c99 -Wall `pkg-config --cflags libdrm_nouveau x11 xext`
LDFLAGS=`pkg-config --libs libdrm_nouveau x11 xext`

test_objects: test_objects.o dri2_auth.o Makefile
	@echo linking $@
	@$(CC) $(CFLAGS) $(LDFLAGS) test_objects.o dri2_auth.o -o test_objects

test_objects.o: test_objects.c dri2_auth.h Makefile
	@echo building $@
	@$(CC) -c $(CFLAGS) test_objects.c

dri2_auth.o: dri2_auth.c dri2_auth.h Makefile
	@echo building $@
	@$(CC) -c $(CFLAGS) dri2_auth.c

clean:
	@echo cleaning
	@rm -f test_objects.o dri2_auth.o test_objects
