File: Makefile

package info (click to toggle)
gmt 3.3.3-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,288 kB
  • ctags: 2,962
  • sloc: ansic: 50,470; sh: 1,760; makefile: 284; asm: 38
file content (180 lines) | stat: -rw-r--r-- 4,616 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
#	@(#)Makefile.GMT	3.12  11/30/99
#
#	Copyright (c) 1991-1999 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: www.soest.hawaii.edu/gmt
#-------------------------------------------------------------------------------
#		Makefile for GMT Version 3.3.3
#		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"
#
#
#	Authors:	Paul Wessel, SOEST, U. of Hawaii
#			Walter H. F. Smith, Lab for Satellite Altimetry, NOAA
#
#	Date:		19-NOV-1999
#-------------------------------------------------------------------------------
#	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 imgsrc meca mex mgg misc segyprogs spotter x2sys xgrid
SUPPL_M	=	cps dbase imgsrc meca mgg misc segyprogs spotter x2sys

all:		gmt suppl

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

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

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

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

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

install-data:
		if [ ! $(rootdir)/share = $(datadir) ]; then \
			mkdir -p $(datadir); \
			cp -r share $(dir $(datadir)); \
		else \
			echo "Install share directory the same as distribution share directory - nothing copied"; \
		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 [ ! $(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; \
			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


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 $(dir $(wwwdir)); \
		else \
			echo "Install www directory the same as distribution www directory - nothing copied"; \
		fi

run-examples:
		if [ -d examples ]; then \
			cd examples; \
			$(CSH) do_examples.$(CSH) $(bindir); \
			cd ..; \
		else \
			echo "examples directory not installed"; \
		fi

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

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

distclean:	spotless