VALAC = valac

menu-adapter.so : menu-adapter.vala
	$(VALAC) --library $(<:.vala=) --gir Example-1.0.gir --shared-library $@ \
	-H $(<:.vala=.h) --vapi $(<:.vala=.vapi) -X --shared -X -fPIC $< -o $@

menu-button-adapter.so : menu-button-adapter.vala 
	$(VALAC) --library $(<:.vala=) --gir ExampleTwo-1.0.gir --shared-library $@ \
	-H $(<:.vala=.h) --vapidir . --pkg menu-adapter \
	--vapi $(<:.vala=.vapi) -X -I. -X --shared -X -fPIC $< -o $@


Example-1.0.typelib: Example-1.0.gir
	g-ir-compiler \
		--includedir=. \
		--output=$@ \
		$<

ExampleTwo-1.0.typelib: ExampleTwo-1.0.gir
	g-ir-compiler \
		--includedir=. \
		--output=$@ \
		$<

all: menu-adapter.so menu-button-adapter.so Example-1.0.typelib ExampleTwo-1.0.typelib

clean:
	rm -f *.c *.h *.vapi *.gir *.so *.typelib
