aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3230804
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+CC?=cc
+INSTALL?=install
+
+CFLAGS?=-o2 -pipe -Wall -std=c11 $(shell pkg-config --cflags gtk+-3.0)
+LDFLAGS?=$(shell pkg-config --libs gtk+-3.0)
+PREFIX?=/usr/local
+BINDIR?=$(PREFIX)/bin
+
+SRCDIR=src
+OUTDIR=build
+OBJECTS=\
+ $(OUTDIR)/main.o \
+ $(OUTDIR)/file.o \
+ $(OUTDIR)/image.o \
+ $(OUTDIR)/input.o \
+ $(OUTDIR)/window.o \
+
+all: qwe
+
+qwe: $(OBJECTS)
+ $(CC) -o qwe $(OBJECTS) $(LDFLAGS)
+
+$(OUTDIR)/%.o: $(SRCDIR)/%.c
+ @mkdir -p $(OUTDIR)
+ $(CC) -c $(CFLAGS) -o $@ $<
+
+clean:
+ rm -rf $(OUTDIR) qwe
+
+install: qwe
+ $(INSTALL) -m0755 qwe $(BINDIR)
+
+uninstall:
+ rm -rf $(BINDIR)/qwe
+
+.PHONY: all clean install uninstall