Genome control is operated by transcription factors (TFs) controlling their target genes by binding to promoters and enhancers. Conceptually, the interactions between TFs, their binding sites, and their functional targets are represented by gene regulatory networks (GRNs). Deciphering in vivo GRNs underlying organ development in an unbiased genome-wide setting involves identifying both functional TF-gene interactions and physical TF-DNA interactions. To reverse engineer the GRNs of eye development in Drosophila, we performed RNA-seq across 72 genetic perturbations and sorted cell types and inferred a coexpression network. Next, we derived direct TF-DNA interactions using computational motif inference, ultimately connecting 241 TFs to 5,632 direct target genes through 24,926 enhancers. Using this network, we found network motifs, cis-regulatory codes, and regulators of eye development. We validate the predicted target regions of Grainyhead by ChIP-seq and identify this factor as a general cofactor in the eye network, being bound to thousands of nucleosome-free regions.