CS = gmcs -codepage:utf8
CSFLAGS =

TARGETS = VideoLAN.LibVLC.dll testvlc.exe

all: $(TARGETS)

clean:
	rm -f -- *.netmodule *.dll *.exe *~

VideoLAN.LibVLC.dll: marshal.cs ustring.cs exception.cs libvlc.cs
testvlc.exe: testvlc.cs VideoLAN.LibVLC.dll

%.netmodule: %.cs Makefile
	$(CS) -target:module -out:$@ $(CSFLAGS) $(filter %.cs,$^) \
		$(patsubst %,-addmodule:%,$(filter %.netmodule,$^)) \

%.dll: Makefile
	$(CS) -target:library -out:$@ $(CSFLAGS) $(filter %.cs,$^) \
		$(patsubst %,-addmodule:%,$(filter %.netmodule,$^)) \
		$(patsubst %,-r:%,$(filter %.dll,$^))

%.exe: Makefile
	$(CS) -target:exe -out:$@ $(CSFLAGS) $(filter %.cs,$^) \
		$(patsubst %,-addmodule:%,$(filter %.netmodule,$^)) \
		$(patsubst %,-r:%,$(filter %.dll,$^))

