Commit 7f29c468 authored by Dean Camera's avatar Dean Camera
Browse files

Slightly better method of recursive make - use proper make dependencies to...

Slightly better method of recursive make - use proper make dependencies to allow for parallel builds.
parent fafb5211
...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,11 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,11 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,23 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
...@@ -22,10 +22,24 @@ ifeq ($(MAKELEVEL), 10) ...@@ -22,10 +22,24 @@ ifeq ($(MAKELEVEL), 10)
$(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
endif endif
all: # If building without a per-project object directory, we can't build in parallel
ifeq ($(OBJDIR),) ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) .NOTPARALLEL:
# Ensure projects are pre-cleaned if the target is the default or "all"
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
endif
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
endif
endif endif
%: %: $(PROJECT_DIRECTORIES)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) @echo . > /dev/null
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment