CP=cp
RM=rm

all: IPlugin/IPlugin.dll ../Boare.Lib.Vsq/Boare.Lib.Vsq.dll ../Boare.Lib.Media/Boare.Lib.Media.dll \
    ../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll Background/Background.dll \
    NicoComment/NicoComment.dll VFlip/VFlip.dll ../Boare.Lib.Swf/Boare.Lib.Swf.dll ../bocoree/bocoree.dll
	$(CP) IPlugin/IPlugin.dll LipSync/IPlugin.dll
	$(CP) ../Boare.Lib.Vsq/Boare.Lib.Vsq.dll LipSync/Boare.Lib.Vsq.dll
	$(CP) ../Boare.Lib.Media/Boare.Lib.Media.dll LipSync/Boare.Lib.Media.dll
	$(CP) ../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll LipSync/Boare.Lib.AppUtil.dll
	$(CP) Background/Background.dll LipSync/Background.dll
	$(CP) NicoComment/NicoComment.dll LipSync/NicoComment.dll
	$(CP) VFlip/VFlip.dll LipSync/VFlip.dll
	$(CP) ../Boare.Lib.Swf/Boare.Lib.Swf.dll LipSync/Boare.Lib.Swf.dll
	$(CP) ../bocoree/bocoree.dll LipSync/bocoree.dll
	cd LipSync && $(MAKE) CP=$(CP)

../bocoree/bocoree.dll:
	cd ../bocoree && $(MAKE)

../Boare.Lib.Swf/Boare.Lib.Swf.dll:
	cd ../Boare.Lib.Swf && $(MAKE)

VFlip/VFlip.dll: VFlip/IPlugin.dll
	cd VFlip && $(MAKE)

VFlip/IPlugin.dll: IPlugin/IPlugin.dll
	cp IPlugin/IPlugin.dll VFlip/IPlugin.dll

NicoComment/NicoComment.dll: NicoComment/IPlugin.dll
	cd NicoComment && $(MAKE)

NicoComment/IPlugin.dll: IPlugin/IPlugin.dll
	cp IPlugin/IPlugin.dll NicoComment/IPlugin.dll

Background/Background.dll: Background/IPlugin.dll
	cd Background && $(MAKE)

Background/IPlugin.dll: IPlugin/IPlugin.dll
	cp IPlugin/IPlugin.dll Background/IPlugin.dll

IPlugin/IPlugin.dll:
	cd IPlugin && $(MAKE)

../Boare.Lib.Vsq/Boare.Lib.Vsq.dll:
	cd ../Boare.Lib.Vsq && $(MAKE)

../Boare.Lib.Media/Boare.Lib.Media.dll:
	cd ../Boare.Lib.Media && $(MAKE)

../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll:
	cd ../Boare.Lib.AppUtil && $(MAKE)

clean:
	cd LipSync && $(MAKE) RM=$(RM) clean
	cd IPlugin && $(MAKE) RM=$(RM) clean
	cd ../Boare.Lib.Vsq && $(MAKE) RM=$(RM) clean
	cd ../Boare.Lib.Media && $(MAKE) RM=$(RM) clean
	cd ../Boare.Lib.AppUtil && $(MAKE) RM=$(RM) clean
	cd Background && $(MAKE) RM=$(RM) clean
	cd NicoComment && $(MAKE) RM=$(RM) clean
	cd VFlip && $(MAKE) RM=$(RM) clean
	cd ../Boare.Lib.Swf && $(MAKE) RM=$(RM) clean
	cd ../bocoree && $(MAKE) RM=$(RM) clean
