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 | @ if echo $(ARCHFLAGS) | $(FGREP) 'DVAR4D'; then \ |
---|
23 | echo COMPILING io_int.F90 for 4DVAR ; \ |
---|
24 | $(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl io_int.f > io_int.f.tmp ; \ |
---|
25 | mv io_int.f.tmp io_int.f ; \ |
---|
26 | fi |
---|
27 | $(FC) $(FFLAGS) -I. -I../ioapi_share -o $@ -c io_int.f |
---|
28 | /bin/rm -f intio_tags.h |
---|
29 | |
---|
30 | # this is just so we can get the .mod file, it will be recompiled in frame again as part of WRF frmwk |
---|
31 | module_internal_header_util.o : |
---|
32 | cp ../../frame/module_internal_header_util.F module_internal_header_util.b |
---|
33 | cp ../../inc/intio_tags.h intio_tags.h |
---|
34 | /bin/rm -f module_internal_header_util.f |
---|
35 | $(CPP1) -I../ioapi_share module_internal_header_util.b > module_internal_header_util.f |
---|
36 | $(FC) $(FFLAGS) -I. -o $@ -c module_internal_header_util.f |
---|
37 | /bin/rm -f module_internal_header_util.b |
---|
38 | |
---|
39 | diffwrf: diffwrf.F ../../frame/pack_utils.o ../../frame/module_machine.o ../../frame/module_wrf_error.o \ |
---|
40 | ../../frame/wrf_debug.o libwrfio_int.a $(ESMF_MOD_DEPENDENCE) |
---|
41 | if [ -f ../../frame/pack_utils.o ] ; then \ |
---|
42 | mv diffwrf.F diffwrf.F90 ; \ |
---|
43 | x=`echo "$(FC)" | awk '{print $$1}'` ; export x ; \ |
---|
44 | if [ $$x = "gfortran" ] ; then \ |
---|
45 | echo removing external declaration of iargc for gfortran ; \ |
---|
46 | $(CPP1) -I../ioapi_share diffwrf.F90 | sed '/integer *, *external.*iargc/d' > diffwrf.f ; \ |
---|
47 | else \ |
---|
48 | $(CPP1) -I../ioapi_share diffwrf.F90 > diffwrf.f ; \ |
---|
49 | fi ; \ |
---|
50 | $(FC) -c $(FFLAGS) -I../ioapi_share diffwrf.f ; \ |
---|
51 | mv diffwrf.F90 diffwrf.F ; \ |
---|
52 | $(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) \ |
---|
53 | ../../frame/pack_utils.o ../../frame/module_internal_header_util.o \ |
---|
54 | ../../frame/module_driver_constants.o \ |
---|
55 | ../../frame/module_machine.o ../../frame/wrf_debug.o ../../frame/module_wrf_error.o \ |
---|
56 | $(ESMF_IO_LIB_EXT) ; fi |
---|
57 | |
---|
58 | ../../frame/pack_utils.o ../../frame/internal_header_util.o ../../frame/module_machine.o ../../frame/module_wrf_error.o \ |
---|
59 | ../../frame/wrf_debug.o $(ESMF_MOD_DEPENDENCE) : |
---|
60 | @echo "Diffwrf io_int will be built later on in this compile. No need to rerun compile. " |
---|
61 | |
---|
62 | superclean: |
---|
63 | /bin/rm -f *.f *.o *.obj *.i *.mod libwrfio_int.a diffwrf |
---|