# This is the makefile for the current (19/05/94) edit of the Manchester
# NURBS library. To use this you will need to set several of the 
# definitions near the top of the file, and then type
# make followed by whatever name you want the library to be called.
# usually libnurb.a

SOURCES= nurb1.c nurb2.c nurb3.c nurb4.c nurb5.c nurb6.c 
OBJECTS= $(SOURCES:.c=.o)

# Set NURBLIB to the name you want the library to have

NURBLIB= libnurb.a

# Set CC to indicate the compiler you wish to use
# together with the flags
INCLUDES = -I../include
LIBRARIES = -ltran -lm

DEFINES = -DSUN -DNURB
CC= cc
CFLAGS= -Aa -g -c $(DEFINES) $(INCLUDES)
LD= ld
LDFLAGS= -o $(NURBLIB) $(LIBRARIES)

$(NURBLIB): $(SOURCES) libtran.a
	$(CC) $(CFLAGS) $(SOURCES)
	ar crv $(NURBLIB) nurb1.o nurb2.o nurb3.o nurb4.o nurb5.o nurb6.o 
	cp $(NURBLIB) ../library


# This bit builds the transforms library. This started life as part of
# the PHIGS toolkit (PTK) and has since been fiddled with!

libtran.a: tran.c
	$(CC) $(CFLAGS) tran.c
	ar cr libtran.a tran.o
	ranlib libtran.a
	mv libtran.a ../library

library: $(NURBLIB)
	cp $(NURBLIB) ../library/$(NURBLIB)
	/usr/bin/rm -f $(NURBLIB)

$(OBJECTS): $(SOURCES)

$(NURBLIB)(%.o): %.o
	@true
clean:
	@echo Removing Files
	rm -f $(OBJECTS)



