It was getting more and more tedious to create test programs to debug the various sections of the Dao program, so I updated all of my GNU-Make scripts. Now I can just run the target "make update" which runs the command "ghc -M ..." to update the targets in the Makefile. I no longer rely on "project-files.list". The "ghc-build-opts.mk" file now really does just specify options to the "ghc" command, like it's name has always implied but had never actually served that function. I also create a new "tests/Dao" directory and the test program is now entirely contained in the module "Dao.Test" in the "tests/Dao/Test.hs" file with a function called 'Dao.Test.startAutomatedTesting' replacing the "main" function. The "tests/main.hs" file simply imports "Dao.Tests" and the main function simply calls 'Dao.Test.startAutomatedTesting'. Finally, I deleted the old debugger "Dao.Debug.OFF" because it was screwing with the "ghc -M" command, and I don't use it anymore anyway.
It was getting more and more tedious to create test programs to debug the various sections of the Dao program, so I updated all of my GNU-Make scripts. Now I can just run the target "make update" which runs the command "ghc -M ..." to update the targets in the Makefile. I no longer rely on "project-files.list". The "ghc-build-opts.mk" file now really does just specify options to the "ghc" command, like it's name has always implied but had never actually served that function. I also create a new "tests/Dao" directory and the test program is now entirely contained in the module "Dao.Test" in the "tests/Dao/Test.hs" file with a function called 'Dao.Test.startAutomatedTesting' replacing the "main" function. The "tests/main.hs" file simply imports "Dao.Tests" and the main function simply calls 'Dao.Test.startAutomatedTesting'. Finally, I deleted the old debugger "Dao.Debug.OFF" because it was screwing with the "ghc -M" command, and I don't use it anymore anyway.
I realized that the Makefile rules I had written was calling "ghc --make" once for every single file in the dependency graph, which was taking four or five times longer to compile than a single invocation of "ghc --make" with the exact files necessary. So I tried to modify the Makefile rules to produce a dependency list file then invoke "ghc --make" once with the list of files passed concatenated to the "ghc --make" command's command line arguments. However, due to how "ghc -M" generates the dependency graph in the Makefile, and the nature of GNU Make, this is actually impossible to do in any simple way. The "ghc -M" command does not make dependencies for the "main.hs" program in a way that lets GNU Make deduce the dependencies for "main.hs", so no matter what rules I defined, GNU Make reasoned that there was no work to be done and generated an empty dependency list and the make the build would not proceed. So I just created a hack that sort-of does what I need by creating a list of dependency by simply using the Linux "find" command to look for any file with a ".hs" extension newer than the Makefile itself. It is not precisely what I need, however, as the search is not limited to the dependency graph of the target I want to build, it simply dumps every changed ".hs" file it finds onto the command line.