From dd3e666c5114f81c9518e9f5ba14959ced079ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 14 Dec 2009 23:04:00 +0100 Subject: Add dependencies Makefile generation to erlc(1) and compile(3) This is useful when a project is built with Makefiles and erlc(1) instead of EMakefiles. Tracking dependencies by hand is error-prone and it becomes painful when using external application headers like EUnit's one. A dependencies Makefile will look like this: module.beam: module.erl \ /usr/local/lib/erlang/lib/eunit-2.1.4/include/eunit.hrl \ header.hrl When included in the main Makefile, 'module' will be recompiled only when needed. GCC offers the same feature and new erlc(1) options are compatible with it. More informations at: http://wiki.github.com/dumbbell/otp/dependencies-makefile --- lib/compiler/test/compile_SUITE_data/simple-basic1.mk | 1 + lib/compiler/test/compile_SUITE_data/simple-basic2.mk | 1 + lib/compiler/test/compile_SUITE_data/simple-missing.mk | 1 + lib/compiler/test/compile_SUITE_data/simple-target1.mk | 1 + lib/compiler/test/compile_SUITE_data/simple-target2.mk | 1 + lib/compiler/test/compile_SUITE_data/simple.erl | 4 ++++ 6 files changed, 9 insertions(+) create mode 100644 lib/compiler/test/compile_SUITE_data/simple-basic1.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-basic2.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-missing.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-target1.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-target2.mk (limited to 'lib/compiler/test/compile_SUITE_data') diff --git a/lib/compiler/test/compile_SUITE_data/simple-basic1.mk b/lib/compiler/test/compile_SUITE_data/simple-basic1.mk new file mode 100644 index 0000000000..4073fa82d0 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-basic1.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl diff --git a/lib/compiler/test/compile_SUITE_data/simple-basic2.mk b/lib/compiler/test/compile_SUITE_data/simple-basic2.mk new file mode 100644 index 0000000000..761d1d9582 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-basic2.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-missing.mk b/lib/compiler/test/compile_SUITE_data/simple-missing.mk new file mode 100644 index 0000000000..b13d44ec36 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-missing.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl generated.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-target1.mk b/lib/compiler/test/compile_SUITE_data/simple-target1.mk new file mode 100644 index 0000000000..dd9fa0d6e5 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-target1.mk @@ -0,0 +1 @@ +$target: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-target2.mk b/lib/compiler/test/compile_SUITE_data/simple-target2.mk new file mode 100644 index 0000000000..a5fc6f461d --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-target2.mk @@ -0,0 +1 @@ +$$target: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple.erl b/lib/compiler/test/compile_SUITE_data/simple.erl index 2021056388..8e98852417 100644 --- a/lib/compiler/test/compile_SUITE_data/simple.erl +++ b/lib/compiler/test/compile_SUITE_data/simple.erl @@ -37,3 +37,7 @@ foo() -> {?included_value, ?foo_value}. -endif. + +-ifdef(include_generated). +-include("generated.hrl"). +-endif. -- cgit v1.2.3