# default dependencies rules
# include at the end of your dependency file after your dependency declarations
# variables
#	PRODUCT		Name to be used for the product in paths and targets
#	DEPS		Dependencies of this product
#	REVERSE_DEPS	Reverse dependencies: List of products which
#			may additionally depend on this product if enabled
$(PRODUCT)-install: $(DEPS)
$(PRODUCT)-prepare: $(addsuffix -prepare,$(DEPS))

enable-$(PRODUCT): $(addprefix enable-,$(DEPS)) $(addprefix conflict-disable-,$(CONFLICTS))

ifneq (,$(CONFLICTS))
$(addprefix enable-,$(CONFLICTS)): conflict-disable-$(PRODUCT)
endif

ifneq (,$(REVERSE_DEPS))
ifneq (,$(wildcard $(PRODUCTDIR)/$(PRODUCT)/enabled))
$(addsuffix -install,$(REVERSE_DEPS)): $(PRODUCT)
$(addsuffix -prepare,$(REVERSE_DEPS)): $(PRODUCT)-prepare
endif
endif

$(PRODUCT)-%: $(PRODUCTDIR)/$(PRODUCT)/rules
	make -f $< $*

.PHONY: $(PRODUCT)-%

DEPS:=
REVERSE_DEPS:=
CONFLICTS:=
