forked from AlexeyPechnikov/pygmtsar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
106 lines (91 loc) · 3.04 KB
/
Makefile
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
# $Id: Makefile 236 2015-08-24 07:09:14Z pwessel $
#
# makefile for top GMTSAR directory
sinclude config.mk
# Currently, S1A must happen before the CSK, TSZ, and RS2 builds due to dependencies via links
# We will fix this so one can make anyting in any order
#
PREPROCESSORS = ALOS ERS S1A CSK TSX RS2 ENVI
#
DIRS = gmtsar snaphu/src
ORBITS_URL = http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
ORBITS = ORBITS.tar
all: main preprocess
help::
@grep '^#!' Makefile | cut -c3-
#!----------------- MAKE HELP FOR GMTSAR-----------------
#!
#!make <target>, where <target> can be:
#!
#!all : Compile everything
#!install : Compile & install everything
#!clean : Clean up and remove objects and library files
#!clean : Clean and remove configured files as well
#! ------------- Additional Targets -------------
#!preprocess : Only compile the preprocesors
#!main : Only compile the main programs
#!install-preprocess : Only compile & install the preprocesors
#!install-main : Only compile & install the main programs
#!install-orbits : Obtain ORBITS.tar, prompt for directory, and install files
#!
preprocess:
for d in $(PREPROCESSORS); do \
(cd preproc/$${d}_preproc; $(MAKE) all); \
done
main:
for d in $(DIRS); do \
(cd $$d; $(MAKE) all); \
done
install: install-main install-preproc
install-preproc:
for d in $(PREPROCESSORS); do \
(cd preproc/$${d}_preproc; $(MAKE) install); \
done
$(INSTALL) preproc/ERS_preproc/scripts/virgin.PRM $(sharedir)
$(INSTALL) preproc/ENVI_preproc/scripts/virgin_envisat.PRM $(sharedir)
install-main:
for d in $(DIRS); do \
(cd $$d; $(MAKE) install); \
done
$(INSTALL) -d $(sharedir)
$(INSTALL) -d $(sharedir)/filters
$(INSTALL) -d $(sharedir)/snaphu/config
$(INSTALL) gmtsar/filters/[bfgsxy]* $(sharedir)/filters
$(INSTALL) gmtsar/csh/snaphu.conf.* $(sharedir)/snaphu/config
install-orbits:
wget $(ORBITS_URL) 2>/dev/null || curl -O $(ORBITS_URL)
@if [ -f $(ORBITS) ]; then \
read -p "==> Enter directory where the ORBITS subdirectory should be installed: " ORB_DIR ; \
mkdir -p $$ORB_DIR/ORBITS ; \
echo "Extracting orbits files into $$ORB_DIR/ORBITS"; \
tar xf $(ORBITS) -C$$ORB_DIR/ORBITS ; \
echo "Run configure --with-orbits-dir=$$ORB_DIR/ORBITS"; \
else \
echo "Unable to obtain $(ORBITS_URL) - Perhaps you have neither curl nor wget installed?"; \
fi
uninstall: uninstall-main uninstall-preproc
uninstall-main:
for d in $(DIRS); do \
(cd $$d; $(MAKE) uninstall); \
done
rm -rf $(sharedir)
uninstall-preproc:
for d in $(PREPROCESSORS); do \
(cd preproc/$${d}_preproc; $(MAKE) uninstall); \
done
clean:
for d in $(DIRS); do \
(cd $$d; $(MAKE) clean); \
done
for d in $(PREPROCESSORS); do \
(cd preproc/$${d}_preproc; $(MAKE) clean); \
done
spotless:
for d in $(DIRS); do \
(cd $$d; $(MAKE) spotless); \
done
for d in $(PREPROCESSORS); do \
(cd preproc/$${d}_preproc; $(MAKE) spotless); \
done
rm -rf $(sharedir) bin share
rm -rf config.log config.status config.mk configure autom4te.cache