# define a list of pkg-config packages we want to use pkg_packages := gtk+-2.0 hildon-1 liblocation hildon-fm-2 # get the necessary flags for compiling PKG_CFLAGS := $(shell pkg-config --cflags $(pkg_packages)) # get the necessary flags for linking PKG_LDFLAGS := $(shell pkg-config --libs $(pkg_packages)) # additional flags # -Wall: warnings # -g: debugging ADD_CFLAGS := -Wall -g # combine the flags (so that CFLAGS/LDFLAGS from the command line # still work). CFLAGS := $(PKG_CFLAGS) $(ADD_CFLAGS) $(CFLAGS) LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS) targets = gps-tracker .PHONY: all all: $(targets) %: %.o $(CC) $^ -o $@ $(LDFLAGS) .PHONY: clean clean: $(RM) $(targets) *.o run: $(targets) run-standalone.sh `pwd`/gps-tracker