forked from NOAA-PMEL/Ferret
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
123 lines (104 loc) · 2.97 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# Makefile for building ferret
#
#
# Site-specific defines, including the definition of BUILDTYPE
#
include site_specific.mk
ifeq ("$(BUILDTYPE)", "intel-mac")
COPY_DYLIBS = - ./copy_dylibs.sh
else
COPY_DYLIBS =
endif
.PHONY : all
all : optimized
.PHONY : optimized
optimized :
mkdir -p lib
$(COPY_DYLIBS)
$(MAKE) xgks/Makefile
$(MAKE) -C xgks
$(MAKE) -C fer
cp -f fer/ferret_c bin/ferret
$(MAKE) "FER_DIR = $(DIR_PREFIX)" -C external_functions all
rm -f bin/ferret
$(MAKE) -C gksm2ps
$(MAKE) -C bin/build_fonts/unix
.PHONY : debug
debug :
mkdir -p lib
$(COPY_DYLIBS)
$(MAKE) xgks/Makefile
$(MAKE) -C xgks
$(MAKE) -C fer debug
cp -f fer/ferret_c bin/ferret
$(MAKE) "FER_DIR = $(DIR_PREFIX)" -C external_functions debug
rm -f bin/ferret
$(MAKE) -C gksm2ps
$(MAKE) -C bin/build_fonts/unix
# Debug but also print all memory allocations, reallocations, and frees to
# file "memorydebug.txt". Initialize allocated memory with non-zero values.
# Expect this to be a lot slower due to all the (intentionally inefficient
# but safe) file operations.
.PHONY : memorydebug
memorydebug :
mkdir -p lib
$(COPY_DYLIBS)
$(MAKE) xgks/Makefile
$(MAKE) -C xgks
$(MAKE) -C fer memorydebug
cp -f fer/ferret_c bin/ferret
$(MAKE) "FER_DIR = $(DIR_PREFIX)" -C external_functions debug
rm -f bin/ferret
$(MAKE) -C gksm2ps
$(MAKE) -C bin/build_fonts/unix
## Configure xgks to create the Makefile if it does not exist
xgks/Makefile :
( cd xgks; export BUILDTYPE=$(BUILDTYPE); ./configure )
## Clean all the directories
.PHONY : clean
clean :
rm -f fer_executables.tar.gz
rm -f fer_environment.tar.gz
$(MAKE) -C bench clean
$(MAKE) -C bin/build_fonts/unix clean
$(MAKE) -C gksm2ps clean
$(MAKE) -C external_functions clean
$(MAKE) -C fer clean
rm -f -R lib dylibs
$(MAKE) xgksclean
## Thoroughly clean the xgks directory
.PHONY : xgksclean
xgksclean :
$(MAKE) -C xgks clean
$(MAKE) -C xgks distclean
find xgks -name Makefile -exec rm -f {} \;
rm -f xgks/port/master.mk
rm -f xgks/port/udposix.h
## Install Ferret binaries, scripts, and other files into $(INSTALL_FER_DIR)
.PHONY : install
install : install_env install_exes
## Create the fer_environment.tar.gz files and then extract it into $(INSTALL_FER_DIR)
.PHONY : install_env
install_env :
rm -f fer_environment.tar.gz
bin/make_environment_tar . . -y
mkdir -p $(INSTALL_FER_DIR)
mv -f fer_environment.tar.gz $(INSTALL_FER_DIR)
( cd $(INSTALL_FER_DIR) ; tar xzf fer_environment.tar.gz )
## Create the fer_executables.tar.gz files and then extract it into $(INSTALL_FER_DIR)
.PHONY : install_exes
install_exes :
rm -f fer_executables.tar.gz
bin/make_executable_tar . . -y
mkdir -p $(INSTALL_FER_DIR)
mv -f fer_executables.tar.gz $(INSTALL_FER_DIR)
( cd $(INSTALL_FER_DIR) ; tar xzf fer_executables.tar.gz )
## Compare results from executing the RUN_TESTS.sh test suite with those saved under bench/test_results
.PHONY : check
check :
$(MAKE) -C bench check
.PHONY : check_noremote
check_noremote :
$(MAKE) -C bench check_noremote
##