# That file may be redistributed under one of those licence: MPL/GPL/LGPL
#
# That Makefile is only used if you need to compile xpidl files into .xpt
# when running make, idl files present in idl/ directory will be compiled and
# linked to components/$APPNAME.xpt
#
# XXX: you may need to modify sdk path

PROJECT=$APPNAME

GECKO_SDK_PATH = /usr/lib/xulrunner/sdk/
XPIDL=$(GECKO_SDK_PATH)/bin/xpidl
XPTLINK=$(GECKO_SDK_PATH)/bin/xpt_link
IDLDIR=$(GECKO_SDK_PATH)/idl

ifeq (,$(wildcard idl/*.idl))
all:
else
all: components/$(PROJECT).xpt
endif

components/$(PROJECT).xpt: $(patsubst %.idl, %.xpt, $(wildcard idl/*.idl))
	$(XPTLINK) $@ $^

idl/%.xpt: idl/%.idl
	$(XPIDL) -a -w -v -m typelib -I $(@D) -I $(IDLDIR) -e $@  $<

clean:
	rm -f idl/*xpt
	rm -f components/$(PROJECT).xpt

