1 | #makefile to build io_int that does binary i/o |
---|
2 | |
---|
3 | OBJSL = io_int.o |
---|
4 | OBJS = $(OBJSL) |
---|
5 | FFLAGS = $(FCFLAGS) |
---|
6 | LIBS = |
---|
7 | CPP1 = $(CPP) $(TRADFLAG) |
---|
8 | M4 = m4 -Uinclude -Uindex -Ulen |
---|
9 | AR = ar |
---|
10 | |
---|
11 | .SUFFIXES: .F90 .F .f .o .code |
---|
12 | |
---|
13 | all : libwrfio_int.a diffwrf |
---|
14 | |
---|
15 | libwrfio_int.a: $(OBJS) |
---|
16 | /bin/rm -f libwrfio_int.a |
---|
17 | $(AR) cr libwrfio_int.a $(OBJSL) |
---|
18 | $(RANLIB) libwrfio_int.a |
---|
19 | |
---|
20 | io_int.o: io_int.F90 module_internal_header_util.o |
---|
21 | $(CPP1) -I../ioapi_share io_int.F90 | $(M4) - > io_int.f |
---|
22 | $(FC) $(FFLAGS) -I. -I../ioapi_share -o $@ -c io_int.f |
---|
23 | /bin/rm -f intio_tags.h |
---|
24 | |
---|
25 | # this is just so we can get the .mod file, it will be recompiled in frame again as part of WRF frmwk |
---|
26 | module_internal_header_util.o : |
---|
27 | cp ../../frame/module_internal_header_util.F module_internal_header_util.b |
---|
28 | cp ../../inc/intio_tags.h intio_tags.h |
---|
29 | /bin/rm -f module_internal_header_util.f |
---|
30 | $(CPP1) -I../ioapi_share module_internal_header_util.b > module_internal_header_util.f |
---|
31 | $(FC) $(FFLAGS) -I. -o $@ -c module_internal_header_util.f |
---|
32 | /bin/rm -f module_internal_header_util.b |
---|
33 | |
---|
34 | diffwrf: diffwrf.F ../../frame/pack_utils.o ../../frame/module_machine.o ../../frame/module_wrf_error.o \ |
---|
35 | ../../frame/wrf_debug.o libwrfio_int.a $(ESMF_MOD_DEPENDENCE) |
---|
36 | if [ -f ../../frame/pack_utils.o ] ; then \ |
---|
37 | mv diffwrf.F diffwrf.F90 ; \ |
---|
38 | x=`echo "$(FC)" | awk '{print $$1}'` ; export x ; \ |
---|
39 | if [ $$x = "gfortran" ] ; then \ |
---|
40 | echo removing external declaration of iargc for gfortran ; \ |
---|
41 | $(CPP1) -I../ioapi_share diffwrf.F90 | sed '/integer *, *external.*iargc/d' > diffwrf.f ; \ |
---|
42 | else \ |
---|
43 | $(CPP1) -I../ioapi_share diffwrf.F90 > diffwrf.f ; \ |
---|
44 | fi ; \ |
---|
45 | $(FC) -c $(FFLAGS) -I../ioapi_share diffwrf.f ; \ |
---|
46 | mv diffwrf.F90 diffwrf.F ; \ |
---|
47 | $(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) \ |
---|
48 | ../../frame/pack_utils.o ../../frame/module_internal_header_util.o \ |
---|
49 | ../../frame/module_driver_constants.o \ |
---|
50 | ../../frame/module_machine.o ../../frame/wrf_debug.o ../../frame/module_wrf_error.o \ |
---|
51 | $(ESMF_IO_LIB_EXT) ; fi |
---|
52 | |
---|
53 | ../../frame/pack_utils.o ../../frame/internal_header_util.o ../../frame/module_machine.o ../../frame/module_wrf_error.o \ |
---|
54 | ../../frame/wrf_debug.o $(ESMF_MOD_DEPENDENCE) : |
---|
55 | @echo "Diffwrf io_int will be built later on in this compile. No need to rerun compile. " |
---|
56 | |
---|
57 | superclean: |
---|
58 | /bin/rm -f *.f *.o *.obj *.i *.mod libwrfio_int.a diffwrf |
---|