HOME="/home/nu/nu/" SHELL = /bin/bash nome := $(shell bash ${HOME}/bin/curdir) file := $(shell if [ -f $(nome) ]; then echo "yes"; fi) ifeq ($(file),yes) objects_file := $(nome) else objects_file := endif # bib := $(shell bash ${HOME}/bin/existbib) # ifeq ($(bib),yes) # objects_bib := $(wildcard bib/$(nome)*.bib) # else #objects_bib := $(shell find . -name *.bib | grep -v bibtex) objects_bib := $(shell find -H $$(find . -name 'bib') -type f -name '*.bib' ) # endif objects_html := $(wildcard $(nome)-body*.html)\ $(wildcard $(nome)-head.html)\ $(wildcard $(nome)-pretail.html)\ $(wildcard $(nome)-subtitle.html)\ $(wildcard $(nome)-tail.html)\ $(wildcard $(nome)-title.html)\ $(wildcard $(nome)-use.html)\ $(wildcard *.yaml) objects_pl := $(wildcard $(nome)*.pl) $(wildcard bin/NU/*.pm) objects := $(objects_file) $(objects_bib) $(objects_html) $(objects_pl) $(wildcard next.txt) $(nome).html: $(objects) @if [ -f $(nome) ]; then perl ./$(nome); fi .PHONY: force sub forcesub prova update force: @if [ -f $(nome) ]; then perl ./$(nome); fi sub: @for dir in `ls`; do if [ -d $$dir -a ! -h $$dir ]; then cd $$dir; if [ -f makefile ]; then make sub; fi; cd ..; fi; done @if [ -f makefile ]; then make; fi forcesub: @for dir in `ls`; do if [ -d $$dir -a ! -h $$dir ]; then cd $$dir; if [ -f makefile ]; then make forcesub; fi; cd ..; fi; done @if [ -f makefile ]; then make force; fi prova: @echo "Nome:" @echo $(nome) @echo "Objects:" @echo $(objects) @echo "Directories:" @for dir in `ls`; do if [ -d $$dir -a ! -h $$dir ]; then echo "$$dir"; fi; done