-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.example
68 lines (45 loc) · 1.89 KB
/
Makefile.example
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
#******************************************************************************%
# *
# * Copyright (C) 2016-2019 Simon Proud <[email protected]>
# * License: CC BY-NC-ND 4.0
# *
# ******************************************************************************
.SUFFIXES: .c .f90
# Change this to point to your local libraries for HDF5 and NetCDF
LIBDIR=/network/aopp/apres/users/proud/ORAC_Common_Prog/Library
INCDIRS += -I$(LIBDIR)/hdf5/include -I$(LIBDIR)/ncdff/include -I$(LIBDIR)/ncdf4/include
LIBDIRS += -L$(LIBDIR)/hdf5/lib -L$(LIBDIR)/ncdff/lib -L$(LIBDIR)/ncdf4/lib
LINKS+= -lhdf5 -lhdf5_fortran -lhdf5hl_fortran -lnetcdff -lnetcdf -lm -fopenmp
OBJECTS = himawari.o \
himawari_headerinfo.o \
himawari_readheader.o \
himawari_utils.o \
himawari_nav.o \
himawari_readwrite.o
SOLOBS = solpos.o \
CC=gcc
F90=gfortran
#CC=icc
#F90=ifort
CFLAGS=-g -O3 -ffree-line-length-0 -cpp -I. -fopenmp #-DVERBOSE
F90FLAGS=-g -O3 -I. -ffree-line-length-0 -cpp -fopenmp -fcheck=bounds # -DVERBOSE
#CFLAGS=-g -O2 -fpp -align rec1byte -warn noalign -I.#-DVERBOSE
#F90FLAGS=-g -O2 -I. -align rec1byte -warn noalign -fpp #-DVERBOSE
#%.o: %.c $(DEPS)
# $(CC) $(CFLAGS) -c -o $@ $<
all: solar.a \
AHI \
libhimawari_util.a
solar.a: $(SOLOBS)
ar -rs solar_util.a $(SOLOBS)
libhimawari_util.a: $(OBJECTS) $(SOLOBS)
ar -rs libhimawari_util.a $(OBJECTS) $(SOLOBS)
AHI: himawari.o himawari_headerinfo.o himawari_readheader.o himawari_utils.o himawari_nav.o himawari_readwrite.o AHI_Example.o libhimawari_util.a solar_util.a
$(F90) -o AHI himawari.o $(F90FLAGS) himawari_headerinfo.o himawari_readheader.o himawari_utils.o himawari_nav.o himawari_readwrite.o AHI_Example.o libhimawari_util.a solar_util.a $(INCDIRS) $(LIBDIRS) $(LINKS) #-DVERBOSE
clean:
rm -f *.a *.o *.mod AHI
.c.o:
$(CC) $(CCFLAGS) $(INCDIRS) -c -o $*.o $<
%.o : %.mod
.f90.o:
$(F90) -o $*.o -c $(F90FLAGS) $(INCDIRS) $<