From 38ebd914944c9120fb2689591472b8f3303de519 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Tue, 26 Apr 2016 23:58:05 +0200 Subject: [PATCH] add simple Makefile --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..560347b --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CC ?= gcc +PKGCONFIG = $(shell which pkg-config) +CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0 gstreamer-1.0 gstreamer-video-1.0 libgphoto2) +LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0 gstreamer-1.0 gstreamer-video-1.0 libgphoto2) +GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) +GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0) + +SRC = photobooth.c photoboothwin.c focus.c +BUILT_SRC = resources.c + +OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o) + +all: photobooth + +org.schaffenburg.photobooth.gschema.valid: org.schaffenburg.photobooth.gschema.xml + $(GLIB_COMPILE_SCHEMAS) --strict --dry-run --schema-file=$< && mkdir -p $(@D) && touch $@ + +gschemas.compiled: org.schaffenburg.photobooth.gschema.valid + $(GLIB_COMPILE_SCHEMAS) . + +resources.c: photobooth.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=. --generate-dependencies photobooth.gresource.xml) + $(GLIB_COMPILE_RESOURCES) photobooth.gresource.xml --target=$@ --sourcedir=. --generate-source + +%.o: %.c + $(CC) -c -o $(@F) $(CFLAGS) $< + +photobooth: $(OBJS) gschemas.compiled + $(CC) -o $(@F) $(LIBS) $(OBJS) + +clean: + rm -f org.schaffenburg.photobooth.gschema.valid + rm -f gschemas.compiled + rm -f $(BUILT_SRC) + rm -f $(OBJS) + rm -f photobooth