Path: utzoo!attcan!uunet!cs.utexas.edu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!physics.utoronto.ca!quinlan From: quinlan@physics.utoronto.ca (Gerald Quinlan) Newsgroups: comp.lang.fortran Subject: Using cpp, m4 for macro substitutions in Fortran. CORRECTION. Message-ID: <1990Jul7.174402.2999@helios.physics.utoronto.ca> Date: 7 Jul 90 21:44:02 GMT Distribution: na Organization: University of Toronto Physics/Astronomy/CITA Lines: 56 Sorry, but there was an error in my last posting. The correct file listings are given below. ----------------------------- Makefile ----------------------------------- # Tell make how to make .f files from .F files. .SUFFIXES: .F .f .F.f: /lib/cpp -P $(CPPFLAGS) $*.F | m4 > $*.f ----------------------------- swap.F ----------------------------------- #ifdef INLINE_SWAP define(CALL_SWAP,`dummy=$1 $1=$2 $2=dummy') #endif program swap a=3.0 b=4.0 #ifdef INLINE_SWAP CALL_SWAP(A,B) #else call swap(a,b) #endif stop end ------------------------ make swap.f ------------------------------------ program swap a=3.0 b=4.0 call swap(a,b) stop end --------------- make "CPPFLAGS=-DINLINE_SWAP" swap.f ------------------------ program swap a=3.0 b=4.0 dummy=A A=B B=dummy stop end -----------------------------------------------------------------------------