File: Makefile

package info (click to toggle)
gmtsar 6.6%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,084 kB
  • sloc: ansic: 36,645; csh: 10,831; sh: 3,454; python: 3,127; xml: 1,764; makefile: 1,100; perl: 725
file content (111 lines) | stat: -rw-r--r-- 3,367 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
#       $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 GF3 NSR LT1 
#
DIRS		= gmtsar
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) -m 0644 preproc/ERS_preproc/scripts/virgin.PRM $(sharedir)
	$(INSTALL) -m 0644 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) -m 0644 gmtsar/filters/[bfgsxy]* $(sharedir)/filters
	$(INSTALL) -m 0644 gmtsar/csh/snaphu.conf.* $(sharedir)/snaphu/config
	$(INSTALL) -m 0644 gmtsar/*.grd $(sharedir)

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) -r bin share
	$(RM) gmtsar/csh/gmtsar_sharedir.csh \
	preproc/ENVI_preproc/scripts/ENVI_SLC_pre_process \
	preproc/ENVI_preproc/scripts/ENVI_pre_process \
	preproc/ERS_preproc/scripts/ERS_pre_process
	$(RM) -r config.log config.status config.mk configure autom4te.cache