Program generation is a useful approach to eliminating abstraction overhead and improving program performance. MacoCaml is a recent implementation in the OCaml compiler that combines a notion of macros with phase separation and quotation based staging for compile-time code generation. However, MacoCaml does not support module functors, a key abstraction mechanism in OCaml. In this work, we present a language design that combines functors and compile-time code generation. We formalize our design as a source calculus which, after compile-time code generation, elaborates to a core calculus that enforces phase separation between modules and structures living in different phases. We establish desirable properties, including syntactic type soundness of the core calculus, elaboration soundness, and phase distinction. We believe this study lays a foundation for guiding the continued exploration and implementation of the OCaml macro system.