File: yMakefile

package info (click to toggle)
ncl 6.3.0-13
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 196,648 kB
  • ctags: 70,631
  • sloc: ansic: 603,601; fortran: 441,469; sed: 11,222; csh: 8,350; yacc: 4,253; xml: 1,928; sh: 1,526; lex: 1,266; python: 1,067; f90: 652; perl: 479; java: 447; objc: 291; makefile: 109
file content (670 lines) | stat: -rw-r--r-- 22,142 bytes parent folder | download | duplicates (2)
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
#
#      $Id: yMakefile 15998 2015-02-26 00:07:12Z dbrown $
#
###########################################################################
#			   Copyright (C)  1993			 	  #
#	     University Corporation for Atmospheric Research		  #
#			   All Rights Reserved				  #
#									  #
###########################################################################
#
#	File:		yMakefile for NCL
#
#	Author:		Ethan Alpert
#				National Center for Atmospheric Research
#				POB 3000, Boulder, Colorado
#
#	Date:		$Date: 2015-02-25 17:07:12 -0700 (Wed, 25 Feb 2015) $
#
#	Description:	
#
#	Usage:
#
#	Environment:
#
#	Files:
#
#
#	Options:

MYBIN		=	ncl
#ifdef JIRA1530
MYXQFBIN	=	ncl.xq.fix
#endif
MYLIB		=	libncl
MYLIB_API	=	libnclapi
YACC		=	$(NYACC)

#if defined(Darwin)
 EXTRA_CCOPTIONS =
#EXTRA_CCOPTIONS = -framework OpenCL \
#		  -F/Applications/Qt/Desktop/Qt/474/gcc/lib \
#		  -framework QtOpenGL -framework QtGui -framework QtCore -framework OpenGL -framework AGL
#endif

#if defined(linux)
 EXTRA_CCOPTIONS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
#EXTRA_CCOPTIONS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
#endif

#ifdef EnableProfiling
PROFILE_DEFS = -DENABLE_PROFILING
#else
#define PROFILE_DEFS
#endif

#ifdef EnableMPI
MPI_DEFS = -DUSE_MPI
#else
#define MPI_DEFS
#endif

#ifdef UseNetCDF4Features
NC4_FEATURES_DEFS = -DUSE_NETCDF4_FEATURES
NC4_FEATURES_SRCS = NclNetCDF4.c 
NC4_FEATURES_OBJS = NclNetCDF4.o
#else
#define NC4_FEATURES_DEFS
#define NC4_FEATURES_SRCS
#define NC4_FEATURES_OBJS
#endif

#ifdef BuildHDF4
HDF4_DEFS = -DBuildHDF4 $(HDF4_NETCDF)
HDF4_SRCS = NclHDF.c
HDF4_OBJS = NclHDF.o
#else
#define HDF4_SRCS
#define HDF4_OBJS
#define HDFLIB
#endif

#if defined BuildHDF4 && defined BuildHDFEOS
HDFEOS_DEFS = -DBuildHDFEOS $(HDF4_NETCDF)
HDFEOS_SRCS = NclHDFEOS.c
HDFEOS_OBJS = NclHDFEOS.o
#else
#define HDFEOS_SRCS
#define HDFEOS_OBJS
#define HDFEOSLIB
#endif

#ifdef BuildHDFEOS5
HDFEOS5_DEFS = -DBuildHDFEOS5 $(HDF4_NETCDF)
HDFEOS5_SRCS = NclHDFEOS5.c NclNewHDFEOS5.c
HDFEOS5_OBJS = NclHDFEOS5.o NclNewHDFEOS5.o
#else
#define HDFEOS5_SRCS
#define HDFEOS5_OBJS
#define HDFEOS5LIB
#endif

#ifdef BuildHDF5
HDF5_DEFS = -DBuildHDF5
HDF5_SRCS = NclNewHDF5.c NclHDF5.c h5reader.c h5writer.c
HDF5_OBJS = NclNewHDF5.o NclHDF5.o h5reader.o h5writer.o
#else
#define HDF5_SRCS
#define HDF5_OBJS
#define HDF5LIB
#endif

#ifdef BuildGRIB2
#if defined(IRIX64) || defined(x86_64) || defined(ia64) || defined(__LP64__)
GRIB2_DEFS = -DBuildGRIB2 -D__64BIT__
#else
GRIB2_DEFS = -DBuildGRIB2
#endif
GRIB2_SRCS = NclGRIB2.c
GRIB2_OBJS = NclGRIB2.o
#else
#define GRIB2_SRCS
#define GRIB2_OBJS
#define GRIB2LIB
#endif

#ifdef BuildGDAL
GDAL_DEFS = -DBuildGDAL
#ifdef UseNetCDF4Features
GDAL_SRCS = NclOGR.c NclAdvancedOGR.c
GDAL_OBJS = NclOGR.o NclAdvancedOGR.o
#else
GDAL_SRCS = NclOGR.c
GDAL_OBJS = NclOGR.o 
#endif
#else
#define GDAL_SRCS
#define GDAL_OBJS
#define GDALLIB
#endif


#ifdef BuildOpenCL
OpenCL_DEFS = -DBuildOpenCL
OpenCL_SRCS = openclAddProto.c openclAddFuncs.c
OpenCL_OBJS = openclAddProto.o openclAddFuncs.o
#else
#define OpenCL_SRCS
#define OpenCL_OBJS
#define OpenCLLIB
#endif

#if !defined(BuildUdunits)
#endif

#if !defined(BuildV5D)
#define    V5DLIB
#endif

#if defined(BuildGDAL)
#if defined(sun)
CC_LD		= g\+\+ -R/opt/SUNWspro/lib -L/opt/SUNWspro/lib
CCOPTIONS	= $(EXTRA_CCOPTIONS)
#elif defined(AIX)
CC_LD		= xlC_r
#elif defined(Darwin)
CC_LD		= g\+\+
#elif defined(linux)
CC_LD		= g\+\+
#else
CC_LD		= g\+\+
#endif
#endif

#ifdef  HPUX
ARCH_LIBS	=	-lPW
HACKOBJS	=	hphack.o
#endif

#if !defined(CRAY) && !defined(HPUX) && !defined(IRIX) && !defined(IRIX64) && !defined(OSF1)
DYNAMIC_LIBS	=	-lproj -lgomp -ldl 
#endif

EXTRA_CDEFINES	=	$(OS1_DEF) $(MAJOR_DEF) \
			$(PROFILE_DEFS) $(MPI_DEFS) \
			$(HDFEOS_DEFS) $(HDF4_DEFS) \
			$(HDFEOS5_DEFS) $(HDF5_DEFS) \
			$(GRIB2_DEFS) $(GDAL_DEFS) \
			$(NC4_FEATURES_DEFS) \
			$(OpenCL_DEFS) \
			$(UDUNITS_DEFS) $(V5D_DEFS) 

API_DEFS	=	-DMAKEAPI

PROG_LIBS	=	$(NFPLIBS) $(HLULIBS) $(NCARGLIBS) $(NGMATHLIB)
DEPLIBS		=	$(DEPNFPLIBS) $(DEPHLULIBS) $(DEPNCARGLIBS) $(DEPNGMATHLIB)
#ifdef JIRA1530
PROG_XQFLIBS	=	$(NFPLIBS) $(HLULIBS) $(NCARGXQFLIBS) $(NGMATHLIB)
DEPXQFLIBS	=	$(DEPNFPLIBS) $(DEPHLULIBS) $(DEPNCARGXQFLIBS) $(DEPNGMATHLIB)
#endif

#if defined(CYGWIN)
EXTRA_CLDFLAGS = $(DEV_LIB_SEARCH) $(EXTRA_EXPORT_FLAGS) -Wl,-stack,0x400000
#else
EXTRA_CLDFLAGS = $(DEV_LIB_SEARCH) $(EXTRA_EXPORT_FLAGS)
#endif

#if defined(SUN)
# EXTRA_LIBS      =	$(NCDFLIBS) $(HDFEOS5LIB) $(NETCDF4LIB) $(HDFEOSLIB) $(HDFLIB) $(HDF5LIB) $(GDALLIB) $(GRIDSPECLIB) $(UDUNITSLIB) $(V5DLIB) $(GRIB2LIB) $(PNGLIB) $(CAIROLIB) $(SPHERELIB) $(FFTPACK5LIB) -fast -xlic_lib=sunperf	-lnsl -lintl -lsocket -ldl -lw -lfui 
EXTRA_LIBS      =	$(NCDFLIBS) $(HDFEOS5LIB) $(NETCDF4LIB) $(HDFEOSLIB) $(HDFLIB) $(HDF5LIB) $(GDALLIB) $(GRIDSPECLIB) $(OpenCLLIB) $(UDUNITSLIB) $(V5DLIB) $(GRIB2LIB) $(PNGLIB) $(CAIROLIB) $(EXTERNALLIBS) -lnsl -lintl -lsocket -ldl -lw
#elif defined(AIX)
EXTRA_LIBS      =	$(NCDFLIBS) $(HDFEOS5LIB) $(NETCDF4LIB) $(HDFEOSLIB) $(HDFLIB) $(HDF5LIB) $(GDALLIB) $(GRIDSPECLIB) $(OpenCLLIB) $(UDUNITSLIB) $(V5DLIB) $(GRIB2LIB) $(PNGLIB) $(CAIROLIB) $(EXTERNALLIBS) -lxlf90 -lxlopt
#elif (defined(IRIX) || defined(IRIX64))
EXTRA_LIBS      =	$(NCDFLIBS) $(HDFEOS5LIB) $(NETCDF4LIB) $(HDFEOSLIB) $(HDFLIB) $(HDF5LIB) $(GDALLIB) $(GRIDSPECLIB) $(OpenCLLIB) $(UDUNITSLIB) $(V5DLIB) $(GRIB2LIB) $(PNGLIB) $(CAIROLIB) $(EXTERNALLIBS)
#else
EXTRA_LIBS      =	$(NCDFLIBS) $(HDFEOS5LIB) $(NETCDF4LIB) $(HDFEOSLIB) $(HDFLIB) $(HDF5LIB) $(GDALLIB) $(GRIDSPECLIB) $(OpenCLLIB) $(UDUNITSLIB) $(V5DLIB) $(GRIB2LIB) $(PNGLIB) $(CAIROLIB) $(EXTERNALLIBS)
#endif

SYS_LIBS	=	$(XLIB) $(CTOFLIBS) -lm $(ARCH_LIBS) $(DYNAMIC_LIBS)

HDRS		=	$(GEN_HDRS) $(STATIC_HDRS) $(INSTALL_HDRS) 

GEN_HDRS	=	NclTypeobj.h NclTypelogical.h \
			NclTypedouble.h NclTypefloat.h \
			NclTypeint.h NclTypelong.h \
			NclTypeshort.h NclTypestring.h \
			NclTypeushort.h NclTypeuint.h NclTypeulong.h \
			NclTypeint64.h NclTypeuint64.h \
			NclTypeubyte.h \
			parser.h NclTypebyte.h NclTypechar.h TypeSupport.h \
			MathFuncs.h 

STATIC_HDRS	=	AttSupport.h DataSupport.h FileSupport.h Keywords.h \
			AdvancedFileSupport.h \
			Machine.h NclAtt.h NclData.h \
			NclGroup.h NclFile.h NclFileInterfaces.h NclHLUObj.h NclMdInc.h \
			NclAdvancedFile.h NclAdvancedGroup.h NclAdvancedFileStructure.h \
			NclMultiDValData.h NclMultiDValHLUObjData.h \
			OpsFuncs.h OpsList.h SrcTree.h Symbol.h VarSupport.h \
			NclFileVar.h NclHLUVar.h HLUSupport.h NclCoordVar.h \
			NclType.h NclHDF.h \
			NclDriver.h NclExitCode.h \
			NclMultiDValnclfileData.h NclMultiDValHLUObjData.h \
			NclOneDValCoordData.h HLUFunctions.h \
			NclCallBacksI.h date.h NclCCM.h NclGRIB.h NclGRIB2.h date.h tables.h \
			ccmhdr.h editline.h editline_unix.h ListSupport.h NclList.h \
			NclMultiDVallistData.h NclTypelist.h \
			NclProf.h NclGlobalParams.h \
			cptec_254_gtb.h dwd_002_gtb.h dwd_201_gtb.h dwd_202_gtb.h \
			dwd_203_gtb.h dwd_204_gtb.h dwd_205_gtb.h dwd_206_gtb.h dwd_207_gtb.h \
			ecmwf_128_gtb.h ecmwf_129_gtb.h ecmwf_130_gtb.h ecmwf_131_gtb.h \
			ecmwf_132_gtb.h ecmwf_133_gtb.h ecmwf_140_gtb.h ecmwf_150_gtb.h ecmwf_151_gtb.h \
			ecmwf_160_gtb.h ecmwf_162_gtb.h ecmwf_170_gtb.h ecmwf_171_gtb.h ecmwf_172_gtb.h \
			ecmwf_173_gtb.h ecmwf_174_gtb.h ecmwf_175_gtb.h ecmwf_180_gtb.h ecmwf_190_gtb.h \
			ecmwf_200_gtb.h ecmwf_201_gtb.h ecmwf_210_gtb.h ecmwf_211_gtb.h ecmwf_228_gtb.h \
			ecmwf_230_gtb.h ecmwf_234_gtb.h ecmwf_213_gtb.h ecmwf_214_gtb.h ecmwf_215_gtb.h \
			ecmwf_217_gtb.h ecmwf_218_gtb.h ecmwf_219_gtb.h ecmwf_220_gtb.h ecmwf_221_gtb.h \
			fnmoc_gtb.h fsl0_gtb.h fsl1_gtb.h fsl2_gtb.h ncep_opn_gtb.h \
			ncep_reanal_gtb.h ncep_128_gtb.h ncep_129_gtb.h  ncep_130_gtb.h \
			ncep_131_gtb.h  ncep_133_gtb.h  ncep_140_gtb.h  ncep_141_gtb.h 	jma_3_gtb.h \
			jra55_gtb.h mpi_128_gtb.h mpi_180_gtb.h mpi_199_gtb.h mpi_181_gtb.h 


INSTALL_HDRS	= 	ApiRecords.h AttSupport.h DataSupport.h FileSupport.h HluClasses.h \
			AdvancedFileSupport.h NclAdvancedGroup.h NclHDF.h \
			NclApi.h NclAtt.h NclBuiltInSupport.h NclBuiltIns.h NclCallBacksI.h \
			NclCoordVar.h NclData.h NclDataDefs.h NclDriver.h NclFile.h \
			NclFileInterfaces.h NclGroup.h NclList.h NclMdInc.h NclMultiDValData.h \
			NclMultiDValHLUObjData.h NclMultiDVallistData.h NclMultiDValnclfileData.h \
			NclAdvancedFile.h NclAdvancedFileStructure.h NclOneDValCoordData.h NclOptions.h \
			NclType.h NclTypebyte.h NclTypechar.h NclTypedouble.h NclTypefloat.h \
			NclTypeint.h NclTypeint64.h NclTypelist.h NclTypelogical.h NclTypelong.h \
			NclTypeobj.h NclTypeshort.h NclTypestring.h NclTypeubyte.h NclTypeuint.h \
			NclTypeuint64.h NclTypeulong.h NclTypeushort.h NclVar.h Symbol.h \
			TypeSupport.h VarSupport.h defs.h


NIO_NCL_HDR_FILES = ApiRecords.h AttSupport.h DataSupport.h		\
		FileSupport.h HLUSupport.h ListSupport.h NclAtt.h NclCCM.h		\
		AdvancedFileSupport.h \
		NclCallBacksI.h NclCoordVar.h NclData.h NclDataDefs.h	\
		NclGroup.h NclFile.h NclFileInterfaces.h NclFileVar.h NclGRIB.h	\
		NclAdvancedGroup.h NclAdvancedFile.h NclAdvancedFileStructure.h NclOptions.h \
		NclGRIB2.h NclHLUObj.h NclHLUVar.h NclList.h		\
		NclMdInc.h NclMultiDValData.h NclMultiDValData.h.sed	\
		NclMultiDValHLUObjData.h NclMultiDVallistData.h		\
		NclMultiDValnclfileData.h NclOneDValCoordData.h		\
		NclType.h NclType.h.sed NclTypelist.h NclVar.h		\
		NclExitCode.h NclHDF.h \
		OpsList.h Symbol.h TypeSupport.h.sed NclGrpFuncs.null	\
		TypeSupportMatTemplate.h.sed				\
		TypeSupportMonoOpTemplate.h.sed				\
		TypeSupportOpTemplate.h.sed VarSupport.h ccmhdr.h	\
		h5data_struct.h						\
		cptec_254_gtb.h date.h defs.h dwd_002_gtb.h		\
		dwd_201_gtb.h dwd_202_gtb.h dwd_203_gtb.h		\
		dwd_204_gtb.h dwd_205_gtb.h dwd_206_gtb.h		\
		dwd_207_gtb.h ecmwf_128_gtb.h ecmwf_129_gtb.h ecmwf_130_gtb.h \
		ecmwf_131_gtb.h ecmwf_132_gtb.h ecmwf_133_gtb.h ecmwf_140_gtb.h \
		ecmwf_150_gtb.h ecmwf_151_gtb.h ecmwf_160_gtb.h ecmwf_162_gtb.h \
		ecmwf_170_gtb.h ecmwf_171_gtb.h ecmwf_172_gtb.h ecmwf_173_gtb.h \
		ecmwf_174_gtb.h ecmwf_175_gtb.h ecmwf_180_gtb.h ecmwf_190_gtb.h \
		ecmwf_200_gtb.h ecmwf_201_gtb.h ecmwf_210_gtb.h ecmwf_211_gtb.h \
		ecmwf_228_gtb.h ecmwf_230_gtb.h ecmwf_234_gtb.h ecmwf_213_gtb.h \
		ecmwf_214_gtb.h ecmwf_215_gtb.h ecmwf_217_gtb.h ecmwf_218_gtb.h \
		ecmwf_219_gtb.h ecmwf_220_gtb.h ecmwf_221_gtb.h        \
		fnmoc_gtb.h fsl0_gtb.h fsl1_gtb.h fsl2_gtb.h		\
		jma_3_gtb.h jra55_gtb.h mpi_128_gtb.h mpi_180_gtb.h \
		mpi_199_gtb.h mpi_181_gtb.h ncep_128_gtb.h ncep_129_gtb.h \
		ncep_130_gtb.h ncep_131_gtb.h ncep_133_gtb.h		\
		ncep_140_gtb.h ncep_141_gtb.h ncep_opn_gtb.h		\
		ncep_reanal_gtb.h tables.h

NIO_NCL_OTHER_FILES = AddFileFormats.c AttSupport.c DataSupport.c	\
		FileSupport.c Formats.c GetGrids.c InitData.c		\
		ListSupport.c NclList.c \
		AdvancedFileSupport.c  NclAdvancedOGR.c \
		NclNetCDF4.c NclNewHDF5.c NclNewHDFEOS5.c \
		MatMulDValOp.c.sed Memory.c MultiDValOp.c.sed NclAtt.c	\
		NclCCM.c NclCoordVar.c NclData.c NclGroup.c NclFile.c	\
		NclAdvancedFile.c NclAdvancedGroup.c			\
		NclFileVar.c NclGRIB.c NclGRIB2.c NclHDF.c		\
		NclHDFEOS.c NclHDFEOS5.c NclHDF5.c	\
		NclMultiDValData.c.sed NclMultiDValnclfileData.c	\
                NclMultiDVallistData.c                                  \
		NclNetCdf.c NclOneDValCoordData.c NclType.c NclOGR.c	\
		NclType.c.sed NclTypebyte.c.specific			\
		NclTypechar.c.specific NclTypedouble.c.specific		\
		NclTypefloat.c.specific NclTypeint.c.specific		\
		NclTypelist.c NclTypelogical.c.specific			\
		NclTypeushort.c.specific NclTypeuint.c.specific		\
		NclTypeulong.c.specific NclTypeint64.c.specific		\
		NclTypeuint64.c.specific NclTypeubyte.c.specific	\
		NclTypelong.c.specific NclTypeobj.c.specific		\
		NclTypeshort.c.specific NclTypestring.c.sed		\
		NclTypestring.c.specific NclVar.c			\
		TypeDivOpTemplate.c.sed TypeFunctionOpTemplate.c.sed	\
		TypeInitClassTemplate.c.sed TypeIsMonoFunc.c.sed	\
		TypeMatMulOpTemplate.c.sed TypeMonoOpTemplate.c.sed	\
		TypeResetMissing.c.sed TypeSelectOpTemplate.c.sed	\
		TypeSimpleOpTemplate.c.sed TypeSupport.c.sed		\
		TypeSupportMatTemplate.c.sed				\
		TypeSupportMonoOpTemplate.c.sed				\
		TypeSupportOpTemplate.c.sed TypeXorOpTemplate.c.sed	\
		TypeAndOpTemplate.c.sed TypeOrOpTemplate.c.sed          \
		TypestringCompareOpTemplate.c.sed			\
		TypestringSelectOpTemplate.c.sed			\
		VarSupport.c						\
		h5reader.c h5writer.c                                   \
		byte_data_c.sh char_data_c.sh ctoiee.c data_h.sh	\
		date.c double_data_c.sh float_data_c.sh int_data_c.sh	\
		logical_data_c.sh long_data_c.sh math_funcs.sh		\
		multid_data_c.sh ncepcode.f nclfile_data_c.sh		\
		obj_data_c.sh op_funcs.sh qu2reg3.f rowina3.f scm0.f	\
		short_data_c.sh string_data_c.sh type_support_c.sh	\
		type_support_h.sh ushort_data_c.sh ulong_data_c.sh      \
		ubyte_data_c.sh 					\
		uint_data_c.sh uint64_data_c.sh int64_data_c.sh

PYNIO_SRC_DIR   =	$(TOP)/pynio
NIO_SRC_DIR 	=	$(TOP)/ni/src/lib/nio

API_SRCS=	NclApi.c scanapi.c parseapi.c guiFuncs.c NclDriver.c
EXE_SRCS=	Ncl.c scanner.c parser.c io.c

APISRCS		=	$(API_SRCS) $(SRCS)
EXESRCS		=	$(EXE_SRCS) $(SRCS)
ALLSRCS		=	$(EXE_SRCS) 
COMMON_SRCS     =       $(GEN_TYPE_SRCS)
SRCS		=	$(GEN_SRCS) $(STATIC_SRCS) $(STATIC_IO_SRCS) \
			$(HDFEOS_SRCS) $(HDF4_SRCS) \
			$(HDFEOS5_SRCS) $(HDF5_SRCS) \
			$(OpenCL_SRCS) \
			$(NC4_FEATURES_SRCS) \
			$(GRIB2_SRCS) $(GDAL_SRCS)

GEN_SRCS        =       $(GEN_TYPE_SRCS) $(GEN_EXE_SRCS) $(GEN_API_SRCS) $(GEN_MATH_SRCS)


GEN_TYPE_SRCS	=	NclTypedouble.c NclTypefloat.c \
			NclTypeint.c NclTypelogical.c \
			NclTypelong.c NclTypeobj.c \
			NclTypeshort.c NclTypestring.c \
			NclTypeint64.c NclTypeuint64.c \
			NclTypeubyte.c \
			NclTypeushort.c NclTypeuint.c NclTypeulong.c \
			NclTypebyte.c NclTypechar.c TypeSupport.c \
			NclMultiDValData.c 

GEN_EXE_SRCS  	=       scanner.c parser.c

GEN_API_SRCS    =       scanapi.c parseapi.c

GEN_MATH_SRCS   =       MathFuncs.c

STATIC_IO_SRCS  =       AddFileFormats.c AttSupport.c DataSupport.c \
			FileSupport.c Formats.c GetGrids.c \
			AdvancedFileSupport.c \
			NclAdvancedFile.c NclAdvancedGroup.c \
			InitData.c Memory.c NclAtt.c NclCCM.c \
			NclCoordVar.c NclData.c NclGroup.c NclFile.c NclFileVar.c \
			NclGRIB.c NclMultiDValnclfileData.c \
			NclNetCdf.c NclOneDValCoordData.c NclType.c \
			NclTypelist.c NclVar.c VarSupport.c \
			ctoiee.c date.c 

STATIC_SRCS	=	AddBuiltIns.c AddHLUObjs.c \
			AddIntrinsics.c Execute.c \
			Machine.c OpsFuncs.c Printtoken.c SrcTree.c \
			Symbol.c Translate.c  \
			NclHLUVar.c HLUSupport.c \
			NclMultiDValHLUObjData.c \
			BuiltInSupport.c BuiltInFuncs.c \
			HLUFunctions.c yywrap.c craybin.c \
			complete.c editline.c sysunix.c ListSupport.c \
			NclList.c NclMultiDVallistData.c \
			NclProf.c NclTime.c \
			NclDriver.c PrintToken.c


FSRCS		=	qu2reg3.f rowina3.f scm0.f ncepcode.f

FEXE_IOSRCS     =       fortranio.f

GEN_TYPE_OBJS	=	NclTypedouble.o NclTypefloat.o \
			NclTypeint.o NclTypelogical.o \
			NclTypelong.o NclTypeobj.o \
			NclTypeshort.o NclTypestring.o \
			NclTypeint64.o NclTypeuint64.o \
			NclTypeubyte.o \
			NclTypeushort.o NclTypeuint.o NclTypeulong.o \
			NclTypebyte.o NclTypechar.o TypeSupport.o \
			NclMultiDValData.o 

GEN_EXE_OBJS  	=       scanner.o parser.o

GEN_API_OBJS    =       scanapi.o parseapi.o

GEN_MATH_OBJS   =       MathFuncs.o

STATIC_IO_OBJS  =       AddFileFormats.o AttSupport.o DataSupport.o \
			FileSupport.o Formats.o GetGrids.o \
			AdvancedFileSupport.o \
			NclAdvancedFile.o NclAdvancedGroup.o \
			InitData.o Memory.o NclAtt.o NclCCM.o \
			NclCoordVar.o NclData.o NclGroup.o NclFile.o NclFileVar.o \
			NclGRIB.o NclMultiDValnclfileData.o \
			NclNetCdf.o NclOneDValCoordData.o NclType.o \
			NclTypelist.o NclVar.o VarSupport.o \
			ctoiee.o date.o 

STATIC_OBJS	=	AddBuiltIns.o AddHLUObjs.o \
			AddIntrinsics.o Execute.o \
			Machine.o OpsFuncs.o SrcTree.o \
			Symbol.o Translate.o  \
			NclHLUVar.o HLUSupport.o \
			NclMultiDValHLUObjData.o \
			BuiltInSupport.o BuiltInFuncs.o \
			javaAddProto.o javaAddFuncs.o \
			userAddProto.o userAddFuncs.o \
			HLUFunctions.o yywrap.o craybin.o \
			complete.o editline.o sysunix.o ListSupport.o \
			NclList.o NclMultiDVallistData.o \
			NclProf.o NclTime.o PrintToken.o


FOBJS		=	qu2reg3.o rowina3.o scm0.o ncepcode.o

FIO_OBJS        =       fortranio.o

COMMON_OBJS	=	$(GEN_TYPE_OBJS) $(STATIC_IO_OBJS) $(FOBJS) \
			$(HDFEOS_OBJS) $(HDF4_OBJS) \
			$(HDFEOS5_OBJS) $(HDF5_OBJS) \
			$(OpenCL_OBJS) \
			$(NC4_FEATURES_OBJS) \
			$(GRIB2_OBJS) $(GDAL_OBJS)

API_OBJS	=	NclApi.o ioapi.o NclHLUObjapi.o guiFuncs.o NclDriver.o \
			$(GEN_API_OBJS) $(GEN_MATH_OBJS) $(COMMON_OBJS) $(STATIC_OBJS) $(FIO_OBJS)
ARCH_OBJS	=	io.o NclHLUObj.o NclApi.o guiFuncs.o NclDriver.o \
			$(GEN_EXE_OBJS) $(GEN_MATH_OBJS) $(COMMON_OBJS) $(STATIC_OBJS) $(FIO_OBJS)
IO_OBJS         =       $(IO_EXTRA_OBJS) $(COMMON_OBJS) $(FMAP_OBJS)

APIOBJS		=	$(API_OBJS) 
EXEOBJS		=	Ncl.o $(ARCH_OBJS) $(HACKOBJS)
IOOBJS          =       $(IO_OBJS)

LibraryTarget($(MYLIB),$(ARCH_OBJS))
LibraryTarget($(MYLIB_API),$(APIOBJS))
BuildSharedLibTarget(libNGncl,$(APIOBJS),1,0,$(NCDFLIBS) $(NETCD4LIBS) $(HDFEOSLIB)  $(HDFEOS5LIB) $(HDFLIB) $(HDF5LIB) $(GRIB2LIB) $(GDALLIB) $(GRIDSPECLIB) $(OpenCLLIBS) $(PNGLIB) $(CAIROLIB) $(UDUNITSLIB) $(V5DLIB) $(CTOFLIBS) -lgomp -ldl -lm -lc)
CProgram($(MYBIN),$(EXEOBJS),$(DEPLIBS))
#ifdef JIRA1530
CProgramXQF($(MYXQFBIN),$(EXEOBJS),$(DEPXQFLIBS))
#endif
InstallTarget(MakeNcl,$(INSTALL_BIN),$(BINPATH))
BuildIncludes($(INSTALL_HDRS),ncarg/ncl,../..)
InstallTarget($(INSTALL_HDRS),$(INSTALL_INC),$(NCLINCPATH))

#ifndef IncludesCopyTarget
#define IncludesCopyTarget(names, mode, dest_prefix,dest)\
includes:: names]\
	@if (test -d dest_prefix); then \ ]\
	(if (test ! -d dest); then ($(MKDIRHIER) $(NILIBSRC)/nio); fi; \ ]\
	echo "copying NIO files to $(NILIBSRC)/nio"; \ ]\
        for name in names; do \ ]\
        (echo "Copying $$name";\ ]\
        $(INSTALL) -m mode $$name dest); \ ]\
        done;) \ ]\
	fi
#endif  /* IncludesCopyTarget */

IncludesCopyTarget($(NIO_NCL_HDR_FILES),$(INSTALL_INC),$(NILIBSRC),$(NILIBSRC)/nio)
IncludesCopyTarget($(NIO_NCL_OTHER_FILES),$(INSTALL_INC),$(NILIBSRC),$(NILIBSRC)/nio)

includes:: $(HDRS)
depend-local:: $(SRCS)
DependTarget($(SRCS))

CleanFilesTarget(lex.yy.c y.tab.c y.tab.h)
CleanFilesTarget($(GEN_HDRS) $(GEN_SRCS))

#
# yacc and lex dependancies
#

ioapi.o : io.c
	$(CC) -c $(API_DEFS) $(CFLAGS) io.c -o ioapi.o

NclHLUObjapi.o : NclHLUObj.c
	$(CC) -c $(API_DEFS) $(CFLAGS) NclHLUObj.c -o NclHLUObjapi.o

scanapi.c: scanner.c
	$(CP) scanner.c scanapi.c

scanapi.o: scanapi.c
	$(CC) -c $(API_DEFS) $(CFLAGS) $<

parseapi.c: parser.c
	$(CP) parser.c parseapi.c

parseapi.o: parseapi.c
	$(CC) -c $(API_DEFS) $(CFLAGS) $<

##if	defined(SUN) && (MAJOR == 4)
#scanner.c:	lex.yy.c syms_lex.sh
#	$(SHELL) syms_lex.sh
#
#parser.h:	y.tab.h syms_tab_h.sh
#	$(SHELL) syms_tab_h.sh
#
#parser.c:	y.tab.c syms_tab_c.sh
#	$(SHELL) syms_tab_c.sh
##else
scanner.c:	lex.yy.c
	$(CP) lex.yy.c scanner.c

parser.h:	y.tab.h
	$(CP) y.tab.h parser.h

parser.c:	y.tab.c
	$(CP) y.tab.c parser.c
##endif

lex.yy.c: ncl.l
	$(LEX) ncl.l

y.tab.c y.tab.h: ncl.y 
	$(YACC) -d -t ncl.y

TypeSupport.h: TypeSupport.h.sed TypeSupportMatTemplate.h.sed TypeSupportOpTemplate.h.sed TypeSupportMonoOpTemplate.h.sed
	@$(SHELL) type_support_h.sh

TypeSupport.c: TypeSupport.c.sed TypeSupportMatTemplate.c.sed TypeSupportOpTemplate.c.sed TypeSupportMonoOpTemplate.c.sed
	@$(SHELL) type_support_c.sh

NclMultiDValData.c: NclMultiDValData.c.sed MultiDValOp.c.sed NclMultiDValData.h math_funcs.sh MatMulDValOp.c.sed
	@$(SHELL) multid_data_c.sh

MathFuncs.c: MathFuncs.c.sed MathFuncs.h.sed MathTemplate.c.sed MathTemplate.h.sed math_funcs.sh
	@$(SHELL) math_funcs.sh

MathFuncs.h: MathFuncs.c.sed MathFuncs.h.sed MathTemplate2.c.sed MathTemplate.c.sed MathTemplate.h.sed math_funcs.sh
	@$(SHELL) math_funcs.sh

#
# Data Object dependancies
#

#define	NclTypeRule_h(type)\
]\
NclType##type.h:	data_h.sh NclType.h.sed]\
	@$(SHELL) data_h.sh type]

#define NclTypeRule_c(type,xtra_dep)\
]\
NclType##type.c:	type##_data_c.sh op_funcs.sh NclType##type.c.specific xtra_dep]\
	@$(SHELL) type##_data_c.sh]

#define NclTypeRule(type,xtra_dep)\
NclTypeRule_h(type)\
NclTypeRule_c(type,xtra_dep)

NUM_OP_TMPL	=	TypeDivOpTemplate.c.sed \
			TypeFunctionOpTemplate.c.sed \
			TypeMatMulOpTemplate.c.sed \
			TypeIsMonoFunc.c.sed \
			TypeMonoOpTemplate.c.sed \
			TypeResetMissing.c.sed \
			TypeSelectOpTemplate.c.sed \
			TypeSimpleOpTemplate.c.sed \
			TypeXorOpTemplate.c.sed \
			TypeInitClassTemplate.c.sed \
			NclType.c.sed \
			NclType.h.sed \
			TypeAndOpTemplate.c.sed \
			TypeOrOpTemplate.c.sed 

STR_OP_TMPL	=	TypestringCompareOpTemplate.c.sed \
			TypestringSelectOpTemplate.c.sed \
			TypeInitClassTemplate.c.sed \
			NclTypestring.c.sed

FILE_OP_TMPL	=	NclMultiDValData.c.sed MultiDValOp.c.sed 


NclTypeRule(double,$(NUM_OP_TMPL))
NclTypeRule(float,$(NUM_OP_TMPL))
NclTypeRule(int,$(NUM_OP_TMPL))
NclTypeRule(long,$(NUM_OP_TMPL))
NclTypeRule(short,$(NUM_OP_TMPL))
NclTypeRule(logical,$(NUM_OP_TMPL))
NclTypeRule(string,$(STR_OP_TMPL))
NclTypeRule(obj,$(NUM_OP_TMPL))
NclTypeRule(char,$(NUM_OP_TMPL))
NclTypeRule(byte,$(NUM_OP_TMPL))
NclTypeRule(int64,$(NUM_OP_TMPL))
NclTypeRule(ushort,$(NUM_OP_TMPL))
NclTypeRule(uint,$(NUM_OP_TMPL))
NclTypeRule(ulong,$(NUM_OP_TMPL))
NclTypeRule(uint64,$(NUM_OP_TMPL))
NclTypeRule(ubyte,$(NUM_OP_TMPL))

#
# Data Format Dependencies
#
 
NclHDF.o: NclHDF.c
	  @echo 
	  @echo Compiling NclHDF.c will generate warning messages.
	  @echo These can safely be ignored.
      $(CC) -c $(HDFDEFINES) $(HDF4_NETCDF) $(CFLAGS) NclHDF.c
	  @echo 

NclHDFEOS.o: NclHDFEOS.c
	  @echo 
	  @echo Compiling NclHDFEOS.c will generate warning messages.
	  @echo These can safely be ignored.
      $(CC) -c $(HDFDEFINES) $(HDF4_NETCDF) $(CFLAGS) NclHDFEOS.c
	  @echo 


MakeNcl: MakeNcl.csh Makefile
	@sed \
	-e 's+SED_CC_LD+$(CC_LD)+' \
	-e 's+SED_CC_OPT+$(CCOPTIONS)+' \
	-e 's+SED_LDLIBS+$(LDLIBS)+' \
	-e 's+SED_EXTRA_LDLIBS+$(EXTRA_LDLIBS)+' \
	-e 's+SED_LIBPATH+$(LIBPATH)+' \
	-e 's+SED_INCPATH+$(INCPATH)+' \
	<MakeNcl.csh > MakeNcl