SUBDIRS	=  @SQL_MODULES@

.PHONY: all clean
all:
	$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common

clean:
	$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
	@rm -rf lib

install:
	$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common

reconfig:
	$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common

.PHONY: common $(SUBDIRS)

common: $(SUBDIRS)
	@[ -d lib/ ] || mkdir lib

$(SUBDIRS):
	@echo "Making $(WHAT_TO_MAKE) in $@."
	@$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE)
