##############################################################################
#
# Foreign package building rules
#

# Clear ALLTARGETS
ALLTARGETS = 

ifneq (,$(COMMAND1))
ALLTARGETS := $(ALLTARGETS) $(TARGET)_COMMAND1_RULE
ifeq (,$(DIR1))
DIR1 = .
endif
$(TARGET)_COMMAND1_RULE:
	@ echo "**** executing subcommand '$(COMMAND1)'"
	@ cd $(STARTDIR)/$(DIR1) ; $(COMMAND1)
.PHONY: $(TARGET)_COMMAND1_RULE
endif

ifneq (,$(COMMAND2))
ALLTARGETS := $(ALLTARGETS) $(TARGET)_COMMAND2_RULE
ifeq (,$(DIR2))
DIR2 = .
endif
$(TARGET)_COMMAND2_RULE:
	@ echo "**** executing subcommand '$(COMMAND2)'"
	@ cd $(STARTDIR)/$(DIR2) ; $(COMMAND2)
.PHONY: $(TARGET)_COMMAND2_RULE
endif

ifneq (,$(COMMAND3))
ALLTARGETS := $(ALLTARGETS) $(TARGET)_COMMAND3_RULE
ifeq (,$(DIR3))
DIR3 = .
endif
$(TARGET)_COMMAND3_RULE:
	@ echo "**** executing subcommand '$(COMMAND3)'"
	@ cd $(STARTDIR)/$(DIR3) ; $(COMMAND3)
.PHONY: $(TARGET)_COMMAND3_RULE
endif

ifneq (,$(COMMAND4))
ALLTARGETS := $(ALLTARGETS) $(TARGET)_COMMAND4_RULE
ifeq (,$(DIR4))
DIR4 = .
endif
$(TARGET)_COMMAND4_RULE:
	@ echo "**** executing subcommand '$(COMMAND4)'"
	@ cd $(STARTDIR)/$(DIR4) ; $(COMMAND4)
.PHONY: $(TARGET)_COMMAND4_RULE
endif

ifneq (,$(COMMAND5))
ALLTARGETS := $(ALLTARGETS) $(TARGET)_COMMAND5_RULE
ifeq (,$(DIR5))
DIR5 = .
endif
$(TARGET)_COMMAND5_RULE:
	@ echo "**** executing subcommand '$(COMMAND5)'"
	@ cd $(STARTDIR)/$(DIR5) ; $(COMMAND5)
.PHONY: $(TARGET)_COMMAND5_RULE
endif

# now if there's anything to do, do it
ifneq (,$(ALLTARGETS))
$(TARGET): $(ALLTARGETS)
endif

clean::

cleanall: clean

list:
	@ echo $(TARGET)
