RPA Toolkit
Added support for installing to alternative location.
authorMartin Stoilov <martin@rpasearch.com>
Thu, 11 Oct 2012 00:53:21 +0000 (17:53 -0700)
committerMartin Stoilov <martin@rpasearch.com>
Thu, 11 Oct 2012 00:53:21 +0000 (17:53 -0700)
build/unix/build.mk
build/unix/config.mk
rex/build/unix/rex.mk
rexcc/build/unix/rexcc.mk
rexgrep/build/unix/rexgrep.mk
rlib/build/unix/rlib.mk
rpa/build/unix/rpa.mk
rpagrep/build/unix/rgrep.mk
rvm/build/unix/rvm.mk

index ce0adc3..9acb0b8 100644 (file)
@@ -44,23 +44,28 @@ clean:
        +make -C $(ROOT_DIR)/rexcc/build/unix/$(ARCHDIR) clean
        +make -C $(ROOT_DIR)/rjs/build/unix/$(ARCHDIR) clean
 
+$(RPATK_BIN_INSTALL) :
+       mkdir -p $(RPATK_BIN_INSTALL)
+
+$(RPATK_LIB_INSTALL) :
+       mkdir -p $(RPATK_LIB_INSTALL)
 
 $(RPATK_INC_INSTALL) :
-       mkdir $(RPATK_INC_INSTALL)
+       mkdir -p $(RPATK_INC_INSTALL)
 
 $(RPATK_INC_INSTALL)/rlib :
-       mkdir $(RPATK_INC_INSTALL)/rlib
+       mkdir -p $(RPATK_INC_INSTALL)/rlib
 
 $(RPATK_INC_INSTALL)/rvm :
-       mkdir $(RPATK_INC_INSTALL)/rvm
+       mkdir -p $(RPATK_INC_INSTALL)/rvm
 
 $(RPATK_INC_INSTALL)/rpa :
-       mkdir $(RPATK_INC_INSTALL)/rpa
+       mkdir -p $(RPATK_INC_INSTALL)/rpa
 
 $(RPATK_INC_INSTALL)/rex :
-       mkdir $(RPATK_INC_INSTALL)/rex
+       mkdir -p $(RPATK_INC_INSTALL)/rex
 
-install: $(RPATK_INC_INSTALL) $(RPATK_INC_INSTALL)/rlib $(RPATK_INC_INSTALL)/rvm $(RPATK_INC_INSTALL)/rpa $(RPATK_INC_INSTALL)/rex
+install: $(RPATK_INC_INSTALL) $(RPATK_BIN_INSTALL) $(RPATK_LIB_INSTALL) $(RPATK_INC_INSTALL)/rlib $(RPATK_INC_INSTALL)/rvm $(RPATK_INC_INSTALL)/rpa $(RPATK_INC_INSTALL)/rex
        cp $(ROOT_DIR)/arch/unix/$(ARCHDIR)/rtypes.h $(RPATK_INC_INSTALL)
        +make -C $(ROOT_DIR)/rlib/build/unix/$(ARCHDIR) install
        +make -C $(ROOT_DIR)/rpa/build/unix/$(ARCHDIR) install
@@ -69,7 +74,9 @@ install: $(RPATK_INC_INSTALL) $(RPATK_INC_INSTALL)/rlib $(RPATK_INC_INSTALL)/rvm
        +make -C $(ROOT_DIR)/rpagrep/build/unix/$(ARCHDIR) install
        +make -C $(ROOT_DIR)/rexgrep/build/unix/$(ARCHDIR) install
        +make -C $(ROOT_DIR)/rexcc/build/unix/$(ARCHDIR) install
-       ldconfig -n $(RTK_LIB_INSTALL)
+ifeq ($(RPATK_LDCONFIG), 1)
+       ldconfig -n $(RPATK_LIB_INSTALL)
+endif
 
 uninstall:
        +make -C $(ROOT_DIR)/rlib/build/unix/$(ARCHDIR) uninstall
index 055f8c6..523c41f 100644 (file)
@@ -1,5 +1,15 @@
-RTK_LIB_INSTALL=/usr/lib
-RPATK_INC_INSTALL=/usr/include/rpatk
+ifndef RPATK_BIN_INSTALL
+RPATK_BIN_INSTALL = ${RPATK_INSTALL_PREFIX}/usr/bin
+endif 
+
+ifndef RPATK_LIB_INSTALL
+RPATK_LIB_INSTALL = ${RPATK_INSTALL_PREFIX}/usr/lib
+endif
+
+ifndef RPATK_INC_INSTALL
+RPATK_INC_INSTALL = ${RPATK_INSTALL_PREFIX}/usr/include/rpatk
+endif
+
 ARCHDIR = $(shell basename $(shell pwd))
 OS = $(shell uname | tr "[:upper:]" "[:lower:]")
 
index e05cc04..223e871 100644 (file)
@@ -62,11 +62,11 @@ clean:
        -rm -f $(ROOT_DIR)/*~
 
 install:
-       cp $(TARGET_REX_SO) $(RTK_LIB_INSTALL)
-       cp $(TARGET_REX_LIB) $(RTK_LIB_INSTALL)
+       cp $(TARGET_REX_SO) $(RPATK_LIB_INSTALL)
+       cp $(TARGET_REX_LIB) $(RPATK_LIB_INSTALL)
        cp $(REX_SRCDIR)/*.h $(RPATK_INC_INSTALL)/rex
 
 uninstall:
-       -rm -f $(RTK_LIB_INSTALL)/$(REX_LIB)
-       -rm -f $(RTK_LIB_INSTALL)/$(REX_SO_NAME)*
+       -rm -f $(RPATK_LIB_INSTALL)/$(REX_LIB)
+       -rm -f $(RPATK_LIB_INSTALL)/$(REX_SO_NAME)*
        -rm -f $(RPATK_INC_INSTALL)/rex/*
index 4968314..16fca19 100644 (file)
@@ -1,4 +1,4 @@
-REXCC_BIN_INSTALL = /usr/bin
+REXCC_BIN_INSTALL = ${RPATK_BIN_INSTALL}
 RLIB_SRCDIR = $(ROOT_DIR)/rlib
 RVM_SRCDIR = $(ROOT_DIR)/rvm
 RPA_SRCDIR = $(ROOT_DIR)/rpa
index ec3d67e..777c46a 100644 (file)
@@ -1,4 +1,4 @@
-REXGREP_BIN_INSTALL = /usr/bin
+REXGREP_BIN_INSTALL = ${RPATK_BIN_INSTALL}
 RLIB_SRCDIR = $(ROOT_DIR)/rlib
 RVM_SRCDIR = $(ROOT_DIR)/rvm
 RPA_SRCDIR = $(ROOT_DIR)/rpa
index a07b284..567f654 100644 (file)
@@ -1,4 +1,3 @@
-RPATK_LIB_INSTALL=/usr/lib
 RLIB_SRCDIR = $(ROOT_DIR)/rlib
 RLIB_SO_VERSION = 2.0
 RLIB_SO_NAME = librlib.so
index bf9c2e9..4c4311a 100644 (file)
@@ -49,11 +49,11 @@ clean:
        -rm -f $(ROOT_DIR)/*~
 
 install:
-       cp $(TARGET_RPA_SO) $(RTK_LIB_INSTALL)
-       cp $(TARGET_RPA_LIB) $(RTK_LIB_INSTALL)
+       cp $(TARGET_RPA_SO) $(RPATK_LIB_INSTALL)
+       cp $(TARGET_RPA_LIB) $(RPATK_LIB_INSTALL)
        cp $(RPA_SRCDIR)/*.h $(RPATK_INC_INSTALL)/rpa
 
 uninstall:
-       -rm -f $(RTK_LIB_INSTALL)/$(RPA_LIB)
-       -rm -f $(RTK_LIB_INSTALL)/$(RPA_SO_NAME)*
+       -rm -f $(RPATK_LIB_INSTALL)/$(RPA_LIB)
+       -rm -f $(RPATK_LIB_INSTALL)/$(RPA_SO_NAME)*
        -rm -f $(RPATK_INC_INSTALL)/rpa/*
index 36f19f5..f3dc2c4 100644 (file)
@@ -1,4 +1,4 @@
-RPAGREP_BIN_INSTALL = /usr/bin
+RPAGREP_BIN_INSTALL = ${RPATK_BIN_INSTALL}
 RLIB_SRCDIR = $(ROOT_DIR)/rlib
 RVM_SRCDIR = $(ROOT_DIR)/rvm
 RPA_SRCDIR = $(ROOT_DIR)/rpa
index 1d18452..6f092c2 100644 (file)
@@ -1,4 +1,3 @@
-RTK_LIB_INSTALL=/usr/lib
 RVM_SRCDIR = $(ROOT_DIR)/rvm
 RVM_SO_VERSION = 2.0
 RVM_SO_NAME = librvm.so
@@ -46,11 +45,11 @@ clean:
        -rm -f $(ROOT_DIR)/*~
 
 install:
-       cp $(TARGET_RVM_SO) $(RTK_LIB_INSTALL)
-       cp $(TARGET_RVM_LIB) $(RTK_LIB_INSTALL)
+       cp $(TARGET_RVM_SO) $(RPATK_LIB_INSTALL)
+       cp $(TARGET_RVM_LIB) $(RPATK_LIB_INSTALL)
        cp $(RVM_SRCDIR)/*.h $(RPATK_INC_INSTALL)/rvm
 
 uninstall:
-       -rm -f $(RTK_LIB_INSTALL)/$(RVM_LIB)
-       -rm -f $(RTK_LIB_INSTALL)/$(RVM_SO_NAME)*
+       -rm -f $(RPATK_LIB_INSTALL)/$(RVM_LIB)
+       -rm -f $(RPATK_LIB_INSTALL)/$(RVM_SO_NAME)*
        -rm -f $(RPATK_INC_INSTALL)/rvm/*