# Makefile for platform of EMS

PLATDIR = ../plat
BINDIR  = ../bin
PLATMODULELIST = 8ecp aif bicc debug haepub iptrans isdn isup m2ua mgc mgcp mgc_v2 mtp3 pal public rtp sccp scf sip smpp snmp tcap xapp

.PHONY: all $(PLATMODULELIST) clean

# default all
all: $(PLATMODULELIST)

# plat module list
$(PLATMODULELIST):
	@echo "====================== make $@ ======================="
	@cd $(PLATDIR)/$@ && $(MAKE)
	@if [ $@ = "iptrans" ]; then \
		./generate_iptrans; \
		cp -f ./iptrans $(BINDIR); \
	fi
	@cd -

# clean
clean:
	@for mod in $(PLATMODULELIST); do \
		echo "====================== clean $$mod ======================="; \
		cd $(PLATDIR)/$$mod && $(MAKE) clean; \
		cd -; \
	done

