VERSION=1.0 DESTDIR=/ # 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 CDEBUG=-g # combine the flags (so that CFLAGS/LDFLAGS from the command line # still work). CFLAGS := $(PKG_CFLAGS) $(ADD_CFLAGS) $(CFLAGS) LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS) ifdef DEBUG CFLAGS += $(CDEBUG) LDFLAGS += $(CDEBUG) else CFLAGS += -O2 endif AUX_FILES=Makefile ICON_DIR=$(DESTDIR)`pkg-config osso-af-settings --variable=prefix`/share/icons/hicolor BIN_DIR=$(DESTDIR)`pkg-config osso-af-settings --variable=prefix`/bin DESKTOP_DIR=$(DESTDIR)`pkg-config osso-af-settings --variable=desktopentrydir` DBUS_SERVICE_DIR=$(DESTDIR)`pkg-config osso-af-settings --variable=dbusservicedir` CP_LIB_DIR=$(DESTDIR)`pkg-config hildon-control-panel --variable=pluginlibdir` CP_DESKTOP_DIR=$(DESTDIR)`pkg-config hildon-control-panel --variable=plugindesktopentrydir` MIME_DIR=$(DESTDIR)`pkg-config osso-af-settings --variable=prefix`/share/mime/packages BACKUP_DIR=$(DESTDIR)/etc/osso-backup/applications targets = gps-tracker .PHONY: all all: $(targets) %: %.o $(CC) $^ -o $@ $(LDFLAGS) .PHONY: clean clean: $(RM) $(targets) *.o # for s in 64 40 26;do S=${s}x$s; convert -resize $S gps-tracker-128x128.png gps-tracker-$S.png;done install: mkdir -p $(ICON_DIR)/64x64/hildon/ mkdir -p $(ICON_DIR)/40x40/hildon/ mkdir -p $(ICON_DIR)/26x26/hildon/ mkdir -p $(ICON_DIR)/scalable/hildon/ mkdir -p $(BIN_DIR) mkdir -p $(DESKTOP_DIR) mkdir -p $(DBUS_SERVICE_DIR) mkdir -p $(CP_LIB_DIR) mkdir -p $(CP_DESKTOP_DIR) mkdir -p $(MIME_DIR) mkdir -p $(BACKUP_DIR) cp --target-directory=$(BIN_DIR) $(targets) cp gps-tracker-64x64.png $(ICON_DIR)/64x64/hildon/gps-tracker.png cp gps-tracker-40x40.png $(ICON_DIR)/40x40/hildon/gps-tracker.png cp gps-tracker-26x26.png $(ICON_DIR)/26x26/hildon/gps-tracker.png cp gps-tracker-128x128.png $(ICON_DIR)/scalable/hildon/gps-tracker.png cp gps-tracker.desktop $(DESKTOP_DIR) dist: clean