Completed and tested instrules.new

This commit is contained in:
Don BURNS 2002-04-01 03:39:29 +00:00
parent 8b6872d0c5
commit 35f752bf89
3 changed files with 79 additions and 7 deletions

View File

@ -33,8 +33,35 @@ instlinksbin :
$(MAKE) INSTALL="$(INSTLINKBIN)" instbin
instlinksdev :
$(MAKE) INSTALL="$(INSTLINKDEV)" instbin
$(MAKE) INSTALL="$(INSTLINKDEV)" instdev
instclean : instcleanbin instcleandev
instcleanbin :
@$(MAKE) INSTSRC=$(TOPDIR)/bin INSTDEST=$(INST_DEMOS) \
INSTALL?="$(INSTBIN)" __instclean
@$(MAKE) INSTSRC=$(TOPDIR)/lib INSTDEST=$(INST_LIBS) \
INSTALL?="$(INSTBIN)" __instclean
@$(MAKE) INSTSRC=$(TOPDIR)/lib/osgPlugins INSTDEST=$(INST_PLUGINS)\
INSTALL?="$(INSTBIN)" __instclean
instcleandev :
@for d in `ls -1 $(TOPDIR)/include/ | grep -v CVS`; \
do\
if [ -d $(TOPDIR)/include/$$d ]; \
then \
$(MAKE) INSTSRC=$(TOPDIR)/include/$$d INSTDEST=$(INST_INCLUDE)/$$d\
INSTALL?="$(INSTDEV)" __instclean;\
fi\
done
@for d in `ls -1 $(TOPDIR)/src/Demos | grep -v CVS`; \
do\
if [ -d $(TOPDIR)/src/Demos/$$d ]; \
then \
$(MAKE) INSTSRC=$(TOPDIR)/src/Demos/$$d INSTDEST=$(INST_DEMO_SRC)/$$d\
INSTALL?="$(INSTDEV)" __instclean;\
fi\
done
__install :
@ -43,15 +70,57 @@ __install :
@[ -n "$(INSTDEST)" ] || echo "Internal error (INSTDEST definition)"
@[ -n "$(INSTDEST)" ] && echo > /dev/null
@[ -d $(INSTDEST) ] || mkdir -p $(INSTDEST)
@echo INSTSRC is $(INSTSRC)
@cd $(INSTSRC);\
THISDIR=`pwd`;\
if [ -n "`ls -1 | grep -v CVS`" ]; then\
for f in `ls -1 | grep -v CVS`; \
do\
if [ -f $$f ] ; \
then \
echo $(INSTALL) $$f $(INSTDEST);\
echo $(INSTALL) $$THISDIR/$$f $(INSTDEST);\
$(INSTALL) $$THISDIR/$$f $(INSTDEST);\
fi\
done\
fi
__instclean :
@[ -n "$(INSTSRC)" ] || echo "Internal error (INSTSRC definition)"
@[ -n "$(INSTSRC)" ] && echo > /dev/null
@[ -n "$(INSTDEST)" ] || echo "Internal error (INSTDEST definition)"
@[ -n "$(INSTDEST)" ] && echo > /dev/null
@if [ -d $(INSTDEST) ] ; \
then\
cd $(INSTSRC);\
if [ -n "`ls -1 | grep -v CVS`" ]; then\
for f in `ls -1 | grep -v CVS`; \
do\
if [ -f $$f ] ; \
then \
echo "rm -f $(INSTDEST)/$$f";\
rm -f $(INSTDEST)/$$f;\
fi\
done\
fi;\
empty=`ls $(INSTDEST)`;\
if [ -z "$$empty" ];\
then\
repeat=1;\
while [ $$repeat = 1 ] ; \
do \
printf "$(INSTDEST) is empty. Remove? (y/n) [y]: ";\
read resp;\
case $$resp in \
""|Yes|YES|yes|Y|y) rm -rf $(INSTDEST); repeat=0;; \
n|N|no|NO) repeat=0;; \
*) repeat=1;; \
esac\
done\
fi\
fi

View File

@ -24,7 +24,7 @@ PLUGININST = lib/osgPlugins
INST_DEMOS = /usr/share/OpenSceneGraph/bin
INST_LIBS = /usr/share/OpenSceneGraph/lib
INST_PLUGINS = /usr/share/OpenSceneGraph/lib/osgPlugins
INST_PLUGINS = /usr/share/OpenSceneGraph/lib/osgPlugins
INST_INCLUDE = /usr/share/OpenSceneGraph/include
INST_DEMO_SRC = /usr/share/OpenSceneGraph/src/demos
INST_DATA = /usr/share/OpenSceneGraph/data
@ -71,6 +71,9 @@ ifeq ($(OS),SunOS)
PLUGIN_EXT = so
TIFF_LIB = -ltiff
INSTBIN = cp
INSTDEV = cp
endif
#### IRIX Specific definitions

View File

@ -158,7 +158,7 @@ depend : $(MAKEDEPEND)
# The first four lines check to see that both LNSRC and LNDEST have been
# defined.
#
# The (very long) following 'if' statement reads in speudo-code like this:
# The (very long) following 'if' statement reads in pseudo-code like this:
#
# if the current link is not pointing to the intended destination
# then
@ -166,11 +166,11 @@ depend : $(MAKEDEPEND)
# compute the link path by the following steps
# a) define SRCDIR as the current absolute directory
# appended by the directory of the intended source of the link
# b) define DESTDIR as the absolute path of $(ROOT) appended by
# b) define DESTDIR as the absolute path of $(TOPDIR) appended by
# the directory of the intended destination of the link
# c) define a temproary variable T to be the absolute path of
# the destination directory less the prefix of the absolute
# path of $(ROOT)
# path of $(TOPDIR)
# e.g. /root/work/thisdir/bin/ - /root/work/thisdir/ = bin/
# d) Run a loop, truncating the path represented by T until
# 'dirname' returns '.'. On each iteration increment PFX
@ -179,7 +179,7 @@ depend : $(MAKEDEPEND)
# e.g. If DESTDIR is lib/osgPlugins, PFX is ../../
# e) Define the link as a concatenation of PFX and the absolute
# path of the source directory less the absolute path of
# $(ROOT)
# $(TOPDIR)
#
# Change directories in to the link destination directory
# run the link command