ARCH:=$(shell ./config.guess) BASIC_MODES=debug release BASIC_REDISPLAYS=gtk x11 tty BASIC_FLAVORS=mule nomule EXOTIC_FLAVORS=union nounion FLAVORS=$(foreach mode, $(BASIC_MODES), $(addprefix $(mode)/, $(foreach redisplay, $(BASIC_REDISPLAYS), $(addprefix $(redisplay)/, $(foreach basic, $(BASIC_FLAVORS), $(addprefix $(basic)/, $(EXOTIC_FLAVORS))))))) DIRS=$(addprefix $(ARCH)/,$(FLAVORS)) CONFIGS=$(DIRS:=/config.status) BINARIES=$(DIRS:=/bogus) common_args=--site-prefixes=/usr/local union_args=--use-union-type nounion_args=--use-union-type=no debug_args=--debug --error-checking=all release_args=--error-checking=none mule_args=--with-mule nomule_args=--with-mule=no tty_args=--with-x11=no --with-tty x11_args=--with-dragndrop gtk_args=--with-gtk=yes --with-dragndrop .PHONY: $(BINARIES) all: configs $(BINARIES) configs: $(CONFIGS) $(CONFIGS): configure test -d $(@D) || mkdir -p $(@D) cd $(@D) && ../../../../../configure $(common_args) $(foreach flag, $(addsuffix _args, $(subst /, , $(@D))), $($(flag))) $(BINARIES): cd $(@D) && $(MAKE)