[add] makefile

This commit is contained in:
Julian Sparber
2017-02-12 15:40:31 +01:00
parent 66a2192be7
commit 338b9e8f58

28
src/Makefile Normal file
View File

@@ -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