Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

GNUmakefile 9.4 KB

You have to be logged in to leave a comment. Sign In
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
  1. #-------------------------------------------------------------------------------
  2. # $Id$
  3. #
  4. # Copyright (c) 1991-2012 by P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
  5. # See LICENSE.TXT file for copying and redistribution conditions.
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; version 2 or any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # Contact info: gmt.soest.hawaii.edu
  17. #-------------------------------------------------------------------------------
  18. # Guru makefile for GMT Version 5.*
  19. # GNU make compatible
  20. #
  21. # !!! THIS MAKEFILE IS FOR GMT DEVELOPERS ONLY !!!
  22. #
  23. # To be installed in top-level GMT directory and requires GNU make
  24. #
  25. # New GMT gurus should create a file guru/gmtguru.macros with any settings
  26. # that are intended to overrule the DEFAULT SETTINGS specified below.
  27. #
  28. # To ensure the very latest code, start with "make update".
  29. # To get the latest and make all, do "make install".
  30. # To wipe all, do "make spotless".
  31. # The gentler "make clean" will NOT remove code that is generated
  32. # by GMT scripts, like gmt_math.h and grdmath.c.
  33. #
  34. # To run all the test dir scripts: make tests
  35. # To test the examples: make extests
  36. # To test all documentation figs: make doctests
  37. # To run all tests: make alltests
  38. #
  39. # To generate new archive: make archive or make "version" e.g., make GMT4
  40. #
  41. # Subtasks:
  42. #
  43. # To compile/install GMT: make all and/or make install
  44. # To create examples, animations: make examples animations
  45. # To generate man pages: make man
  46. # To generate documentation: make docs
  47. # To generate tarfiles: make tar_all
  48. #
  49. # This must be done separately:
  50. # To tar all coastlines make tar_gshhs
  51. #
  52. # Author: Paul Wessel, Remko Scharroo
  53. #
  54. # Date: 1-JAN-2011
  55. #
  56. #-------------------------------------------------------------------------------
  57. # DEFAULT SETTINGS
  58. #-------------------------------------------------------------------------------
  59. # This section contains macros that you may want to override with your own
  60. # settings to reflect your particular computer environment. You can best do this
  61. # by creating coying guru/gmtguru.macros.orig to guru/gmtguru.macros. Then edit
  62. # the latter.
  63. GMTGURU = guru/gmtguru.macros
  64. include guru/gmtguru.macros.orig # Default guru settings
  65. sinclude $(GMTGURU) # Guru-specific settings determined by GURU [Default is guru/gmtguru.macros]
  66. #-------------------------------------------------------------------------------
  67. # !! STOP EDITING HERE, THE REST IS FIXED !!
  68. #-------------------------------------------------------------------------------
  69. .PHONY: FILES man manpages webman webdoc pdfman docs \
  70. latest-config help update create prep prepare archive \
  71. tar_all tar_gshhs install suppl alltests \
  72. doctests extests tests ex examples animations svnclean
  73. #-------------------------------------------------------------------------------
  74. # FILES stands for all those files (makefiles, etc) that are not part of the SVN
  75. # distribution but rather are created from more primitive forms. Since those
  76. # primitive forms may undergo modifications we must check for changes before
  77. # compiling, making man pages, etc. What follows is the rules for making these
  78. # FILES from the SVN-distributed master files:
  79. #-------------------------------------------------------------------------------
  80. FILES = src/config.mk share/conf/gmt.conf share/conf/gmt_SI.conf share/conf/gmt_US.conf \
  81. src/gmt_version.h src/gmt_notposix.h src/isogmt doc/GMT_version.tex
  82. help::
  83. @grep '^#!' GNUmakefile | cut -c3-
  84. #!----------------- MAKE HELP FOR GMT GURUS -----------------
  85. #!
  86. #!make <target>, where <target> can be:
  87. #!
  88. #!update : Get the latest source via svn
  89. #!alltests : Run all tests and compare to originals
  90. #!manpages : Create manpages from text files
  91. #!pdfman : Create PDF version of manpages
  92. #!pdfdocs : Create PDF documentation
  93. #!svnclean : Cleanup the package to a nearly clean SVN checkout
  94. #!prepare : Create all files needed for a release
  95. #!archive : Build the release archives
  96. #!
  97. update:
  98. svn -q update
  99. create:
  100. # We make the GMT$(GMT_VERSION) link from scratch each time
  101. cd ..; rm -f GMT$(GMT_VERSION); $(LN_S) $(notdir $(PWD)) GMT$(GMT_VERSION)
  102. GMT$(GMT_VERSION): archive
  103. prep prepare: manpages webman pdfman webdoc pdfdocs
  104. archive: prepare create tar_all
  105. manpages: $(FILES)
  106. cd src ; $(MAKE) $@
  107. $(MAKE) TARGET=$@ $(SUPPL)
  108. all: $(FILES)
  109. cd src ; $(MAKE) $@
  110. #-------------------------------------------------------------------------------
  111. # Tests
  112. #-------------------------------------------------------------------------------
  113. alltests: extests doctests tests
  114. extests:
  115. @cd doc/examples ; $(MAKE) $@
  116. doctests:
  117. @cd doc/scripts ; $(MAKE) $@
  118. tests:
  119. @cd test ; $(MAKE) $@
  120. cleantests:
  121. @cd doc/examples ; $(MAKE) clean
  122. @cd doc/scripts ; $(MAKE) clean
  123. @cd test ; $(MAKE) clean
  124. #-------------------------------------------------------------------------------
  125. # Cleaning
  126. #-------------------------------------------------------------------------------
  127. svnclean:
  128. $(SHELL) guru/svnclean.sh
  129. clean spotless::
  130. cd doc ; $(MAKE) $@
  131. cd doc/examples ; $(MAKE) $@
  132. cd doc/scripts ; $(MAKE) $@
  133. cd test ; $(MAKE) $@
  134. #-------------------------------------------------------------------------------
  135. # For compatibility with previous versions
  136. #-------------------------------------------------------------------------------
  137. ex: examples
  138. webdoc:
  139. cd doc ; $(MAKE) prep
  140. #-------------------------------------------------------------------------------
  141. # To check there are no files with DOS line-endings
  142. #-------------------------------------------------------------------------------
  143. DOS:
  144. $(SHELL) guru/DOS_finder.sh
  145. gmtmacros examples animations FILES: $(FILES)
  146. fresh:
  147. rm -f $(FILES)
  148. config: src/config.mk
  149. guru/gmtguru.macros:
  150. touch $@
  151. # When doing spotless or TARGET=spotless, make sure a dummy src/config.mk exists
  152. ifeq "$(findstring spotless,$(MAKECMDGOALS)$(TARGET))" "spotless"
  153. $(FILES):
  154. touch $@
  155. else
  156. $(FILES): guru/gmtguru.macros configure config.sub config.guess src/config.mk.in share/conf/gmt.conf.in \
  157. src/gmt_version.h.in src/gmt_notposix.h.in src/isogmt.in doc/GMT_version.tex.in
  158. rm -f config.cache config.log config.status
  159. ./configure $(GMT_SHARED_LIBS) $(GMT_US) $(GMT_TRIANGLE) $(GMT_DEBUG) $(GMT_DIST) $(GMT_EXDIST) \
  160. $(GMT_NETCDF) $(GMT_SITE) $(GMT_MATLAB) $(GMT_OCTAVE) $(GMT_64) $(GMT_UNIVERSAL) $(GMT_OTHER)
  161. touch $(FILES)
  162. endif
  163. configure: configure.ac
  164. $(AUTOCONF)
  165. latest-config:
  166. curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -s -R -o config.sub
  167. curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -s -R -o config.guess
  168. install-doc:: webman pdfman docs
  169. docs pdfdocs: $(FILES)
  170. cd doc ; $(MAKE) pdf
  171. pdfman: $(FILES)
  172. cd doc ; $(MAKE) man
  173. webman: $(FILES)
  174. cd doc ; $(MAKE) html
  175. GSHHS_DIR = gmt
  176. get_coast: get_gshhs
  177. get_gshhs:
  178. curl "ftp://$(FTPSITE)/$(GSHHS_DIR)/gshhs-$(GSHHS_VERSION).tar.bz2" -R -O
  179. bzip2 -dc gshhs-$(GSHHS_VERSION).tar.bz2 | tar -xvf -
  180. rm -f gshhs-$(GSHHS_VERSION).tar.bz2
  181. # For CVS usage
  182. get_gshhs_cvs:
  183. $(MAKE) GSHHS_DIR=pwessel/gshhs get_gshhs
  184. #-------------------------------------------------------------------------------
  185. # TARRING OFF THE NEW VERSION
  186. #-------------------------------------------------------------------------------
  187. ftpdir:
  188. mkdir -p ftp
  189. tar_all: ftpdir
  190. echo "make gmt-$(GMT_VERSION).tar.bz2"
  191. grep -vh '#' guru/GMT_progs_files_{ascii,bin}.lis | sed -e 's:^:GMT$(GMT_VERSION)/:' > tmp.lis
  192. grep -vh '#' guru/GMT_share_files_{ascii,bin}.lis | sed -e 's:^:GMT$(GMT_VERSION)/:' >> tmp.lis
  193. sed -e 's:^:GMT$(GMT_VERSION)/:' guru/GMT_www.lis >> tmp.lis
  194. sed -e 's:^:GMT$(GMT_VERSION)/:' guru/GMT_{animations,examples}.lis >> tmp.lis
  195. sed -e 's:^:GMT$(GMT_VERSION)/:' guru/GMT_tutorial.lis >> tmp.lis
  196. sed -e 's:^:GMT$(GMT_VERSION)/:' guru/GMT_suppl.lis >> tmp.lis
  197. COPYFILE_DISABLE=true tar -cjf ftp/gmt-$(GMT_VERSION).tar.bz2 -C .. -T tmp.lis GMT$(GMT_VERSION)/LICENSE.TXT
  198. grep -vh '#' guru/GMT_triangle.lis | sed -e 's:^:GMT$(GMT_VERSION)/:' > tmp.lis
  199. COPYFILE_DISABLE=true tar -cjf ftp/gmt-$(GMT_VERSION)-non-gpl.tar.bz2 -C .. -T tmp.lis GMT$(GMT_VERSION)/LICENSE.TXT
  200. rm -f tmp.lis
  201. # The tar_win target is for GMT Developers building GMT on a Windows platform without configure
  202. # and then building GMT installers with Inno Setup
  203. tar_win: ftpdir
  204. echo "make WINGMT$(GMT_VERSION)_win.tar.bz2"
  205. ls src/gmt_version.h share/conf/gmt.conf share/conf/gmtdefaults_?? \
  206. guru/*.iss guru/*.txt guru/*.bat | sed -e 's:^:GMT$(GMT_VERSION)/:' > tmp.lis
  207. COPYFILE_DISABLE=true tar -cjf ftp/WINGMT$(GMT_VERSION)_win.tar.bz2 -C .. -T tmp.lis GMT$(GMT_VERSION)/LICENSE.TXT
  208. rm -f tmp.lis
  209. # Note: coastline files now stored relative to share, instead of GMT/share
  210. tar_gshhs: ftpdir
  211. echo "make gshhs-$(GSHHS_VERSION).tar.bz2"
  212. COPYFILE_DISABLE=true tar -cjf ftp/gshhs-$(GSHHS_VERSION).tar.bz2 LICENSE.TXT \
  213. share/coast/binned_*.cdf -C src/coast/GSHHS+WDBII README.TXT
  214. include Makefile
  215. #-------------------------------------------------------------------------------
  216. # Final cleanup (needs to run last)
  217. #-------------------------------------------------------------------------------
  218. spotless::
  219. rm -rf $(FILES) configure autom4te.cache
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...