Compiler directives in a file list?

In reply to dave_59:

What do yo suggest in case i have library cells
e.g.

i have lib.f which have:
-v cell_lib1.v
-v cell_lib2.v

now in each module the .f file includes a reference to this lib.f
e.g.
moduleA.f

moduleA.sv
-f lib.f
+incdir+…

same for moduleB …

and in top level i have top.f
toplevel.sv
-f moduleA.f
-f moduleB.f

now the compiler parse the lib files for every module …
the simple solution was (if ifdef was supported) to add to lib.f something like
ifndef _lib_guard define _lib_guard
-v cell_lib1.v
`endif

what is suggested (beside to build top.f from the basic components) - is there automated flow which can be used?