head	1.7;
access
	rsmit06;
symbols;
locks; strict;
comment	@# @;


1.7
date	97.09.28.12.32.05;	author rsmit06;	state Exp;
branches;
next	1.6;

1.6
date	97.09.08.20.52.40;	author rsmit06;	state Stab;
branches;
next	1.5;

1.5
date	97.09.06.17.06.10;	author rsmit06;	state Exp;
branches;
next	1.4;

1.4
date	97.09.01.20.26.15;	author rsmit06;	state Exp;
branches;
next	1.3;

1.3
date	97.09.01.20.10.09;	author rsmit06;	state Exp;
branches;
next	1.2;

1.2
date	97.09.01.19.26.33;	author rsmit06;	state Exp;
branches;
next	1.1;

1.1
date	97.09.01.19.20.26;	author rsmit06;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Changed basename and build directory to `at', for Affine Transforms.
@
text
@# $Id: Makefile,v 1.6 1997/09/08 20:52:40 rsmit06 Stab rsmit06 $
#
# Makefile for shared library on Linux with gcc.
#
# $Log: Makefile,v $
# Revision 1.6  1997/09/08 20:52:40  rsmit06
# Changed BUILDDIR to "matrix"
#
# Revision 1.5  1997/09/06 17:06:10  rsmit06
# Removed -fomit-frame-pointer to solve incorrect determinant
# calculations and core dumps in programs using the library.
#
# Revision 1.4  1997/09/01 20:26:15  rsmit06
# Added LIBS variable.
#
# Revision 1.3  1997/09/01 20:10:09  rsmit06
# Added -lm to link, to solve unreferenced symbols sin and cos.
#
# Revision 1.2  1997/09/01 19:26:33  rsmit06
# Changed build directory into matrix-1.0
#
# Revision 1.1  1997/09/01 19:20:26  rsmit06
# Initial revision
#
#

# compilation flags
CFLAGS		  = -O2 -Wall -pedantic -Wstrict-prototypes -m486 -fPIC
#CFLAGS        = -ggdb

# extra libraries to be linked
LIBS		  = -lm

# where to install the library and header file
LDEST		  = /usr/local/lib
HDEST		  = /usr/local/include

# name of the library header
HDR			  = at.h
# 'lib' wil be prepended automagically to the basename.
# for libfoo.so.0.1 the basename is foo.
BASENAME	  = at
VERSION_MAJOR = 1
VERSION_MINOR = 0
# directory in which this library is built
BUILDDIR      = at

# list of object files
OBJS		  = matrix.o vector.o

##### No editing necessary beyond this point
.PHONY:	clean clobber all install uninstall tar

SHARED		  = lib$(BASENAME).so.$(VERSION_MAJOR).$(VERSION_MINOR)
TARFILE		  = lib$(BASENAME)-$(VERSION_MAJOR).$(VERSION_MINOR).tar.gz

CC			  = gcc
INSTALL		  = cp

all:		depend $(SHARED)

# if the file depend doesn't exist, run 'make depend' first.
depend:	$(OBJS:.o=.c)
	gcc -MM $(OBJS:.o=.c) >depend

# build the shared library
$(SHARED):	$(OBJS)
	gcc -shared $(LIBS) -Wl,-soname,lib$(BASENAME).so.$(VERSION_MAJOR) \
	-o $(SHARED) $(OBJS)
	strip -g --strip-unneeded $(SHARED)

# remove all files that can be created by this makefile
clean:;		-rm -f $(OBJS) core *~ $(SHARED) $(TARFILE)

# install the library. Must be run as root.
install:	$(SHARED)
	@@if [ `id -u` != 0 ]; then \
		echo "You must be root to install the library!"; \
		exit 1; \
	fi
	@@if [ $(LDEST) = . -o $(HDEST) = . ]; then \
		echo "Can't install in current directory!";\
		exit 1; \
	fi
	rm -f $(LDEST)/$(SHARED)
	rm -f $(LDEST)/lib$(BASENAME).so.$(VERSION_MAJOR)
	rm -f $(LDEST)/lib$(BASENAME).so
	$(INSTALL) $(SHARED) $(LDEST) ; cd $(LDEST) ;\
	ln -s $(SHARED) lib$(BASENAME).so.$(VERSION_MAJOR) ;\
	ln -s $(SHARED) lib$(BASENAME).so 
	rm -f $(HDEST)/$(HDR)
	$(INSTALL) $(HDR) $(HDEST)

# remove the installed library. Must be run as root.
uninstall:;
	@@if [ `id -u` != 0 ]; then \
		echo "You must be root to uninstall the library!"; \
		exit 1; \
	fi
	rm -f $(LDEST)/$(SHARED)
	rm -f $(LDEST)/lib$(BASENAME).so.$(VERSION_MAJOR)
	rm -f $(LDEST)/lib$(BASENAME).so
	rm -f $(HDEST)/$(HDR)

# make a source distribution file.
tar:;
	cd ..; tar -czf $(BUILDDIR)/$(TARFILE)\
	$(BUILDDIR)/Makefile $(BUILDDIR)/*.h $(BUILDDIR)/*.c\
	$(BUILDDIR)/depend $(BUILDDIR)/RCS/* $(BUILDDIR)/README\
	$(BUILDDIR)/lib$(BASENAME).3
# $(BUILDDIR)/RCS/* 

# DO NOT DELETE THIS LINE 
include depend

@


1.6
log
@Changed BUILDDIR to "matrix"
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.5 1997/09/06 17:06:10 rsmit06 Exp rsmit06 $
d6 3
d39 1
a39 1
HDR			  = matrix.h
d42 1
a42 1
BASENAME	  = mat
d46 1
a46 1
BUILDDIR      = matrix
d49 1
a49 1
OBJS		  = matrix.o
d109 3
a111 2
	$(BUILDDIR)/depend $(BUILDDIR)/RCS/* 
#	$(BUILDDIR)/depend $(BUILDDIR)/lib$(BASENAME).3 $(BUILDDIR)/RCS/* 
@


1.5
log
@Removed -fomit-frame-pointer to solve incorrect determinant
calculations and core dumps in programs using the library.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.4 1997/09/01 20:26:15 rsmit06 Exp rsmit06 $
d6 4
d43 1
a43 1
BUILDDIR      = matrix-1.0
@


1.4
log
@Added LIBS variable.
@
text
@d1 2
a2 1
# $Id: Makefile,v 1.3 1997/09/01 20:10:09 rsmit06 Exp rsmit06 $
d6 3
d21 1
a21 2
CFLAGS		  = -O2 -Wall -pedantic -Wstrict-prototypes -m486\
				-fomit-frame-pointer -fPIC
@


1.3
log
@Added -lm to link, to solve unreferenced symbols sin and cos.
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.2 1997/09/01 19:26:33 rsmit06 Exp rsmit06 $
d5 3
d16 1
a16 1

d21 3
d58 1
a58 1
	gcc -shared -lm -Wl,-soname,lib$(BASENAME).so.$(VERSION_MAJOR) \
@


1.2
log
@Changed build directory into matrix-1.0
@
text
@d1 1
a1 1
# $Id: Makefile,v 1.1 1997/09/01 19:20:26 rsmit06 Exp rsmit06 $
d5 3
d52 1
a52 1
	gcc -shared -Wl,-soname,lib$(BASENAME).so.$(VERSION_MAJOR) \
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
# $Id$
d4 4
a7 1
# $Log$
d27 1
a27 1
BUILDDIR      = matrix
@
