aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authornirav <nirav@teisuu.com>2018-09-09 12:13:13 +0530
committerDandelion <nirav@teisuu.com>2018-09-09 12:46:57 +0530
commite54d8327819e310b7b148e45c15fca197be845c7 (patch)
tree04e513d52ed2191364e6b9472cd0f3882a60da4a /Makefile
parent661756c9237a26562cae102f53b12aa0b403fde1 (diff)
downloadim-e54d8327819e310b7b148e45c15fca197be845c7.tar.gz
im-e54d8327819e310b7b148e45c15fca197be845c7.zip
Moved source files to src dir, updated makefile
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