diff --git a/Make/instrules.new b/Make/instrules.new index d6094060b..d8580aa68 100644 --- a/Make/instrules.new +++ b/Make/instrules.new @@ -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 + + + + + diff --git a/Make/makedefs.new b/Make/makedefs.new index 3b41c596d..dcabed1af 100644 --- a/Make/makedefs.new +++ b/Make/makedefs.new @@ -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 diff --git a/Make/makerules.new b/Make/makerules.new index add8c49ab..2ffd7c55f 100644 --- a/Make/makerules.new +++ b/Make/makerules.new @@ -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