English 中文(简体)
管理带有 Makefile 的 scala 工程
原标题:Managing a scala project with a Makefile

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 想要避免将源文件放在子目录中。我喜欢出于若干原因将源文件都保存在同一目录中。

最佳回答
问题回答

暂无回答




相关问题
makefile: how to show line numbers for debugging?

Is there a way to have make display the line number where it declares an error? The -d switch doesn t seem to cut it. Updated: Example output: Reaping winning child 0x08aa8648 PID 9381 /bin/sh: ...

What is the reasoning behind the Makefile whitespace syntax?

I m revisiting Python after Michael Sparks s excellent walk through of Peter Norvig s Python spell checker at the SO DevDay in London. One of the points he highlighted was how clean Python is to look ...

Debugging GNU make

Is there a command line way in make to find out which of the prerequisites of a target is not updated?

How to add an all rule to this Makefile?

I want to just type make all and have the following Makefile do everything it s supposed to do: LEX = lex YACC = yacc CC = gcc calcu: y.tab.o lex.yy.o $(CC) -o calcu y.tab.o lex.yy.o -ly -lfl ...

How to discover number of *logical* cores on Mac OS X?

How can you tell, from the command line, how many cores are on the machine when you re running Mac OS X? On Linux, I use: x=$(awk /^processor/ {++n} END {print n+1} /proc/cpuinfo) It s not ...

Using extern in C doesn t work as expected

I have created two files: tunables.h #ifndef TUNABLES_H #define TUNABLES_H void tunables_load_conservative(); void tunables_load_aggressive(); extern int timer_x; #endif /*TUNABLES_H */ and ...

热门标签