CPPFLAGS += $(shell pkg-config --cflags-only-I gobject-2.0) CFLAGS += $(shell pkg-config --cflags-only-other gobject-2.0) LDFLAGS += $(shell pkg-config --libs gobject-2.0) CFLAGS += -fPIC CFLAGS += -Wall -Wextra -Wno-unused GOBS += foo-bar-baz.gob GENSRC += $(GOBS:.gob=.c) GENSRC += $(GOBS:.gob=.h) GENSRC += $(GOBS:.gob=-private.h) OBJECTS += $(GOBS:.gob=.o) all: libfoo.so foo-1.0.gir test run .PHONY: all run run: test LD_LIBRARY_PATH=$(CURDIR) ./test libfoo.so: $(OBJECTS) foo-1.0.gir: foo-bar-baz.h libfoo.so g-ir-scanner --no-libtool --warn-all -o $@ \ -n Foo $< --include GObject-2.0 -L$(CURDIR) --library foo foo-1.0.vapi: foo-1.0.gir foo-1.0.metadata vapigen --library foo-1.0 $< %.so: $(LINK.c) $^ -shared -o $@ %.c %.h %-private.h: %.gob gob2 $< test: libfoo.so foo-1.0.gir %: %.vala PKG_CONFIG_PATH=$(CURDIR) valac $< \ -X -I$(CURDIR) -X -L$(CURDIR) \ --pkg foo-1.0 --girdir=$(CURDIR) --vapidir=$(CURDIR) %.gir: clean: $(RM) $(GENSRC) $(OBJECTS) libfoo.so foo-1.0.vapi foo-1.0.gir test