File: Makefile

package info (click to toggle)
gmt 3.4-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,528 kB
  • ctags: 3,140
  • sloc: ansic: 54,081; sh: 2,552; makefile: 404; asm: 38
file content (263 lines) | stat: -rw-r--r-- 7,162 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#	$Id: Makefile,v 1.6 2001/04/18 09:19:15 pwessel Exp $
#
#	Copyright (c) 1991-2001 by P. Wessel and W. H. F. Smith
#	See COPYING file for copying and redistribution conditions.
#
#	This program is free software; you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation; version 2 of the License.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	Contact info: gmt.soest.hawaii.edu
#-------------------------------------------------------------------------------
#		Makefile for GMT Version 3.4
#		GNU, Sys V, and BSD Compatible
#
#	Follow the instructions in this makefile to customize your setup.
#	Commands marked *** are optional
#	1. run configure in the main GMT directory.
#	2. make all
#	3. make suppl   ***
#	4. make run-examples ***
#
#	Then, if you have the necessary directory permissions:
#
#	5. make install-all
#
#	or any combination of
#
#	make install
#	make install-suppl
#	make install-data
#	make install-man
#	make install-www
#	
#	When done, clean out directory with "make clean".  To clean
#	the entire build distribution, do "make cleandist"
#
#	To uninstall the installed files, try
#
#	make uninstall
#	make uninstall-suppl
#	make uninstall-data
#	make uninstall-man
#	make uninstall-www
#
#	Authors:	Paul Wessel, SOEST, U. of Hawaii
#			Walter H. F. Smith, Lab for Satellite Altimetry, NOAA
#
#	Date:		18-APR-2001
#-------------------------------------------------------------------------------
#	Get Default Macros
#-------------------------------------------------------------------------------
#

include src/makegmt.macros	# GMT-specific settings determined by user & install_gmt

#-------------------------------------------------------------------------------
#	!! STOP EDITING HERE, THE REST IS FIXED !!
#-------------------------------------------------------------------------------

SUPPL	=	cps dbase gshhs imgsrc meca mex mgg misc segyprogs spotter x2sys x_system xgrid
SUPPL_M	=	cps dbase imgsrc meca mgg misc segyprogs spotter x2sys x_system

all:		gmt suppl

install-all:	install install-suppl install-data install-man install-www
uninstall-all:	uninstall uninstall-suppl uninstall-data uninstall-man uninstall-www

gmt:		gmtmacros
		cd src; \
		$(MAKE) all; \
		cd ..

install:	gmt
		cd src; \
		$(MAKE) install; \
		cd ..

uninstall:	gmt
		cd src; \
		$(MAKE) uninstall; \
		cd ..

suppl:		gmtmacros mex_config xgrid_config
		for d in $(SUPPL); do \
			if [ -d src/$$d ] && [ ! -f src/$$d/.skip ]; then \
				cd src/$$d; \
				$(MAKE) all; \
				cd ../..; \
			fi; \
		done

install-suppl:	suppl
		for d in $(SUPPL); do \
			if [ -d src/$$d ] && [ ! -f src/$$d/.skip ]; then \
				cd src/$$d; \
				$(MAKE) install; \
				cd ../..; \
			fi; \
		done

mex_config:	
		if [ ! -f src/mex/makefile ]; then \
			cd src/mex; \
			\rm -f config.{cache,log,status}; \
			./configure; \
		fi
		
xgrid_config:	
		if [ ! -f src/xgrid/makefile ]; then \
			cd src/xgrid; \
			\rm -f config.{cache,log,status}; \
			./configure; \
		fi

gmtmacros:	
		if [ `cat src/makegmt.macros | wc -c` = 0 ]; then \
			echo "src/makegmt.macros is empty - you must rerun configure in the main GMT directory"; \
			exit; \
		fi

uninstall-suppl:
		for d in $(SUPPL); do \
			if [ -d src/$$d ] && [ ! -f src/$$d/.skip ]; then \
				cd src/$$d; \
				$(MAKE) uninstall; \
				cd ../..; \
			fi; \
		done

install-data:
		if [ ! $(rootdir)/share = $(datadir) ]; then \
			mkdir -p $(datadir); \
			cp -r share/* $(datadir); \
			cp -f share/.gmtdefaults_* $(datadir); \
		else \
			echo "Install share directory the same as distribution share directory - nothing copied"; \
		fi

uninstall-data:
		if [ ! $(rootdir)/share = $(datadir) ]; then \
			\rm -r -f $(datadir); \
		else \
			echo "Install share directory the same as distribution share directory - nothing removed"; \
		fi


install-man:
		\rm -f manjob.sh
		for d in $(SUPPL_M); do \
			if [ -d src/$$d ] ; then \
				cd src/$$d; \
				for f in *.man; do \
					\cp $$f $(rootdir)/man/manl; \
					echo "\\mv $$f $$f" | sed -e 's/.man$$/.l/g' >> $(rootdir)/manjob.sh; \
				done; \
				cd ../..; \
			fi; \
		done
		if [ -f manjob.sh ]; then \
			cd man/manl; \
			$(SHELL) $(rootdir)/manjob.sh; \
			\rm -f $(rootdir)/manjob.sh; \
		fi
		if [ -f manuninstall.sh ]; then \
			\rm -f $(rootdir)/manuninstall.sh; \
		fi
		if [ ! $(rootdir)/man/manl = $(mandir)/man$(mansection) ]; then \
			mkdir -p $(mandir)/man$(mansection); \
			\cp man/manl/*.l $(mandir)/man$(mansection); \
			cd $(mandir)/man$(mansection); \
			for f in *.l; do \
				echo "\\mv $$f $$f" | sed -e 's/.l$$/.$(mansection)/g' >> $(rootdir)/manjob.sh; \
				echo "\\rm -f $$f"  | sed -e 's/.l$$/.$(mansection)/g' >> $(rootdir)/manuninstall.sh; \
			done; \
			$(SHELL) $(rootdir)/manjob.sh; \
			\rm -f $(rootdir)/manjob.sh; \
			cd $(rootdir); \
		else \
			echo "Install man directory the same as distribution man directory - nothing copied"; \
		fi


uninstall-man:
		if [ ! $(rootdir)/man/manl = $(mandir)/man$(mansection) ]; then \
			cd $(mandir)/man$(mansection); \
			$(SHELL) $(rootdir)/manuninstall.sh; \
			\rm -f $(rootdir)/manuninstall.sh; \
			cd $(rootdir); \
		else \
			echo "Install man directory the same as distribution man directory - nothing deleted"; \
		fi


install-www:
		for d in $(SUPPL_M); do \
			if [ -d src/$$d ] ; then \
				\cp src/$$d/*.html $(rootdir)/www/gmt/doc/html; \
			fi; \
		done
		if [ ! $(rootdir)/www = $(wwwdir) ]; then \
			mkdir -p $(wwwdir); \
			\cp -r www/gmt $(wwwdir); \
		else \
			echo "Install www directory the same as distribution www directory - nothing copied"; \
		fi

uninstall-www:
		if [ ! $(rootdir)/www = $(wwwdir) ]; then \
			\rm -r -f $(wwwdir)/gmt; \
		else \
			echo "Install www directory the same as distribution www directory - nothing deleted"; \
		fi

install-wrapper:
		if [ ! $(rootdir)/bin = $(wrapbindir) ]; then \
			$(INSTALL) src/GMT $(wrapbindir); \
		else \
			echo "Install wrapper bin directory the same as distribution bin directory - nothing installed"; \
		fi
		if [ ! $(rootdir)/man = $(wrapmandir) ]; then \
			\cp man/manl/GMT.l $(wrapmandir)/man$(mansection); \
		else \
			echo "Install wrapper man directory the same as distribution man directory - nothing installed"; \
		fi
		
run-examples:
		if [ -d examples ]; then \
			cd examples; \
			$(CSH) do_examples.$(CSH) $(bindir) $(libdir); \
			cd ..; \
		else \
			echo "examples directory not installed"; \
		fi

clean:		clean-suppl
		cd src; $(MAKE) clean

clean-suppl:
		for d in $(SUPPL); do \
			if [ -d src/$$d ] && [ ! -f src/$$d/.skip ]; then \
				cd src/$$d; \
				$(MAKE) clean; \
				cd ../..; \
			fi; \
		done

spotless:	clean
		rm -f config.cache config.status config.log
		cd src; $(MAKE) spotless; \
		for d in $(SUPPL); do \
			if [ -d src/$$d ] && [ ! -f src/$$d/.skip ]; then \
				cd src/$$d; \
				$(MAKE) spotless; \
				cd ../..; \
			fi; \
		done

distclean:	spotless