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 $(MAKE) INSTALL="$(INSTLINKBIN)" instbin
instlinksdev : 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 : __install :
@ -43,15 +70,57 @@ __install :
@[ -n "$(INSTDEST)" ] || echo "Internal error (INSTDEST definition)" @[ -n "$(INSTDEST)" ] || echo "Internal error (INSTDEST definition)"
@[ -n "$(INSTDEST)" ] && echo > /dev/null @[ -n "$(INSTDEST)" ] && echo > /dev/null
@[ -d $(INSTDEST) ] || mkdir -p $(INSTDEST) @[ -d $(INSTDEST) ] || mkdir -p $(INSTDEST)
@echo INSTSRC is $(INSTSRC)
@cd $(INSTSRC);\ @cd $(INSTSRC);\
THISDIR=`pwd`;\
if [ -n "`ls -1 | grep -v CVS`" ]; then\ if [ -n "`ls -1 | grep -v CVS`" ]; then\
for f in `ls -1 | grep -v CVS`; \ for f in `ls -1 | grep -v CVS`; \
do\ do\
if [ -f $$f ] ; \ if [ -f $$f ] ; \
then \ then \
echo $(INSTALL) $$f $(INSTDEST);\ echo $(INSTALL) $$THISDIR/$$f $(INSTDEST);\
$(INSTALL) $$THISDIR/$$f $(INSTDEST);\
fi\ fi\
done\ done\
fi 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

@ -71,6 +71,9 @@ ifeq ($(OS),SunOS)
PLUGIN_EXT = so PLUGIN_EXT = so
TIFF_LIB = -ltiff TIFF_LIB = -ltiff
INSTBIN = cp
INSTDEV = cp
endif endif
#### IRIX Specific definitions #### 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 # The first four lines check to see that both LNSRC and LNDEST have been
# defined. # 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 # if the current link is not pointing to the intended destination
# then # then
@ -166,11 +166,11 @@ depend : $(MAKEDEPEND)
# compute the link path by the following steps # compute the link path by the following steps
# a) define SRCDIR as the current absolute directory # a) define SRCDIR as the current absolute directory
# appended by the directory of the intended source of the link # 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 # the directory of the intended destination of the link
# c) define a temproary variable T to be the absolute path of # c) define a temproary variable T to be the absolute path of
# the destination directory less the prefix of the absolute # 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/ # e.g. /root/work/thisdir/bin/ - /root/work/thisdir/ = bin/
# d) Run a loop, truncating the path represented by T until # d) Run a loop, truncating the path represented by T until
# 'dirname' returns '.'. On each iteration increment PFX # 'dirname' returns '.'. On each iteration increment PFX
@ -179,7 +179,7 @@ depend : $(MAKEDEPEND)
# e.g. If DESTDIR is lib/osgPlugins, PFX is ../../ # e.g. If DESTDIR is lib/osgPlugins, PFX is ../../
# e) Define the link as a concatenation of PFX and the absolute # e) Define the link as a concatenation of PFX and the absolute
# path of the source directory less the absolute path of # path of the source directory less the absolute path of
# $(ROOT) # $(TOPDIR)
# #
# Change directories in to the link destination directory # Change directories in to the link destination directory
# run the link command # run the link command