Browse Source

Add basic support for building deps with no Makefile

Loïc Hoguin 12 years ago
parent
commit
89af3bdf67
1 changed files with 11 additions and 1 deletions
  1. 11 1
      erlang.mk

+ 11 - 1
erlang.mk

@@ -12,6 +12,10 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 
+# Project.
+
+PROJECT ?= $(notdir $(CURDIR))
+
 # Verbosity and tweaks.
 # Verbosity and tweaks.
 
 
 V ?= 0
 V ?= 0
@@ -116,7 +120,13 @@ endef
 $(foreach dep,$(DEPS),$(eval $(call dep_target,$(dep))))
 $(foreach dep,$(DEPS),$(eval $(call dep_target,$(dep))))
 
 
 deps: $(ALL_DEPS_DIRS)
 deps: $(ALL_DEPS_DIRS)
-	@for dep in $(ALL_DEPS_DIRS) ; do $(MAKE) -C $$dep; done
+	@for dep in $(ALL_DEPS_DIRS) ; do \
+		if [ -f $$dep/Makefile ] ; then \
+			$(MAKE) -C $$dep ; \
+		else \
+			echo "include $(CURDIR)/erlang.mk" | $(MAKE) -f - -C $$dep ; \
+		fi ; \
+	done
 
 
 clean-deps:
 clean-deps:
 	@for dep in $(ALL_DEPS_DIRS) ; do $(MAKE) -C $$dep clean; done
 	@for dep in $(ALL_DEPS_DIRS) ; do $(MAKE) -C $$dep clean; done