Kaynağa Gözat

Alias Directories to prevent name clashes

JDierkse 5 yıl önce
ebeveyn
işleme
c36fa4f1ee
1 değiştirilmiş dosya ile 8 ekleme ve 4 silme
  1. 8 4
      Makefile

+ 8 - 4
Makefile

@@ -38,6 +38,7 @@ SUBDIRS      := $(foreach dir,$(SUBDIRS),$(subst /.,,$(dir)))
 FILTER        = crash% doc% include% lib% Libraries% Makefiles%
 SUBDIRS      := $(filter-out $(FILTER),$(SUBDIRS))
 SUBDIRARS     = $(foreach dir,$(SUBDIRS),$(dir)/$(dir).a)
+SUBDIRS      := $(foreach dir,$(SUBDIRS),$(dir)_DIRECTORY)
 
 LOCALSOURCES  = $(wildcard *.cpp *.cc)
 LOCALOBJECTS := $(LOCALSOURCES:.cpp=.o.$(ARCH))
@@ -192,15 +193,16 @@ $(ARNAME): $(SUBDIRS) $(LOCALOBJECTS)
 
 .PHONY: $(SUBDIRS)
 $(SUBDIRS):
-	@if [ -e "$@/Makefile" ]; then \
+	$(eval DIR := $(subst _DIRECTORY,,$@))
+	@if [ -e "$(DIR)/Makefile" ]; then \
 		depth=$(MAKELEVEL); \
 		while [ $${depth} -gt 0 ] ; do \
 			echo -n " "; \
 			depth=`expr $$depth - 1`; \
 		done; \
 		true; \
-		echo " <$@>"; \
-		if ($(MAKE) -s -S -C $@ artifacts $(ARCH)); then \
+		echo " <$(DIR)>"; \
+		if ($(MAKE) -s -S -C $(DIR) artifacts $(ARCH)); then \
 			:; \
 		else \
 			exit $$?; \
@@ -211,7 +213,7 @@ $(SUBDIRS):
 			depth=`expr $$depth - 1`; \
 		done; \
 		true; \
-		echo " </$@>"; \
+		echo " </$(DIR)>"; \
 	fi
 
 # ---------- Clean Rules ----------
@@ -226,6 +228,7 @@ clean:
 		true; \
 	else \
 		for dir in $(SUBDIRS); do \
+			dir=$${dir%_DIRECTORY}; \
 			if [ -e "$$dir/Makefile" ]; then \
 				depth=$(MAKELEVEL); \
 				while [ $${depth} -gt 0 ] ; do \
@@ -259,6 +262,7 @@ cleandeps:
 		true; \
 	else \
 		for dir in $(SUBDIRS); do \
+			dir=$${dir%_DIRECTORY}; \
 			if [ -e "$$dir/Makefile" ]; then \
 				depth=$(MAKELEVEL); \
 				while [ $${depth} -gt 0 ] ; do \