First of all, I know how to write a basic/intermediate level makefile. In my c++ projects I use a makefile that does a lot of stuff automatically. The most important to me is that it automatically detects all source files (which are always in the same folder) using wildcards, uses that to predict the name (and location) of all object files, and compiles appropriately.
Recently I ve been trying to achieve the same effect with my scala projects, but I ve hit two obstacles.
- Copilled class files which belong to packages are stored inside
subdirectories (like
com/me/mypack/
). This is a problem because Make needs to find these files to check the timestamps (and I have no idea how to do that automatically). - Some source files (such as those defining a
package object
) generate class files with different naming standards. Again, Make needs to know where these class files are and I don t know how to do that automatically.
The consequence of this is that the "problematic" source files are
recompiled every time I run make
(which is aggravated by scala s long
compile times). I d like to know how to fix that without having to
manually write out the entire list of expected class files.
EDIT As a extra note: I 想要避免将源文件放在子目录中。我喜欢出于若干原因将源文件都保存在同一目录中。