2638 |
-rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template |
-rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template |
2639 |
-rm -rf *.o |
-rm -rf *.o |
2640 |
-rm -rf *.$FS *.flowdir |
-rm -rf *.$FS *.flowdir |
2641 |
-rm -rf *.f$FS90 *_mod.h *_mod.F90 *.FF90 *.mod-whirl ad_input* |
-rm -rf *.f$FS90 \$(AD_CLEAN) ad_input* |
|
-rm -rf temp.sed |
|
2642 |
Clean: |
Clean: |
2643 |
@make clean |
@make clean |
2644 |
@make cleanlinks |
@make cleanlinks |
2783 |
-rm -f ad_config.template |
-rm -f ad_config.template |
2784 |
@make \$(F77_PP_SRC_FILES) |
@make \$(F77_PP_SRC_FILES) |
2785 |
@make \$(FLOFILES) |
@make \$(FLOFILES) |
2786 |
cat \$(FLOFILES) \$(AD_FILES) > ad_input_code.$FS |
cat \$(FLOFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS |
2787 |
|
|
2788 |
ad_taf_output.$FS: ad_input_code.$FS |
ad_taf_output.$FS: ad_input_code.$FS |
2789 |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
\$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS |
2967 |
f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1 |
f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1 |
2968 |
f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1 |
f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1 |
2969 |
|
|
2970 |
AD_OBJ_FILES=\$(OPENAD_SUPPORT_F90_SRC_FILES:.F90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o) all_mods.xb.x2w.w2f.pp.o ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.o \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o) |
# the file included below is created by the |
2971 |
|
# postProcessor and its inclusion sets the |
2972 |
|
# variable POSTPROCESSEDFILES |
2973 |
|
# used below. Because the file is made during |
2974 |
|
# make it won't be read until the second (recursive) |
2975 |
|
# invocation in the rule below |
2976 |
|
-include postProcess.make |
2977 |
|
|
2978 |
|
AD_OBJ_FILES_S1=\$(OPENAD_SUPPORT_F90_SRC_FILES:.F90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o) \$(POSTPROCESSEDFILES:.f$FS90=.o) |
2979 |
|
|
2980 |
|
AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o) |
2981 |
|
|
2982 |
|
postProcess.comp: \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) postProcess.tag \$(AD_OBJ_FILES_S1) |
2983 |
|
ifeq (\$(MAKELEVEL),0) |
2984 |
|
\$(MAKE) adAll |
2985 |
|
else |
2986 |
|
touch \$@ |
2987 |
|
endif |
2988 |
|
|
2989 |
\$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(AD_OBJ_FILES) |
\$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) postProcess.comp \$(AD_OBJ_FILES_S2) |
2990 |
@echo Creating \$@ ... |
ifeq (\$(MAKELEVEL),1) |
2991 |
\$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES) \$(LIBS) |
\$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS) |
2992 |
|
else |
2993 |
|
touch \$@ |
2994 |
|
endif |
2995 |
|
|
2996 |
# makefile debug rule |
# makefile debug rule |
2997 |
openad: ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
openad: ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
3021 |
@./\$(EXE_AD) > \$@ |
@./\$(EXE_AD) > \$@ |
3022 |
|
|
3023 |
CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90) |
CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90) |
3024 |
ad_input_code.f$FS90: ../OAD_support/maxMinDefs.f \$(CB2M_AD_FILES) |
ad_input_code.f$FS90: \$(CB2M_AD_FILES) |
3025 |
cat \$^ > \$@ |
cat \$^ > \$@ |
3026 |
|
|
3027 |
# strip all comments and blanks to reduce |
# strip all comments and blanks to reduce |
3041 |
|
|
3042 |
# canonicalizer |
# canonicalizer |
3043 |
ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py |
ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py |
3044 |
./preProcess.py -H -S \$< -o \$@ |
./preProcess.py --timing -H -S \$< -o \$@ |
3045 |
|
|
3046 |
# F -> WHIRL |
# F -> WHIRL |
3047 |
# note that the canonicalized version cuts off at col 72 |
# note that the canonicalized version cuts off at col 72 |
3063 |
|
|
3064 |
# XAIF' -> WHIRL' |
# XAIF' -> WHIRL' |
3065 |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
3066 |
./xaif2whirl --debug 1 --structured ad_input_code_sf.w2f.pre.B \$< |
./xaif2whirl --debug 1 ad_input_code_sf.w2f.pre.B \$< |
3067 |
|
|
3068 |
# WHIRL' -> F' |
# WHIRL' -> F' |
3069 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be |
3075 |
|
|
3076 |
PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F |
PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F |
3077 |
# postprocess F' |
# postprocess F' |
3078 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f) |
postProcess.tag: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f) |
3079 |
./postProcess.py -m r -i ../OAD_support/ad_inline.f -o \$@ \$< |
# the target is a placeholder to signal execution of the rule |
3080 |
|
touch \$@ |
3081 |
# extract all transformed modules |
# this step also creates the file postProcess.make but we cannot |
3082 |
all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
# name it as the target or else make will try to remake it for |
3083 |
cat \$< | sed -n '/MODULE /,/END MODULE/p' > \$@ |
# the include directive above for any rule, e.g. make clean |
3084 |
|
./postProcess.py --progress --timing --outputFormat=fixed -m r -i ../OAD_support/ad_inline.f --width 4 \$< |
|
# remove the transformed globals module from the |
|
|
# transformed ad_input_code file |
|
|
# and remove for now the duplicate variables |
|
|
# and fix 2 data statements |
|
|
ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
|
|
cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^ INTEGER(w2f__i4) DOLOOP_UB/d' > \$@ |
|
3085 |
|
|
3086 |
# setup some links |
# setup some links |
3087 |
%.xsd: |
%.xsd: |
3106 |
oadDriver: |
oadDriver: |
3107 |
\$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver \$@ |
\$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver \$@ |
3108 |
|
|
3109 |
|
AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.make postProcess.tag postProcess.comp \$(PPEXTRAS:.F=.f) |
3110 |
|
|
3111 |
# ============ end OpenAD specific section ============== |
# ============ end OpenAD specific section ============== |
3112 |
|
|
3113 |
EOF |
EOF |