liblip (2.0.0-1.1) examples/makefile

Summary

 examples/makefile |  105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)

    
download this patch

Patch contents

--- liblip-2.0.0.orig/examples/makefile
+++ liblip-2.0.0/examples/makefile
@@ -0,0 +1,105 @@
+#############################################################################
+#									    #
+#	CLASS LIBRARY LIP FOR MULTIVARIATE SCATTERED DATA INTERPOLATION     #
+#									    #
+#	This makefile gives targets that show how to compile and link       #
+#	user code to the Lip shared library and statatic library.           #
+#									    #
+#############################################################################
+#
+# This make file show how to compile and link examples included with this 
+# distribution of LIP assuming different installations of the library. this
+# include the following examples for both static and shared linking.
+#
+# liblipex:		shows how to compile and link library when install
+#			in the library search path used to load libraries
+#
+# exampleprocedural:		shows how to compile and link by implicitly telling
+#			 the linker where to look for the library
+#			 shows how to compile and link procedural C conde.
+#
+############################################################################
+
+# location where the library is installed
+MYPATH= /home/user1/liblip.2.0
+
+# compiler
+CC = g++
+GCC = gcc
+
+# Some options probably not needed: -g (which enables the debugger options).
+FLAGS = -g -O -Wno-deprecated
+
+# Object file fo the example
+OBJ1 = liblipex.o
+OBJ2 = exampleprocedural.o
+
+# LIB_PATH used to store the path in which the library files were installed.
+# The commented out assignment is for when the library is installed into the
+# users home directory. NOTE: $(HOME) referes to env varialble HOME.
+
+#directory where the liblip.a is installed
+LIB_PATH = $(MYPATH)/lib/
+#LIB_PATH = /usr/local/lib/
+
+# INCLUDE_PATH used to store the path in which the *.h files have been
+# placed. The commented out assignment is for when the *.h files are placed
+# in the users home directory.
+
+#directory
+INCLUDE_PATH = $(MYPATH)/include
+#INCLUDE_PATH = /usr/local/include/
+
+#include directories holdign the header files needed for liblip
+#INCLUDE= -I$(INCLUDE_PATH)/tnt  -I$(INCLUDE_PATH)/glpk -I$(INCLUDE_PATH)
+INCLUDE= -I$(INCLUDE_PATH)/tnt  -I$(INCLUDE_PATH)
+
+#location of glpklib.a this is a static library and should be compiled from source.
+GLPK_STATIC_PATH=$(HOME)/glpklib/lib/
+
+all:	static_example2  static_example shared_example 
+
+#################################################################################
+# linking examplelint. If you have succesfully installed lip library and have
+# LIB_PATH to /etc/ld.so.conf Or you have added LIB_PATH TO LD_LIBRARY_PATH
+# then compiling is as eassy as this.  
+
+# shared_example target links liblipex.o to the liblip shared library. To make
+# up shared_example executable.
+
+shared_example:	$(OBJ1)
+		$(CC) -o shared_example $(OBJ1) $(FLAGS) -L$(LIB_PATH) -llip -L$(GLPK_STATIC_PATH) -lglpk -lm
+
+# static_example target links liblipex.o to the liblip static library. To make
+# up static_example executable.
+
+static_example: $(OBJ1)
+		$(CC) -o static_example -non_shared  $(OBJ1) $(FLAGS) -L$(LIB_PATH) -llip -L$(GLPK_STATIC_PATH) -lglpk -lm
+
+
+#################################################################################
+# linking examplelintprocedural
+
+# static_example target links exampleprocedural.o to the lip static library. To make
+# up static_example executable.
+
+static_example2:$(OBJ2)
+		$(CC) -o static_example2 -static $(OBJ2) $(FLAGS) $(LIB_PATH)liblip.a  $(GLPK_STATIC_PATH)libglpk.a -lm
+
+
+#################################################################################
+# compiling examples to objectfiles.
+
+liblipex.o:			liblipex.cpp
+				$(CC) -c liblipex.cpp $(FLAGS) $(INCLUDE)
+
+# compiling proccedual example using C compiler
+#
+exampleprocedural.o:	exampleprocedural.c
+				$(GCC) -c exampleprocedural.c $(FLAGS) $(INCLUDE)
+
+.PHONY: clean all
+
+clean:
+		rm -f $(OBJ1) shared_example static_example
+		rm -f $(OBJ2) static_example2