examples/Makefile: Make more make-like instead of using shell loops
Shell loops broke Travis fairly severely.
This commit is contained in:
		
							parent
							
								
									24ff83fc41
								
							
						
					
					
						commit
						66a1983a95
					
				
					 1 changed files with 15 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -1,28 +1,31 @@
 | 
			
		|||
EXAMPLES = $(shell find $(dir $(lastword $(MAKEFILE_LIST))) -mindepth 2 -name Makefile | sed s/Makefile//g)
 | 
			
		||||
# Generate some dummy .dummybuild/.dummyrebuild target files
 | 
			
		||||
EXAMPLES_BUILD = $(patsubst %,%.dummybuild,$(EXAMPLES))
 | 
			
		||||
EXAMPLES_REBUILD = $(patsubst %,%.dummyrebuild,$(EXAMPLES))
 | 
			
		||||
 | 
			
		||||
warning:
 | 
			
		||||
	@echo "******************************************************"
 | 
			
		||||
	@echo "You may not want this Makefile, even though it's here!"
 | 
			
		||||
	@echo "******************************************************"
 | 
			
		||||
	@echo ""
 | 
			
		||||
	@echo "SUGGESTIONS:"
 | 
			
		||||
	@echo "Running 'make' in one of the subdirectories will build a single example."
 | 
			
		||||
	@echo "Running 'make help' in one of the subdirectories will print some help."
 | 
			
		||||
	@echo "Running 'make' in one of the subdirectories of examples/ will build a single example."
 | 
			
		||||
	@echo "Running 'make help' in one of the subdirectories of examples/ will print some help."
 | 
			
		||||
	@echo ""
 | 
			
		||||
	@echo "OTHERWISE:"
 | 
			
		||||
	@echo "This makefile is for building all of the examples at once, as a developer test."
 | 
			
		||||
	@echo "To use it, run 'make build-examples' or 'make rebuild-examples'"
 | 
			
		||||
	@echo
 | 
			
		||||
 | 
			
		||||
build-examples:
 | 
			
		||||
	set -e
 | 
			
		||||
	for example in `find . -mindepth 2 -name Makefile | sed s/Makefile//)`; do
 | 
			
		||||
	   $(MAKE) -C $$example
 | 
			
		||||
	done
 | 
			
		||||
build-examples: $(EXAMPLES_BUILD)
 | 
			
		||||
 | 
			
		||||
rebuild-examples:
 | 
			
		||||
	set -e
 | 
			
		||||
	for example in `find . -mindepth 2 -name Makefile | sed s/Makefile//)`; do
 | 
			
		||||
	   $(MAKE) -C $$example rebuild
 | 
			
		||||
	done
 | 
			
		||||
rebuild-examples: $(EXAMPLES_REBUILD)
 | 
			
		||||
 | 
			
		||||
%.dummybuild:
 | 
			
		||||
	make -C $(dir $@)
 | 
			
		||||
 | 
			
		||||
%.dummyrebuild:
 | 
			
		||||
	make -C $(dir $@) rebuild
 | 
			
		||||
 | 
			
		||||
.PHONY: warning rebuild-examples build-examples
 | 
			
		||||
.NOTPARALLEL:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue