From 114c18532a9d0a6b8ba8f7323506e91f16b4b6e7 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Fri, 29 Mar 2002 06:54:23 +0000 Subject: [PATCH] Added new install rules for makefiles and updated makedefs and makerules... more to come --- Make/instrules.new | 58 ++++++++++++++++++++++++++++++++++++++++++++++ Make/makedefs.new | 25 ++++++++++---------- Make/makerules.new | 2 +- 3 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 Make/instrules.new diff --git a/Make/instrules.new b/Make/instrules.new new file mode 100644 index 000000000..740956a49 --- /dev/null +++ b/Make/instrules.new @@ -0,0 +1,58 @@ +install : instbin instdev + +instbin : + @$(MAKE) INSTSRC=$(TOPDIR)/bin INSTDEST=$(INST_DEMOS) \ + INSTARGS="$(INSTARGS) -m 755" __install + @$(MAKE) INSTSRC=$(TOPDIR)/lib INSTDEST=$(INST_LIBS) \ + INSTARGS="$(INSTARGS) -m 755" __install + @$(MAKE) INSTSRC=$(TOPDIR)/lib/osgPlugins INSTDEST=$(INST_PLUGINS)\ + INSTARGS="$(INSTARGS) -m 755" __install + + +instdev : + @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\ + INSTARGS="$(INSTARGS) -m 644" __install;\ + 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\ + INSTARGS="$(INSTARGS) -m 644" __install;\ + fi\ + done + +instlinks : instlinksbin instlinksdev + +instlinksbin : + @$(MAKE) INSTARGS=" -t " instbin + +instlinksdev : + @$(MAKE) INSTARGS=" -t " instdev + + +__install : + @[ -n "$(INSTSRC)" ] || echo "Internal error (INSTSRC definition)" + @[ -n "$(INSTSRC)" ] && echo > /dev/null + @[ -n "$(INSTDEST)" ] || echo "Internal error (INSTDEST definition)" + @[ -n "$(INSTDEST)" ] && echo > /dev/null + @[ -d $(INSTDEST) ] || mkdir -p $(INSTDEST) + @cd $(INSTSRC);\ + if [ -n "`ls -1 | grep -v CVS`" ]; then\ + for f in `ls -1 | grep -v CVS`; \ + do\ + if [ -f $$f ] ; \ + then \ + echo install $(INSTARGS) $$f $(INSTDEST);\ + install $(INSTARGS) $$f $(INSTDEST);\ + fi\ + done\ + fi + + + diff --git a/Make/makedefs.new b/Make/makedefs.new index 478d61151..2946a89ee 100644 --- a/Make/makedefs.new +++ b/Make/makedefs.new @@ -22,6 +22,16 @@ BININST = bin LIBINST = lib PLUGININST = lib/osgPlugins +INST_DEMOS = /usr/share/OpenSceneGraph/bin +INST_LIBS = /usr/share/OpenSceneGraph/lib +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 + +LINK = ln -sf + + ALL_TARGETS = \ opt\ debug\ @@ -46,8 +56,6 @@ ifeq ($(OS),SunOS) ARCHARGS = LINKARGS = DYNAMICLIBRARYLIB = -ldl - OSGUTIL = -losgUtil - OSGDB = -losgDB OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg FREETYPE_LIB = -lfreetype GLUT_LIB = -lglut @@ -75,15 +83,13 @@ ifeq ($(OS),IRIX) ARCHARGS = LINKARGS = -LANG:std -OPT:Olimit=0 DYNAMICLIBRARYLIB = -ldl - OSGUTIL = -losgUtil - OSGDB = -losgDB OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg FREETYPE_LIB = -lfreetype GLUT_LIB = -lglut GL_LIBS = -lGLU -lGL X_LIBS = -lXext -lXi -lXmu -lX11 SOCKET_LIBS = - OTHER_LIBS = + OTHER_LIBS = -lm SO_EXT = so PLUGIN_EXT = so @@ -101,8 +107,6 @@ ifeq ($(OS),Linux) ARCHARGS = LINKARGS = -L/usr/X11R6/lib DYNAMICLIBRARYLIB = -ldl - OSGUTIL = -losgUtil - OSGDB = -losgDB OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg FREETYPE_LIB = -lfreetype GLUT_LIB = -lglut @@ -126,8 +130,6 @@ ifeq ($(OS),FreeBSD) ARCHARGS = LINKARGS = -L/usr/X11R6/lib -L/usr/local/lib -rpath /usr/local/lib DYNAMICLIBRARYLIB = -ldl - OSGUTIL = -losgUtil - OSGDB = -losgDB OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg FREETYPE_LIB = -lfreetype GLUT_LIB = -lglut @@ -151,8 +153,6 @@ ifeq ($(OS),MacOSX) ARCHARGS = LINKARGS = -all_load -L/usr/local/lib -L/usr/lib DYNAMICLIBRARYLIB = - OSGUTIL = -losgUtil - OSGDB = -losgDB OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg FREETYPE_LIB = -lfreetype GLUT_LIB = @@ -189,8 +189,6 @@ ifeq ($(OS),CYGWIN_NT-5.0) ARCHARGS = LINKARGS = -W -Wall DYNAMICLIBRARYLIB = - OSGUTIL = -losgutil - OSGDB = -losgdb OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg GL_LIBS = -lglu32 -lopengl32 @@ -216,6 +214,7 @@ ifeq ($(OS),CYGWIN_NT-5.0) OTHER_LIBS = $(GL_LIBS) SO_EXT = dll PLUGIN_EXT = dll + LINK = cp -f endif diff --git a/Make/makerules.new b/Make/makerules.new index 5b9c21983..add8c49ab 100644 --- a/Make/makerules.new +++ b/Make/makerules.new @@ -207,7 +207,7 @@ __link : '{ print substr($$1,length($$2)+2,512) }'`/`basename $(LNDEST)`;\ cd `dirname $(LNDEST)`;\ rm -f `basename $(LNDEST)`;\ - ln -sf $$LINK `basename $(LNDEST)`;\ + $(LINK) $$LINK `basename $(LNDEST)`;\ fi