libs := libusb-1.0 libpng16 gtk+-3.0 CFLAGS := -O3 -g -Wall \ -flax-vector-conversions \ $(shell pkg-config $(libs) --cflags) CPPFLAGS := -MMD LDLIBS := $(shell pkg-config $(libs) --libs) GLIB_COMPILE_RESOURCES = \ $(shell pkg-config --variable=glib_compile_resources gio-2.0) SOURCES := \ cli.c \ device.c \ image.c \ gui_app.c \ gui_app_window.c \ gui_resources.c \ main.c \ moticam.c \ options.c \ usb_source.c \ utils.c all: camicro gui_resources.c: gui_app.gresource.xml window.ui $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=. --generate-source camicro: $(SOURCES:%.c=%.o) $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ clean: rm -f camicro $(SOURCES:%.c=%.o) $(SOURCES:%.c=%.d) gui_resources.c -include $(SOURCES:%.c=%.d)