program ConditionalCompiling
implicit none
#IFDEF FLAG
inlcude 'file1.f90'
#ELSE
include 'file2.f90'
#ENDIF

WRITE(*,*)X
#IFDEF Flag
 write(*,*)"Compiled with Flag defined"
#ELSE
 write(*,*)"Not Compiled with Flag defined or compiled with Flag not defined"
#ENDIF
end program ConditionalCompiling
