#/usr/bin/make -f
# simple makefile for the test of the easy-to-use wrapper to Xlib.
# see quill.h for more information.
#
# you may modify/bastardize this makefile for your own perverted purposes.
# i know i do.

# installation targets:
#  all: make the testquill program and install libraries
#  install: install the libraries (must have superuser access)
#  testquill: make the testquill program
#  clean: remove the testquill program
#  uninstall: remove the quill libraries (gods why? :)

CC      = gcc
CFLAGS  = -O2 -funroll-loops
LDFLAGS = 
LIBDIR  = -L/usr/X11R6/lib
LIBS    = -lX11 -lm -lquill

# set the INSTROOT variable to the parent of your local lib/ and include/
# dirs (you shouldn't have to change this)
INSTROOT = /usr/local

############ you shouldn't have to change anything below this line

TARGET  = testquill
OBJS    = testquill.o

all: install $(TARGET)

clean:
	rm -f $(TARGET) $(OBJS)

install:
	cp -u quill.h $(INSTROOT)/include
	cp -u libquill.a $(INSTROOT)/lib

$(TARGET): $(OBJS)
	$(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBDIR) $(LIBS)

uninstall:
	rm -f $(INSTROOT)/include/quill.h
	rm -f $(INSTROOT)/lib/libquill.a

.c.o:
	$(CC) $(CFLAGS) -c $*.c
