forked from Unidata/gempak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
166 lines (144 loc) · 3.65 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
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
#################################################################
###################################################################
#
# Makefile for UPC GEMPAK7
# Top level
#
####################################################################
####################################################################
####################################################################
#
# The following environment variables must be defined before
# invoking this Makefile:
#
# $NAWIPS - points to the toplevel of the NAWIPS directory tree.
# $GEMPAK and $GEMPAKHOME - points to the toplevel of the gempak part
# of the NAWIPS tree. Usually directly under $NAWIPS.
#
# $NA_OS - Used in $(NAWIPS)/config/$(MAKEINC) to decide which
# OS specific Makeinc.* to include. It also cooresponds
# to the directories in the NAWIPS tree where the executables
# and libraries are installed.
#
####################################################################
#
#
#
include $(CONFIGDIR)/$(MAKEINC)
SUBDIRS = \
extlibs \
gempak
# .INIT: INSTALLDIRS
all : INSTALLDIRS
@for dir in $(SUBDIRS); do \
( cd $$dir; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@ ) ; \
done
All : all
everything: distclean all install programs_nc programs_gf
Everything: everything
basic: INSTALLDIRS distclean all install
web: INSTALLDIRS distclean all install programs_gf
programs_nc : INSTALLDIRS
@cd gempak; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@
programs_gf : INSTALLDIRS
@cd gempak; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@
install : INSTALLDIRS
@case $(HAVEMOTIF) in \
NO) \
for dir in NODIR $(SUBDIRS_NOMOTIF); do \
case $$dir in \
NODIR) ;; \
*) if [ -d $$dir ]; then \
(cd $$dir; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@) ; \
else \
echo "Skipping $$dir"; \
fi; \
;; \
esac ; \
done \
;; \
*) \
for dir in NODIR $(SUBDIRS); do \
case $$dir in \
NODIR) ;; \
*) if [ -d $$dir ]; then \
(cd $$dir; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@) ; \
else \
echo "Skipping $$dir"; \
fi; \
;; \
esac ; \
done \
;; \
esac
clean:
@for dir in NODIR $(SUBDIRS); do \
case $$dir in \
NODIR) ;; \
*) if [ -d $$dir ]; then \
(cd $$dir; echo "Making $@ in `pwd`" ; \
$(MAKE) $(MFLAGS) $@) ; \
else \
echo "Skipping $$dir"; \
fi; \
;; \
esac ; \
done
testprog :
@cd gempak; echo "making $@ programs in `pwd`" ; \
$(MAKE) $(MFLAGS) $@
#
# Create the Installation directories, if they don't exist.
#
INSTALLDIRS: $(OS_LIB) $(OS_BIN) $(OS_INC) $(OS_INC)/MCHPRM.PRM
@echo "..."
$(OS_LIB):
@echo " Creating $@"
@mkdir -p $@
@chmod g+s $@
$(OS_BIN):
@echo " Creating $@"
@mkdir -p $@
@chmod g+s $@
$(SCRIPTS_EXE):
@echo " Creating $@"
@mkdir -p $@
@chmod g+s $@
$(OS_INC):
@echo " Creating $@"
@mkdir -p $@
@chmod g+s $@
$(OS_INC)/MCHPRM.PRM: $(OS_INC)
if [ ! -f $(OS_INC)/MCHPRM.PRM ] ; then \
ln -s $(INCDIR)/$(MCHSYS) $(OS_INC)/MCHPRM.PRM ; \
fi
# ln -s $(INCDIR)/MCHPRM.$(OPSYS) $(OS_INC)/MCHPRM.PRM ; \
#
# Keep the bin directory, unless we want really clean!
distclean: clean
@if [ -d os/$(NA_OS) ] ; then \
( echo "making distclean in os/$(NA_OS)" ; cd os/$(NA_OS) ; $(RM) -rf share man include lib ) ; \
fi
reallyclean: distclean
@if [ -d os/$(NA_OS) ] ; then \
( echo "removing os/$(NA_OS)" ; cd os ; $(RM) -rf $(NA_OS) ) ; \
fi
gnu_fortran:
@if \
which g77 ; \
then \
echo 'Use g77' ; \
else \
if \
which gfortran ; \
then \
echo 'Use GFORTRAN' ; \
else \
echo 'No fortran compiler' ; \
fi ; \
fi