#
# $Id: Makefile,v 1.2 1998/07/17 18:11:20 nicb Exp $
#							CSCORE makef

TOP = ../..

include $(TOP)/Make.Variables

THISDIR=util1/cscore
OBJS = 	$(TOP)/cscormai.o $(TOP)/cscorfns.o $(TOP)/rdscor.o \
	$(TOP)/memalloc.o $(TOP)/cscore.o
SRCS = Makefile
HEADERS=$(TOP)/cscore.h
LIBCSCORE_STAT=lib$(APP_PREFIX)cscore.a
LIBCSCORE_DYN=lib$(APP_PREFIX)cscore.so
LIBCSCORE_DYNSO=lib$(APP_PREFIX)cscore.so.$(VERSION)
SUBLIBS=$(LIBCSCORE)


all:		$(LIBCSCORE)		# defined in .config

$(LIBCSCORE_STAT):	$(OBJS)
		-rm $(LIBCSCORE)
		ar q $(LIBCSCORE) $(OBJS)
		-ranlib $(LIBCSCORE)

$(LIBCSCORE_DYNSO):	$(OBJS)
		$(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIBCSCORE_DYN) \
			-o $(LIBCSCORE_DYNSO) $(OBJS)

install: 	install-$(LIBCSCORE)
		if [ ! -d $(INCLUDE) ]; then $(MKDIR) $(INCLUDE); fi
		for i in $(HEADERS);\
		do \
			$(INSTALL) -m 444 $$i $(INCLUDE); \
		done

install-$(LIBCSCORE_STAT):	$(LIBCSCORE_STAT)
		if [ ! -d $(LIB) ]; then $(MKDIR) $(LIB); fi
		install -s -m 444 $(LIBCSCORE_STAT) $(LIB)

install-$(LIBCSCORE_DYNSO):	$(LIBCSCORE_DYNSO)
		install -m 755 $(LIBCSCORE_DYNSO) $(LIB)
		ln -sf $(LIB)/$(LIBCSCORE_DYNSO) $(LIB)/$(LIBCSCORE_DYN)
		/sbin/ldconfig

include $(TOP)/Make.Subdirs
#
# $Log: Makefile,v $
# Revision 1.2  1998/07/17 18:11:20  nicb
# [changes and additions by nicb@axnet.it]
#
# - configure process:
# 	- added canonical host detection and install detection
# 	- modified Makefiles to suit the install macro better
# 	- static linking does not imply -static anymore (not standalone,
# 	  just with csound library integration)
#
# - sources:
# 	- integrated back some changes made to suit the dynamical
# 	  main/library linking that somehow got lost in the original
# 	  sources (wonder how it did work up to now, but anyway it
# 	  was not working for static linking)
#
# Revision 1.1.1.1  1998/07/08 20:48:18  nicb
# - Initial Revision (second rebuilding of the repository)
#
# Revision 0.0  1998/05/16 12:05:37  nicb
# Initial Revision
#
