From 338b9e8f58782dd3db5290d161495212d1b7c317 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Sun, 12 Feb 2017 15:40:31 +0100 Subject: [PATCH] [add] makefile --- src/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/Makefile diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..8a2f913 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,28 @@ +CC ?= gcc +PKGCONFIG = $(shell which pkg-config) +CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0) +LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0) +GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) + +SRC = paperplaneapp.c paperplaneappwin.c main.c +BUILT_SRC = resources.c + +OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o) + +all: paperplaneapp + +resources.c: paperplaneapp.gresource.xml window.ui + $(GLIB_COMPILE_RESOURCES) paperplaneapp.gresource.xml --target=$@ --sourcedir=. --generate-source + +%.o: %.c + $(CC) -c -o $(@F) $(CFLAGS) $< + +paperplaneapp: $(OBJS) + $(CC) -o $(@F) $(OBJS) $(LIBS) + +clean: + rm -f $(BUILT_SRC) + rm -f $(OBJS) + rm -f paperplaneapp + +