diff options
-rw-r--r-- | Makefile | 36 | ||||
-rw-r--r-- | makefile | 29 | ||||
-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 @@ -1,3 +1,4 @@ +#define _DEFAULT_SOURCE #include "file.h" #include "image.h" #include <dirent.h> @@ -1,6 +1,5 @@ #ifndef __FILE_H #define __FILE_H -#define _DEFAULT_SOURCE char **file_list; char *curr_file_name; |