File: makefile

package info (click to toggle)
liblip 1.2-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,784 kB
  • ctags: 828
  • sloc: sh: 7,454; cpp: 4,026; ansic: 1,117; makefile: 106
file content (108 lines) | stat: -rw-r--r-- 3,799 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#############################################################################
#									    #
#	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.
#
# examplelint:		shows how to compile and link library when install
#			in the library search path used to load libraries
#
# examplelint2:		shows how to compile and link by implicitly telling
#			the linker where to look for the library
#
# exampleling procedural: shows how to compile and link procedural C conde.
#
############################################################################

# compiler
CC = g++

# Some options probably not needed: -g (which enables the debugger options).
FLAGS = -g -O -Wno-deprecated

# Object file fo the example
OBJ = examplelint.o
OBJ2 = examplelint2.o
OBJ3 = examplelintprocedural.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.

#LIB_PATH = $(HOME)/lip/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.

#INCLUDE_PATH = $(HOME)/lip/include/
INCLUDE_PATH = /usr/local/include/

all:	static_example2 static_example3 shared_example static_example 

#################################################################################
# linking examplelint. If you have succesfully installed lip library and have
# LIB_PATH to /etc/ld.soconf Or you have added LIB_PATH TO LD_LIBRARY_PATH
# then compiling is as eassy as this.  

# shared_example target links examplelint.o to the lip shared library. To make
# up shared_example executable.

shared_example:	$(OBJ)
		$(CC) -o shared_example $(OBJ) $(FLAGS) -llip -lm

# static_example target links examplelint.o to the lip static library. To make
# up static_example executable.

static_example: $(OBJ)
		$(CC) -o static_example -non_shared  $(OBJ) $(FLAGS)  -llip -lm


#################################################################################
# linking examplelint2. 

# static_example target links examplelint2.o to the lip static library. To make
# up static_example executable.

static_example2:$(OBJ2)
		$(CC) -o static_example2  $(OBJ2) $(FLAGS) $(LIB_PATH)liblip.a -lm


#################################################################################
# linking examplelintprocedural

# static_example target links examplelintprocedural.o to the lip static library. To make
# up static_example executable.

static_example3:$(OBJ3)
		$(CC) -o static_example3 -static $(OBJ3) $(FLAGS) $(LIB_PATH)liblip.a -lm


#################################################################################
# compiling examples to objectfiles.

examplelint.o:			examplelint.cpp
				$(CC) -c examplelint.cpp $(FLAGS) -I$(INCLUDE_PATH)

examplelint2.o:			examplelint2.cpp
				$(CC) -c examplelint2.cpp $(FLAGS) -I$(INCLUDE_PATH)

# compiling proccedual example using C compiler
#
examplelintprocedural.o:	examplelintprocedural.cpp
				gcc -c examplelintprocedural.cpp $(FLAGS) -I$(INCLUDE_PATH)

.PHONY: clean all

clean:
		rm -f $(OBJ) shared_example static_example
		rm -f $(OBJ2) static_example2
		rm -f $(OBJ3) static_example3