RPA Toolkit
work on the PHP extension.
authorMartin Stoilov <martin@rpasearch.com>
Tue, 14 Jun 2011 06:31:04 +0000 (23:31 -0700)
committerMartin Stoilov <martin@rpasearch.com>
Tue, 14 Jun 2011 06:31:04 +0000 (23:31 -0700)
build/linux/build.mk
phpext/prpa/config.m4
phpext/prpa/php_prpa.h
phpext/prpa/prpa.c
phpext/prpa/tests/007.phpt
phpext/prpa/tests/008.phpt [new file with mode: 0644]
rlib/build/linux/rlib.mk
rpa/build/linux/rpa.mk
rvm/build/linux/rvm.mk

index 5314701..d84f707 100644 (file)
@@ -27,3 +27,13 @@ clean:
        +make -C $(SRCDIR)/tests/testrpa/build/$(OS)/$(ARCHDIR) clean
        +make -C $(SRCDIR)/tests/testrjs/build/$(OS)/$(ARCHDIR) clean
        +make -C $(SRCDIR)/rgrep/build/$(OS)/$(ARCHDIR) clean
+
+install:
+       +make -C $(SRCDIR)/rlib/build/$(OS)/$(ARCHDIR) install
+       +make -C $(SRCDIR)/rpa/build/$(OS)/$(ARCHDIR) install
+       +make -C $(SRCDIR)/rvm/build/$(OS)/$(ARCHDIR) install
+
+uninstall:
+       +make -C $(SRCDIR)/rlib/build/$(OS)/$(ARCHDIR) uninstall
+       +make -C $(SRCDIR)/rpa/build/$(OS)/$(ARCHDIR) uninstall
+       +make -C $(SRCDIR)/rvm/build/$(OS)/$(ARCHDIR) uninstall
index 485c9fa..e9fc07c 100644 (file)
@@ -94,8 +94,8 @@ if test "$PHP_PRPA" != "no"; then
   dnl fi
 
   dnl # --with-rtk -> check for lib and symbol presence
-  LIBNAME=rlib # you may want to change this
-  LIBSYMBOL=r_utf8_mbtowc # you most likely want to change this 
+  LIBNAME=rpa # you may want to change this
+  LIBSYMBOL=rpa_dbex_version #r_utf8_mbtowc # you most likely want to change this 
 
   PRPA_SHARED_LIBADD=""
   PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
@@ -108,9 +108,10 @@ if test "$PHP_PRPA" != "no"; then
     -L$RPA_LIBDIR  -L$RVM_LIBDIR -L$RLIB_LIBDIR -lrvm -lrlib  -lrpa  -lm
   ])
 
-  PHP_ADD_LIBRARY_WITH_PATH(rpa, $RPA_LIBDIR, PRPA_SHARED_LIBADD)
-  PHP_ADD_LIBRARY_WITH_PATH(rvm, $RVM_LIBDIR, PRPA_SHARED_LIBADD)
   PHP_ADD_LIBRARY_WITH_PATH(rlib, $RLIB_LIBDIR, PRPA_SHARED_LIBADD)
+  PHP_ADD_LIBRARY_WITH_PATH(rvm, $RVM_LIBDIR, PRPA_SHARED_LIBADD)
+  PHP_ADD_LIBRARY_WITH_PATH(rpa, $RPA_LIBDIR, PRPA_SHARED_LIBADD)
+
   PHP_SUBST(PRPA_SHARED_LIBADD)
 
 
index ae0c1ed..e5c612c 100644 (file)
@@ -42,14 +42,13 @@ PHP_RINIT_FUNCTION(prpa);
 PHP_RSHUTDOWN_FUNCTION(prpa);
 PHP_MINFO_FUNCTION(prpa);
 PHP_FUNCTION(rpa_dbex_version);
-
-#if 0
-PHP_FUNCTION(rpa_dbex_strmatch);
 PHP_FUNCTION(rpa_dbex_create);
 PHP_FUNCTION(rpa_dbex_open);
 PHP_FUNCTION(rpa_dbex_close);
 PHP_FUNCTION(rpa_dbex_load);
-PHP_FUNCTION(rpa_dbex_load_string);
+PHP_FUNCTION(rpa_dbex_compile);
+#if 0
+PHP_FUNCTION(rpa_dbex_strmatch);
 PHP_FUNCTION(rpa_dbex_set_encoding);
 PHP_FUNCTION(rpa_dbex_match);
 PHP_FUNCTION(rpa_dbex_parse);
index 3ea1e26..7c183d6 100644 (file)
@@ -43,25 +43,24 @@ typedef struct _php_rpa_dbex {
 #define PHP_RPA_DBEX_RES_NAME "php rpa dbex"
 
 
-typedef struct _php_rpa_pattern {
-       rlong hPattern;
-} php_rpa_pattern;
+typedef struct _php_rpa_stat {
+       rpastat_t* stat;
+       zval *zinput;
+#ifdef ZTS
+       TSRMLS_D;
+#endif
+} php_rpa_stat;
 
-#define PHP_RPA_PATTERN_RES_NAME "php rpa pattern"
+#define PHP_RPA_STAT_RES_NAME "php rpa stat"
 
 
-typedef struct _php_cbinfo {
-       php_rpa_dbex *pPhpDbex;
-       char *php_callback;
-       zval *userdata;
-} php_cbinfo;
-
 
 static int le_rpa;
 static int le_rpa_dbex;
+static int le_rpa_stat;
 static int le_rpa_pattern;
 static void php_rpa_dbex_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-static void php_rpa_pattern_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+static void php_rpa_stat_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
 
 /* If you declare any globals in php_prpa.h uncomment this:
 ZEND_DECLARE_MODULE_GLOBALS(prpa)
@@ -76,13 +75,14 @@ static int le_prpa;
  */
 zend_function_entry prpa_functions[] = {
     PHP_FE(rpa_dbex_version, NULL)
-#if 0
-    PHP_FE(rpa_dbex_strmatch, NULL)
     PHP_FE(rpa_dbex_create, NULL)
-    PHP_FE(rpa_dbex_load_string, NULL)
-    PHP_FE(rpa_dbex_load, NULL)
     PHP_FE(rpa_dbex_open, NULL)
     PHP_FE(rpa_dbex_close, NULL)
+    PHP_FE(rpa_dbex_load, NULL)
+    PHP_FE(rpa_dbex_compile, NULL)
+
+#if 0
+    PHP_FE(rpa_dbex_strmatch, NULL)
     PHP_FE(rpa_dbex_set_encoding, NULL)
     PHP_FE(rpa_dbex_match, NULL)
     PHP_FE(rpa_dbex_parse, NULL)
@@ -153,8 +153,8 @@ PHP_MINIT_FUNCTION(prpa)
        /* If you have INI entries, uncomment these lines 
        REGISTER_INI_ENTRIES();
        */
-//    le_rpa_dbex = zend_register_list_destructors_ex(php_rpa_dbex_dtor, NULL, PHP_RPA_DBEX_RES_NAME, module_number);
-//    le_rpa_pattern = zend_register_list_destructors_ex(php_rpa_pattern_dtor, NULL, PHP_RPA_PATTERN_RES_NAME, module_number);
+    le_rpa_dbex = zend_register_list_destructors_ex(php_rpa_dbex_dtor, NULL, PHP_RPA_DBEX_RES_NAME, module_number);
+    le_rpa_stat = zend_register_list_destructors_ex(php_rpa_stat_dtor, NULL, PHP_RPA_STAT_RES_NAME, module_number);
     REGISTER_LONG_CONSTANT("RPA_ENCODING_BYTE", RPA_ENCODING_BYTE, CONST_CS | CONST_PERSISTENT);
     REGISTER_LONG_CONSTANT("RPA_ENCODING_UTF8", RPA_ENCODING_UTF8, CONST_CS | CONST_PERSISTENT);
     REGISTER_LONG_CONSTANT("RPA_ENCODING_ICASE_UTF8", RPA_ENCODING_ICASE_UTF8, CONST_CS | CONST_PERSISTENT);
@@ -215,99 +215,14 @@ PHP_FUNCTION(rpa_dbex_version)
     RETURN_STRING(rpa_dbex_version(), 1);
 }
 
-#if 0
-static php_cbinfo *php_cbinfo_create(php_rpa_dbex *pPhpDbex, const char *php_callback, zval *userdata)
-{
-       php_cbinfo *pCbInfo;
-
-       if ((pCbInfo = emalloc(sizeof(php_cbinfo))) == NULL)
-               return NULL;
-
-       pCbInfo->pPhpDbex = pPhpDbex;
-       pCbInfo->php_callback = estrdup(php_callback);
-       pCbInfo->userdata = userdata;
-       if (userdata) {
-               ZVAL_ADDREF(userdata);
-//             Z_SET_ISREF_P(userdata);
-       }
-       return pCbInfo;
-}
-
-
-static void php_cbinfo_destroy(php_cbinfo *pCbInfo)
-{
-       if (!pCbInfo)
-               return;
-       if (pCbInfo->php_callback)
-               efree(pCbInfo->php_callback);
-       if (pCbInfo->userdata) {
-               if (ZVAL_REFCOUNT(pCbInfo->userdata) == 1) {
-                       zval_ptr_dtor(&pCbInfo->userdata);
-               } else {
-                       ZVAL_DELREF(pCbInfo->userdata);
-               }
-       }
-       efree(pCbInfo);
-}
-
-
-static void php_do_rpa_dbex_strmatch(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ */
-{
-    /* parameters */
-    char             *subject;          /* String to match against */
-    char             *regex;            /* Regular expression */
-    int               subject_len;
-    int               regex_len;
-       int                               ret = 0;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &subject, 
-                                                         &subject_len,
-                                                         &regex,
-                                                         &regex_len) == FAILURE) {
-               RETURN_LONG(-1);
-    }
-/*
-       ret = emalloc(subject_len + regex_len + 100);
-       php_sprintf(ret, "Hello from rpalib, subject: %s, regex: %s", subject, regex);
-    RETURN_STRING(ret, 0);
-*/
-       ret = rpa_dbex_strmatch(subject, regex);
-       RETURN_LONG(ret);
-}
-
 
-/* {{{ proto int rpa_dbex_strmatch(string subject, string pattern)
-   Perform a regular expression match */
-PHP_FUNCTION(rpa_dbex_strmatch)
+static void php_rpa_stat_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-    php_do_rpa_dbex_strmatch(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
+    php_rpa_stat *phpstat = (php_rpa_stat*)rsrc->ptr;
 
-
-PHP_FUNCTION(rpa_dbex_greetme)
-{
-    zval *zname;
-
-    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zname) == FAILURE) {
-        RETURN_NULL();
-    }
-
-    convert_to_string(zname);
-
-    php_printf("Hello ");
-    PHPWRITE(Z_STRVAL_P(zname), Z_STRLEN_P(zname));
-    php_printf(" ");
-
-    RETURN_TRUE;
-}
-
-
-static void php_rpa_pattern_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
-    php_rpa_pattern *pPhpPattern = (php_rpa_pattern*)rsrc->ptr;
-
-    if (pPhpPattern) {
-        efree(pPhpPattern);
+    if (phpstat) {
+       rpa_stat_destroy(phpstat->stat);
+        efree(phpstat);
     }
 }
 
@@ -315,17 +230,8 @@ static void php_rpa_pattern_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 static void php_rpa_dbex_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
     php_rpa_dbex *pPhpDbex = (php_rpa_dbex*)rsrc->ptr;
-       rpa_callback_handle hCallback;
-       php_cbinfo *pCbInfo;
 
     if (pPhpDbex) {
-               if (pPhpDbex->hDbex) {
-                       for (hCallback = rpa_dbex_first_callback(pPhpDbex->hDbex); hCallback; hCallback = rpa_dbex_next_callback(pPhpDbex->hDbex, hCallback)) {
-                               pCbInfo = (php_cbinfo*)rpa_dbex_callback_userdata(pPhpDbex->hDbex, hCallback);
-                               php_cbinfo_destroy(pCbInfo);
-                       }
-               }
-
                rpa_dbex_destroy(pPhpDbex->hDbex);
 /*
                zval_dtor(pPhpDbex->zcallbacks);
@@ -352,7 +258,7 @@ PHP_FUNCTION(rpa_dbex_create)
     pPhpDbex = emalloc(sizeof(php_rpa_dbex));
     pPhpDbex->hDbex = rpa_dbex_create();
 
-/*     
+/*
        ALLOC_INIT_ZVAL(pPhpDbex->zcallbacks);
        Z_ADDREF_P(pPhpDbex->zcallbacks);
        array_init(pPhpDbex->zcallbacks);
@@ -414,6 +320,117 @@ PHP_FUNCTION(rpa_dbex_load)
 }
 
 
+PHP_FUNCTION(rpa_dbex_compile)
+{
+       zval *zres;
+    php_rpa_dbex *pPhpDbex;
+       char *patterns;
+       int patterns_len;
+       int ret;
+
+
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zres) == FAILURE) {
+               RETURN_LONG(-1);
+    }
+
+    ZEND_FETCH_RESOURCE(pPhpDbex, php_rpa_dbex*, &zres, -1, PHP_RPA_DBEX_RES_NAME, le_rpa_dbex);
+
+    ret = rpa_dbex_compile(pPhpDbex->hDbex);
+       RETURN_LONG(ret);
+}
+
+
+#if 0
+static php_cbinfo *php_cbinfo_create(php_rpa_dbex *pPhpDbex, const char *php_callback, zval *userdata)
+{
+       php_cbinfo *pCbInfo;
+
+       if ((pCbInfo = emalloc(sizeof(php_cbinfo))) == NULL)
+               return NULL;
+
+       pCbInfo->pPhpDbex = pPhpDbex;
+       pCbInfo->php_callback = estrdup(php_callback);
+       pCbInfo->userdata = userdata;
+       if (userdata) {
+               ZVAL_ADDREF(userdata);
+//             Z_SET_ISREF_P(userdata);
+       }
+       return pCbInfo;
+}
+
+
+static void php_cbinfo_destroy(php_cbinfo *pCbInfo)
+{
+       if (!pCbInfo)
+               return;
+       if (pCbInfo->php_callback)
+               efree(pCbInfo->php_callback);
+       if (pCbInfo->userdata) {
+               if (ZVAL_REFCOUNT(pCbInfo->userdata) == 1) {
+                       zval_ptr_dtor(&pCbInfo->userdata);
+               } else {
+                       ZVAL_DELREF(pCbInfo->userdata);
+               }
+       }
+       efree(pCbInfo);
+}
+
+
+static void php_do_rpa_dbex_strmatch(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ */
+{
+    /* parameters */
+    char             *subject;          /* String to match against */
+    char             *regex;            /* Regular expression */
+    int               subject_len;
+    int               regex_len;
+       int                               ret = 0;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &subject, 
+                                                         &subject_len,
+                                                         &regex,
+                                                         &regex_len) == FAILURE) {
+               RETURN_LONG(-1);
+    }
+/*
+       ret = emalloc(subject_len + regex_len + 100);
+       php_sprintf(ret, "Hello from rpalib, subject: %s, regex: %s", subject, regex);
+    RETURN_STRING(ret, 0);
+*/
+       ret = rpa_dbex_strmatch(subject, regex);
+       RETURN_LONG(ret);
+}
+
+
+/* {{{ proto int rpa_dbex_strmatch(string subject, string pattern)
+   Perform a regular expression match */
+PHP_FUNCTION(rpa_dbex_strmatch)
+{
+    php_do_rpa_dbex_strmatch(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+
+
+PHP_FUNCTION(rpa_dbex_greetme)
+{
+    zval *zname;
+
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zname) == FAILURE) {
+        RETURN_NULL();
+    }
+
+    convert_to_string(zname);
+
+    php_printf("Hello ");
+    PHPWRITE(Z_STRVAL_P(zname), Z_STRLEN_P(zname));
+    php_printf(" ");
+
+    RETURN_TRUE;
+}
+
+
+
+
+
+
 PHP_FUNCTION(rpa_dbex_load_string)
 {
        zval *zres;
index 83dc2ed..96451b2 100644 (file)
@@ -9,5 +9,4 @@ echo "\n"
 
 ?>
 --EXPECT--
-1.0.5-pre
-
+2.0
diff --git a/phpext/prpa/tests/008.phpt b/phpext/prpa/tests/008.phpt
new file mode 100644 (file)
index 0000000..4eddfa3
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+rpa_dbex_compile($hDbex, $pattern, $myname)
+--SKIPIF--
+<?php if (!extension_loaded("prpa")) echo "skip\n"; ?>
+--FILE--
+<?php 
+      $hDbex = rpa_dbex_create();
+      rpa_dbex_open($hDbex);
+      rpa_dbex_load($hDbex, "name ::= [a-z]+");
+      rpa_dbex_load($hDbex, "number ::= [0-9]+");
+      rpa_dbex_close($hDbex);
+      $ret = rpa_dbex_compile($hDbex);
+      echo("Compile Returned: ");
+      echo($ret);
+      echo("\n");
+      unset($hDbex);
+?>
+--EXPECT--
+Compile Returned: 0
+
index b867a99..a75eff2 100644 (file)
@@ -1,7 +1,10 @@
 RTK_LIB_INSTALL=/usr/lib
 RLIB_SRCDIR = $(SRCDIR)/rlib
+RLIB_SO_VERSION = 2.0
+RLIB_SO_NAME = librlib.so
+RLIB_LIB = librlib.a
+RLIB_SO = $(RLIB_SO_NAME).$(RLIB_SO_VERSION)
 RLIB_LIB = librlib.a
-RLIB_SO = librlib.so.1.0
 TARGET_RLIB_LIB = $(OUTDIR)/$(RLIB_LIB)
 TARGET_RLIB_SO = $(OUTDIR)/$(RLIB_SO)
 
@@ -38,7 +41,7 @@ $(TARGET_RLIB_LIB): $(RLIB_OBJECTS)
        $(AR) -cr $@ $^
 
 $(TARGET_RLIB_SO): $(RLIB_OBJECTS)
-       $(CC) $(LDFLAGS) -shared -Wl,-soname,librlib.so -o $@ $^
+       $(CC) $(LDFLAGS) -shared -Wl,-soname,$(RLIB_SO_NAME) -o $@ $^
 
 $(OUTDIR):
        @mkdir $(OUTDIR)
index 644b185..5869c19 100644 (file)
@@ -1,6 +1,12 @@
+RTK_LIB_INSTALL=/usr/lib
 RPA_SRCDIR = $(SRCDIR)/rpa
-RPA_LIB = $(OUTDIR)/librpa.a
-RPA_SO = $(OUTDIR)/librpa.so.1.0
+RPA_LIB = librpa.a
+RPA_SO_VERSION = 2.0
+RPA_SO_NAME = librpa.so
+RPA_SO = $(RPA_SO_NAME).$(RPA_SO_VERSION)
+TARGET_RPA_LIB = $(OUTDIR)/$(RPA_LIB)
+TARGET_RPA_SO = $(OUTDIR)/$(RPA_SO)
+
 
 CFLAGS += -I$(RVM_SRCDIR)/config -I$(SRCDIR)/rlib -I$(SRCDIR)/rvm
 
@@ -16,20 +22,20 @@ RPA_OBJECTS =       \
 
 
 ifeq ($(OS), linux)
-all: $(OUTDIR) $(RPA_LIB) $(RPA_SO)
+all: $(OUTDIR) $(TARGET_RPA_LIB) $(TARGET_RPA_SO)
 else
-all: $(OUTDIR) $(RPA_LIB)
+all: $(OUTDIR) $(TARGET_RPA_LIB)
 endif
 
 
 $(OUTDIR)/%.o: $(RPA_SRCDIR)/%.c
        $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(RPA_SRCDIR)/$*.c
 
-$(RPA_LIB): $(RPA_OBJECTS)
+$(TARGET_RPA_LIB): $(RPA_OBJECTS)
        $(AR) -cr $@ $^
 
-$(RPA_SO): $(RPA_OBJECTS)
-       $(CC) $(LDFLAGS) -shared -Wl,-soname,librpa.so -o $@ $^
+$(TARGET_RPA_SO): $(RPA_OBJECTS)
+       $(CC) $(LDFLAGS) -shared -Wl,-soname,$(RPA_SO_NAME) -o $@ $^
 
 $(OUTDIR):
        @mkdir $(OUTDIR)
@@ -39,9 +45,16 @@ distclean: clean
        @rm -rf $(OUTDIR)
 
 clean:
-       @rm -f $(RPA_LIB)
-       @rm -f $(RPA_SO)
+       @rm -f $(TARGET_RPA_LIB)
+       @rm -f $(TARGET_RPA_SO)
        @rm -f $(RPA_OBJECTS)
        @rm -f *~
        @rm -f $(SRCDIR)/*~
 
+install:
+       cp $(TARGET_RPA_SO) $(RTK_LIB_INSTALL)
+       cp $(TARGET_RPA_LIB) $(RTK_LIB_INSTALL)
+
+uninstall:
+       rm $(RTK_LIB_INSTALL)/$(RPA_LIB)
+       rm $(RTK_LIB_INSTALL)/$(RPA_SO)
index 131bf00..e164e99 100644 (file)
@@ -1,6 +1,11 @@
+RTK_LIB_INSTALL=/usr/lib
 RVM_SRCDIR = $(SRCDIR)/rvm
-RVM_LIB = $(OUTDIR)/librvm.a
-RVM_SO = $(OUTDIR)/librvm.so.1.0
+RVM_SO_VERSION = 2.0
+RVM_SO_NAME = librvm.so
+RVM_LIB = librvm.a
+RVM_SO = $(RVM_SO_NAME).$(RVM_SO_VERSION)
+TARGET_RVM_LIB = $(OUTDIR)/$(RVM_LIB)
+TARGET_RVM_SO = $(OUTDIR)/$(RVM_SO)
 
 CFLAGS += -I$(RVM_SRCDIR)/config -I$(SRCDIR)/rlib
 
@@ -41,20 +46,20 @@ RVM_OBJECTS +=      $(OUTDIR)/rvmoperatornot.o
 
 
 ifeq ($(OS), linux)
-all: $(OUTDIR) $(RVM_LIB) $(RVM_SO)
+all: $(OUTDIR) $(TARGET_RVM_LIB) $(TARGET_RVM_SO)
 else
-all: $(OUTDIR) $(RVM_LIB)
+all: $(OUTDIR) $(TARGET_RVM_LIB)
 endif
 
 
 $(OUTDIR)/%.o: $(RVM_SRCDIR)/%.c
        + $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(RVM_SRCDIR)/$*.c
 
-$(RVM_LIB): $(RVM_OBJECTS)
+$(TARGET_RVM_LIB): $(RVM_OBJECTS)
        $(AR) -cr $@ $^
 
-$(RVM_SO): $(RVM_OBJECTS)
-       $(CC) $(LDFLAGS) -shared -Wl,-soname,librvm.so -o $@ $^
+$(TARGET_RVM_SO): $(RVM_OBJECTS)
+       $(CC) $(LDFLAGS) -shared -Wl,-soname,$(RVM_SO_NAME) -o $@ $^
 
 $(OUTDIR):
        @mkdir $(OUTDIR)
@@ -64,9 +69,16 @@ distclean: clean
        @rm -rf $(OUTDIR)
 
 clean:
-       @rm -f $(RVM_LIB)
-       @rm -f $(RVM_SO)
+       @rm -f $(TARGET_RVM_LIB)
+       @rm -f $(TARGET_RVM_SO)
        @rm -f $(RVM_OBJECTS)
        @rm -f *~
        @rm -f $(SRCDIR)/*~
 
+install:
+       cp $(TARGET_RVM_SO) $(RTK_LIB_INSTALL)
+       cp $(TARGET_RVM_LIB) $(RTK_LIB_INSTALL)
+
+uninstall:
+       rm $(RTK_LIB_INSTALL)/$(RVM_LIB)
+       rm $(RTK_LIB_INSTALL)/$(RVM_SO)