aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile36
-rw-r--r--makefile29
-rw-r--r--src/file.c (renamed from file.c)1
-rw-r--r--src/file.h (renamed from file.h)1
-rw-r--r--src/image.c (renamed from image.c)0
-rw-r--r--src/image.h (renamed from image.h)0
-rw-r--r--src/input.c (renamed from input.c)0
-rw-r--r--src/input.h (renamed from input.h)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/window.c (renamed from window.c)0
-rw-r--r--src/window.h (renamed from window.h)0
11 files changed, 37 insertions, 30 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
diff --git a/makefile b/makefile
deleted file mode 100644
index f763130..0000000
--- a/makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-RM=rm -f
-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
-BINDIR=$(PREFIX)/bin
-OBJECTS=main.o file.o image.o input.o window.o
-
-all: qwe
-
-qwe: $(OBJECTS)
- $(CC) -o qwe $(OBJECTS) $(LDFLAGS)
-
-.c.o:
- $(CC) -c $(CFLAGS) -o $@ $<
-
-clean:
- $(RM) $(OBJECTS) $(RESOURCES) qwe
-
-install: qwe
- $(INSTALL) -m0755 qwe $(BINDIR)
-
-uninstall:
- $(RM) $(BINDIR)/qwe
-
-run: qwe
- ./qwe
diff --git a/file.c b/src/file.c
index 1ff7f99..dcbcbf0 100644
--- a/file.c
+++ b/src/file.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE
#include "file.h"
#include "image.h"
#include <dirent.h>
diff --git a/file.h b/src/file.h
index fcd4dfd..7e8c167 100644
--- a/file.h
+++ b/src/file.h
@@ -1,6 +1,5 @@
#ifndef __FILE_H
#define __FILE_H
-#define _DEFAULT_SOURCE
char **file_list;
char *curr_file_name;
diff --git a/image.c b/src/image.c
index d4765fd..d4765fd 100644
--- a/image.c
+++ b/src/image.c
diff --git a/image.h b/src/image.h
index dfbd9ff..dfbd9ff 100644
--- a/image.h
+++ b/src/image.h
diff --git a/input.c b/src/input.c
index 1d21ef2..1d21ef2 100644
--- a/input.c
+++ b/src/input.c
diff --git a/input.h b/src/input.h
index ff50b0c..ff50b0c 100644
--- a/input.h
+++ b/src/input.h
diff --git a/main.c b/src/main.c
index b5eb616..b5eb616 100644
--- a/main.c
+++ b/src/main.c
diff --git a/window.c b/src/window.c
index c659114..c659114 100644
--- a/window.c
+++ b/src/window.c
diff --git a/window.h b/src/window.h
index 8b8a7fe..8b8a7fe 100644
--- a/window.h
+++ b/src/window.h