# define a list of pkg-config packages we want to use pkg_packages := gtk+-2.0 hildon-1 PKG_CFLAGS := $(shell pkg-config --cflags $(pkg_packages)) PKG_LDFLAGS := $(shell pkg-config --libs $(pkg_packages)) ADD_CFLAGS := -Wall -g # combine the flags CFLAGS := $(PKG_CFLAGS) $(ADD_CFLAGS) $(CFLAGS) LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS) targets = hildon_helloworld-1 .PHONY: all all: $(targets) # we can omit the rules and just specify the dependencies # for our simple project this doesn't seem like a big win # but for larger projects where you have multiple object # files, this will save considerable time. hildon_helloworld-1: hildon_helloworld-1.o hildon_helloworld-1.o: hildon_helloworld-1.c .PHONY: clean clean: $(RM) $(targets) *.o