INCS = $(shell find . -name \*.inc) PATCHES = $(INCS:.inc=.patch) LIST = $(sort $(notdir $(PATCHES))) PATCH_SELECT = $(firstword $(foreach dir,$(OS)/$(OS_REL) $(OS)/common common,$(wildcard $(dir)/$(patch)))) PATCH_LIST = $(foreach patch,$(LIST),$(PATCH_SELECT)) SCRIPTS = hylafax bt-tr114 bt-tr1034 hylasap TARGETS=$(foreach script,$(SCRIPTS),output/$(OS)/$(OS_REL)/$(script))