File: Makefile

package info (click to toggle)
hdf-eos4 2.20v1.00-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 34,028 kB
  • sloc: ansic: 46,955; sh: 23,547; fortran: 15,467; csh: 1,098; makefile: 633
file content (415 lines) | stat: -rw-r--r-- 12,467 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
#----------------------------------------------------------------------------
# file:         makefile for HDF-EOS (for internal ECS usage only)
#
# environment:  requires environment established by the ECS .buildrc file
# 
# environment variables dependencies:
#   MAKECMD  make command to be run on make files
#   ARCH     architecture (i.e. hardware/os type)
#
#
# author:  Guru Tej S. Khalsa / Space Applications Corp.
#          Adura Adekunjo    / L3 Communications GSI
#          Abe Taaheri / Raytheon IIS
#
# history:
#       10-Nov-1997 GTSK Initital version
#       23-Oct-2003 AA   Modified for Toolkit Linux Delivery
#       02-Feb-2013 AT   Modified for Toolkit Linux64 build in clearcase
#
# notes:
#       1) This file is only for use by ECS Configuration Management (CM)
#	   personnel and software.  This file should not be distributed
#	   as part of the standard HDF-EOS delivery.
#----------------------------------------------------------------------------

# define shell to be used (use ksh so we can use the "." command)

SHELL=/bin/ksh

# define MAKE to be equivalant to $(MAKECMD)

MAKE=$(MAKECMD)

# define the location of the HDF-EOS STAGE area

HE_STAGE=/ecs/formal/STAGE/hdfeos

# define the location of the standard HDF-EOS development area

HE_HOME=/ecs/hdfeos

# define HDF base directory

HDF_BASE=/ecs/cots/hdf

# define current HDF version

CURRENT_HDF=HDF4.2.10
CURRENT_SZIP=szip-2.1

# define SDP Toolkit home directory

TK_HOME=/ecs/formal/TOOLKIT

# name of tar files for delivery
HDFEOS_SOURCE_TAR=HDF-EOS2.20v1.00.tar
HDFEOS_TESTDRIVERS_TAR=HDF-EOS2.20v1.00_TestDriver.tar

# define the default compiler optimization level
OPT_LVL=-g

# define default target

default:
	@echo "This file is for use by ECS Configuration Management processes only."

# define a target to build BOTH variations (or "flavors") of HDF-EOS
# for a given "brand" (i.e. architecture type)

full: opt debug

# define a target to build the "debug" variation (or "flavor") of HDF-EOS
# for a given "brand" (i.e. architecture type) ("debug" means the library
# will be compiled for use in a souce code debugger)

debug:
	@$(MAKE) flavor_dir FLAVOR=$@
	@export use_flavor=1; $(MAKE) $(TARGET) OPT_LVL=-g FLAVOR=$@

# define a target to build the "optimized" variation (or "flavor") of
# HDF-EOS for a given "brand" (i.e. architecture type) ("optimized" means the
# library will be optimized for execution speed by the compiler)

opt:
	@$(MAKE) flavor_dir FLAVOR=$@
	@export use_flavor=1; $(MAKE) $(TARGET) OPT_LVL=-O FLAVOR=$@

# define standard CM targets

# NOTE: The standard targets defined by ECS CM are:
#       BuildImake, ProductHs, ProductLibs, LastPass, Deliver
#
#       Here the above targets are shadowed by the targets:
#       BuildImake2, ProductHs2, ProductLibs2, LastPass2, Deliver2
#       respectively.  The original targets only call the target
#       HE_ENV which sets up the HDF-EOS environment and then
#       builds the shadow target.
#       For SGI 32 Falvor build or linux 12 Falvor build these targets
#       renamed to FL_......

BuildImake:
	@$(MAKE) $(MFLAGS) HE_ENV TARGET=$@2

BuildImake2:
	@echo "No Imakefile to build."

ProductHs:
	@$(MAKE) $(MFLAGS) HE_ENV TARGET=$@2

ProductHs2:
	@echo "No header files to generate or promote."
	@/bin/touch include/HE2_config.h

ProductLibs: ProductLibs32 ProductLibs64

ProductLibs32:
	@$(MAKE) $(MFLAGS) HE_ENV TARGET=$@2

ProductLibs322:
	@if [ ! -e $(HDFEOS_HOME)/lib/$(ARCH) ] ; then	\
		cd $(HDFEOS_HOME)/lib;			\
		ln -s `basename $(HDFEOS_LIB)` $(ARCH);		\
	fi
	@cd $(HDFEOS_HOME)/src; $(MAKE) $(MFLAGS) all
	@cd $(TK_HOME)/src/GCT/freeware; $(MAKE) $(MFLAGS) gctp


ProductLibs64:
	@$(MAKE) $(MFLAGS) HE_ENV64 TARGET=$@2

ProductLibs642:
	@if [ ! -e $(HDFEOS_HOME)/lib/$(ARCH)64 ] ; then	\
		cd $(HDFEOS_HOME)/lib;			\
		ln -s `basename $(HDFEOS_LIB)` $(ARCH)64;		\
	fi
	@cd $(HDFEOS_HOME)/src; $(MAKE) $(MFLAGS) all
	@cd $(TK_HOME)/src/GCT/freeware; $(MAKE) $(MFLAGS) gctp

LastPass:LastPass32 LastPass64

LastPass32:
	@$(MAKE) $(MFLAGS) HE_ENV TARGET=$@2

LastPass322:
	@if [ ! -e $(HDFEOS_HOME)/bin/$(ARCH) ] ; then	\
		cd $(HDFEOS_HOME)/bin;			\
		ln -s `basename $(HDFEOS_BIN)` $(ARCH);\
	fi
	@cd $(HDFEOS_HOME)/util; $(MAKE) $(MFLAGS) all


LastPass64:
	@$(MAKE) $(MFLAGS) HE_ENV64 TARGET=$@2

LastPass642:
	@if [ ! -e $(HDFEOS_HOME)/bin/$(ARCH)64 ] ; then	\
		cd $(HDFEOS_HOME)/bin;			\
		ln -s `basename $(HDFEOS_BIN)` $(ARCH)64;\
	fi
	@cd $(HDFEOS_HOME)/util; $(MAKE) $(MFLAGS) all

FL_BuildImake:
	@$(MAKE) $(MFLAGS) FL_HE_ENV TARGET=$@2

FL_BuildImake2:
	@echo "No Imakefile to build."

FL_ProductHs:
	@$(MAKE) $(MFLAGS) FL_HE_ENV TARGET=$@2

FL_ProductHs2:
	@echo "No header files to generate or promote."

FL_ProductLibs:
	@$(MAKE) $(MFLAGS) FL_HE_ENV TARGET=$@2
	@/bin/touch include/HE2_config.h

FL_ProductLibs2:
	@if [ ! -e $(HDFEOS_HOME)/lib/$(ARCH) ] ; then	\
		cd $(HDFEOS_HOME)/lib;			\
		ln -s `basename $(HDFEOS_LIB)` $(ARCH);		\
	fi
	@cd $(HDFEOS_HOME)/src; $(MAKE) $(MFLAGS) all
	@cd $(TK_HOME)/src/GCT/freeware; $(MAKE) $(MFLAGS) gctp

FL_LastPass:
	@$(MAKE) $(MFLAGS) FL_HE_ENV TARGET=$@2

FL_LastPass2:
	@if [ ! -e $(HDFEOS_HOME)/bin/$(ARCH) ] ; then	\
		cd $(HDFEOS_HOME)/bin;			\
		ln -s `basename $(HDFEOS_BIN)` $(ARCH);\
	fi
	@cd $(HDFEOS_HOME)/util; $(MAKE) $(MFLAGS) all

#	@echo "No utilites to build."



Deliver:
	@$(MAKE) $(MFLAGS) HE_ENV TARGET=$@2

Deliver2:
	tar cvfX $(HE_HOME)/install/$(HDFEOS_SOURCE_TAR) $(HE_HOME)/make_exclude_list -C /ecs ./hdfeos
	tar cvf $(HE_HOME)/install/$(HDFEOS_TESTDRIVERS_TAR) -C /ecs ./hdfeos/testdrivers

DaacDeliver:
	@if [ $(ARCH) = "sgi6n32" ] ; then				    \
		for arch in sgi6n32 sgi6 ; do			            \
			for targ in FL_ProductHs FL_ProductLibs FL_LastPass ; do	    \
				$(MAKECMD) full TARGET=$$targ ARCH=$$arch;  \
			done;						    \
		done;							    \
	elif [ $(ARCH) = "irix65" ] ; then				    \
		for arch in sgi6n32 sgi6 ; do			            \
			for targ in FL_ProductHs FL_ProductLibs FL_LastPass ; do	    \
				$(MAKECMD) full TARGET=$$targ ARCH=$$arch;  \
			done;						    \
		done;                                                       \
	else								    \
		for targ in FL_ProductHs FL_ProductLibs FL_LastPass ; do		    \
			$(MAKECMD) full TARGET=$$targ;			    \
		done;							    \
	fi

LinuxDaacDeliver:  
	@if [ $(ARCH) = "linux" ] ; then				    \
		for arch in linux ; do					    \
			for targ in FL_ProductHs FL_ProductLibs FL_LastPass ; do	    \
			$(MAKECMD) full TARGET=$$targ ARCH=$$arch;	    \
		done ;							    \
		done ;							    \
	fi

# this is a special target used to establish the HDF-EOS environment

FL_HE_ENV:
	@case $(ARCH) in					\
		hp10)    brand=hp;      ;;                      \
		sgi6n32) brand=sgi32; sgi_mode=n32;  ;;         \
		irix65)  brand=irix65; sgi_mode=65   ;;         \
		sgi6)    brand=sgi64; sgi_mode=64;  ;;		\
		sun5.5)  brand=sun5;    ;;			\
		sun5.8)  brand=sun5.8;    ;;			\
		linux)   LINUX_BRAND=linux; brand=$(ARCH) ;;    \
		*)       brand=$(ARCH); ;;			\
	esac;							\
	postfix=""; 						\
	opt_flag=-O;						\
	case $(FLAVOR) in					\
		*debug)						\
			opt_flag=-g;				\
			postfix=_debug;				\
		;;						\
	esac;							\
	HDFEOS_HOME=$(HE_HOME);					\
	LNX_COMP_FLAG="-m32";					\
	export LNX_COMP_FLAG;					\
	opt_flag=$(OPT_LVL);					\
	export HDFEOS_HOME sgi_mode opt_flag LINUX_BRAND;	\
	. $(HE_HOME)/bin/$${brand}$$postfix/hdfeos_env.ksh;	\
	MAKE="$(MAKECMD)";					\
	AR='ar r';						\
	HDFINC=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/include;	\
	HDFLIB=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/lib;		\
	PGSINC=$(TK_HOME)/include;				\
	SZIPLIB=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/lib;	\
	SZIPINC=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/include;	\
	export MAKE AR HDFINC PGSINC SZIPINC SZIPLIB HDFLIB;	\
	$(MAKE) $(MFLAGS) $(TARGET)

HE_ENV:
	@case $(ARCH) in					\
		hp10)    brand=hp;      ;;                      \
		sgi6n32) brand=sgi32; sgi_mode=n32;  ;;         \
		irix65)  brand=irix65; sgi_mode=65   ;;         \
		sgi6)    brand=sgi64; sgi_mode=64;  ;;		\
		sun5.5)  brand=sun5;    ;;			\
		sun5.8)  brand=sun5.8;    ;;			\
		linux)   LINUX_BRAND=linux; brand=$(ARCH);;     \
		*)       brand=$(ARCH); ;;			\
	esac;							\
	HDFEOS_HOME=$(HE_HOME);					\
	opt_flag=$(OPT_LVL);					\
	export HDFEOS_HOME sgi_mode opt_flag LINUX_BRAND;	\
	. $(HE_HOME)/bin/tmp/hdfeos_env.ksh.tmp;		\
	if [ $(ARCH) = "linux" ] ; then				\
	CC="gcc -m32";						\
	export CC;						\
	LNX_COMP_FLAG="-m32";					\
	export LNX_COMP_FLAG;					\
	fi;							\
	MAKE="$(MAKECMD)";					\
	AR='ar r';						\
	HDFINC=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/include;	\
	HDFLIB=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/lib;		\
	PGSINC=$(TK_HOME)/include;				\
	SZIPLIB=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/lib;	\
	SZIPINC=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/include;	\
	export MAKE AR HDFINC PGSINC SZIPINC SZIPLIB HDFLIB;	\
	$(MAKE) $(MFLAGS) $(TARGET)

HE_ENV64:
	@case $(ARCH) in					\
		hp10)    brand=hp;      ;;                      \
		sgi6n32) brand=sgi32; sgi_mode=n32;  ;;         \
		irix65)  brand=irix65; sgi_mode=65   ;;         \
		sgi6)    brand=sgi64; sgi_mode=64;  ;;		\
		sun5.5)  brand=sun5;    ;;			\
		sun5.8)  brand=sun5.8;    ;;			\
		linux)   LINUX_BRAND=linux64; brand=$(ARCH)64;; \
		*)       brand=$(ARCH); ;;			\
	esac;							\
	HDFEOS_HOME=$(HE_HOME);					\
	opt_flag=$(OPT_LVL);					\
	export HDFEOS_HOME sgi_mode opt_flag LINUX_BRAND;	\
	. $(HE_HOME)/bin/tmp/hdfeos_env.ksh.tmp;		\
	if [ $(ARCH) = "linux" ] ; then				\
	CC="gcc -fPIC";						\
	export CC;						\
	LNX_COMP_FLAG="";					\
	export LNX_COMP_FLAG;					\
	fi;							\
	MAKE="$(MAKECMD)";					\
	AR='ar r';						\
	HDFINC=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/include;	\
	HDFLIB=$(HDF_BASE)/$$brand/$(CURRENT_HDF)/lib;		\
	PGSINC=$(TK_HOME)/include;				\
	SZIPLIB=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/lib;	\
	SZIPINC=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/include;	\
	export MAKE AR HDFINC PGSINC SZIPINC SZIPLIB HDFLIB;	\
	$(MAKE) $(MFLAGS) $(TARGET)

flavor_dir:
	@sgi_mode=sgi32;					\
	LNX_COMP_FLAG="-m32";					\
	export LNX_COMP_FLAG;					\
	opt_flag=-O;						\
	postfix="";						\
	case $(FLAVOR) in					\
		*debug)						\
			opt_flag=-g;				\
			postfix=_debug;				\
		;;						\
	esac;							\
	case $(ARCH) in						\
		hp10)						\
			brand=hp;				\
		;;						\
		sgi6n32)					\
			brand=sgi32;				\
			sgi_mode=n32;				\
		;;						\
		irix65)                                         \
			brand=irix65;				\
			sgi_mode=65;				\
		;;						\
		sgi6)						\
			brand=sgi64;				\
			sgi_mode=64;				\
		;;						\
		sun5.5)						\
			brand=sun5;				\
		;;						\
		sun5.8)						\
			brand=sun5.8;				\
		;;						\
		*)						\
			brand=$(ARCH);				\
		;;						\
	esac;							\
	he_obj=$(HE_HOME)/obj/$${brand}$$postfix;		\
	he_lib=$(HE_HOME)/lib/$${brand}$$postfix;		\
	he_bin=$(HE_HOME)/bin/$${brand}$$postfix;		\
	tmpdir=$(HE_HOME)/bin/tmp;				\
	if [ ! -d $$he_obj ] ; then				\
		mkdir $$he_obj;					\
	fi;							\
	if [ ! -d $$he_lib ] ; then				\
		mkdir $$he_lib;					\
	fi;							\
	if [ ! -d $$he_bin ] ; then				\
		mkdir $$he_bin;					\
	fi;							\
	hdflib=$(HDF_BASE)/$${brand}/$(CURRENT_HDF)/lib;	\
	hdfinc=$(HDF_BASE)/$${brand}/$(CURRENT_HDF)/include;	\
	sziplib=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/lib;	\
	szipinc=$(HDF_BASE)/$${brand}/$(CURRENT_SZIP)/include;	\
	if [ ! -f $$he_bin/hdfeos_env.csh ] ; then			\
		cd $$he_bin;						\
		echo "setenv HDFEOS_HOME $(HE_HOME)" > hdfeos_env.csh;	\
		echo "setenv HDFLIB $$hdflib" >> hdfeos_env.csh;	\
		echo "setenv HDFINC $$hdfinc" >> hdfeos_env.csh;	\
		echo "setenv SZIPLIB $$sziplib" >> hdfeos_env.csh;	\
		echo "setenv SZIPINC $$szipinc" >> hdfeos_env.csh;	\
		echo "set sgi_mode=$$sgi_mode" >> hdfeos_env.csh;	\
		echo "set opt_flag=$$opt_flag" >> hdfeos_env.csh;	\
		echo "set use_flavor=1" >> hdfeos_env.csh;		\
		sed "s^LNX_CMP_FLAG^$$LNX_COMP_FLAG^" 			\
		$$tmpdir/hdfeos_env.csh.tmp >> hdfeos_env.csh;		\
	fi;								\
	if [ ! -f $$he_bin/hdfeos_env.ksh ] ; then			\
		cd $$he_bin;						\
		echo "HDFEOS_HOME=$(HE_HOME)" > hdfeos_env.ksh;		\
		echo "HDFLIB=$$hdflib" >> hdfeos_env.ksh;		\
		echo "HDFINC=$$hdfinc" >> hdfeos_env.ksh;		\
		echo "SZIPLIB=$$sziplib" >> hdfeos_env.ksh;		\
		echo "SZIPINC=$$szipinc" >> hdfeos_env.ksh;		\
		echo "sgi_mode=$$sgi_mode" >> hdfeos_env.ksh;		\
		echo "opt_flag=$$opt_flag" >> hdfeos_env.ksh;		\
		echo "use_flavor=1" >> hdfeos_env.ksh;			\
		sed "s^LNX_CMP_FLAG^$$LNX_COMP_FLAG^" 			\
		$$tmpdir/hdfeos_env.ksh.tmp >> hdfeos_env.ksh;		\
	fi