head	0.3;
access;
symbols;
locks; strict;
comment	@# @;


0.3
date	97.09.09.18.56.31;	author rsmit06;	state Exp;
branches;
next	0.2;

0.2
date	97.08.21.17.00.49;	author rsmit06;	state Exp;
branches;
next	0.1;

0.1
date	97.08.21.07.35.01;	author rsmit06;	state Exp;
branches;
next	;


desc
@Makefile
@


0.3
log
@Added README to tar-file.
@
text
@# $Id: Makefile,v 0.2 1997/08/21 17:00:49 rsmit06 Exp rsmit06 $
# Makefile for shared library on Linux with gcc.
#
# $Log: Makefile,v $
# Revision 0.2  1997/08/21 17:00:49  rsmit06
# Replaced 'shared' with '$(SHARED)'
#
# Revision 0.1  1997/08/21 07:35:01  rsmit06
# First usable version.
#

CFLAGS		  = -O2 -Wall -pedantic -Wstrict-prototypes -m486\
				-fomit-frame-pointer -fPIC
#CFLAGS        = -ggdb

LDEST		  = /usr/local/lib
HDEST		  = /usr/local/include

HDR			  = list.h
BASENAME	  = list
VERSION_MAJOR = 0
VERSION_MINOR = 1
BUILDDIR      = list


OBJS		  = ls_add.o ls_init.o ls_rm.o ls_trav.o ls_util.o

##### No editing necessary beyond this point
.PHONY:	clean clobber shared 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)

depend:	$(OBJS:.o=.c)
	gcc -MM $(OBJS:.o=.c) >depend

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

clean:;		-rm -f $(OBJS) core *~ $(SHARED) $(TARFILE)

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)

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)

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

# DO NOT DELETE THIS LINE 
include depend

@


0.2
log
@Replaced 'shared' with '$(SHARED)'
@
text
@d1 1
a1 1
# $Id: Makefile,v 0.1 1997/08/21 07:35:01 rsmit06 Exp rsmit06 $
d5 3
d79 1
a79 1
	$(BUILDDIR)/Makefile $(BUILDDIR)/*.h $(BUILDDIR)/*.c\
@


0.1
log
@First usable version
@
text
@d1 1
a1 1
# $Id$
d4 4
a7 1
# $Log$
d23 1
a23 1
OBJS		  = ls_add.o ls_init.o ls_rm.o ls_trav.o
d34 1
a34 1
all:		depend shared
d39 1
a39 1
shared:		$(OBJS)
d77 1
a77 1
	$(BUILDDIR)/depend $(BUILDDIR)/RCS/*
@
