From ee9523989e3bf4279cd4f4f26641b5d2f852f0ec Mon Sep 17 00:00:00 2001 From: Piotr Marendowski Date: Wed, 13 Mar 2024 20:19:22 +0100 Subject: [PATCH] Delete config.def.h and edit Makefile --- Makefile | 11 ++++------- ccc.c | 6 ++---- config.def.h | 0 config.h | 3 +++ 4 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 config.def.h diff --git a/Makefile b/Makefile index 26b7600..5153c07 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,6 @@ SRC = ccc.c util.c file.c LDFLAGS = $(shell pkg-config --libs ncurses) CFLAGS = -march=native -mtune=native -O3 -pipe -O3 -s -std=c99 -W -pedantic $(shell pkg-config --cflags ncurses) -Wall -Wextra # -Werror CC=cc -CONF = config.h -DEFCONF = config.def.h PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin @@ -18,13 +16,10 @@ MANDIR = $(PREFIX)/share/man/man1 .PHONY: all install uninstall clean -all: $(TARGET) - -$(TARGET): $(CONF) $(SRC) +$(TARGET): $(SRC) $(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $@ -$(CONF): - cp -v $(DEFCONF) $(CONF) +all: $(TARGET) install: $(TARGET) mkdir -p $(DESTDIR)$(BINDIR) @@ -40,3 +35,5 @@ uninstall: clean: $(RM) $(TARGET) + +ccc.o: $(CONF) diff --git a/ccc.c b/ccc.c index b2f8bb9..8546ffb 100644 --- a/ccc.c +++ b/ccc.c @@ -10,10 +10,7 @@ #include "file.h" #include "util.h" - -#define ESC 0x1B /* \e or \033 */ -#define PH 1 /* panel height */ -#define JUMP_NUM 14 /* how long ctrl + u/d jump are */ +#include "config.h" typedef struct { WINDOW *window; @@ -93,6 +90,7 @@ int main(int argc, char** argv) } ch = getch(); switch (ch) { + /* quit */ case 'q': endwin(); diff --git a/config.def.h b/config.def.h deleted file mode 100644 index e69de29..0000000 diff --git a/config.h b/config.h index e69de29..28e9164 100644 --- a/config.h +++ b/config.h @@ -0,0 +1,3 @@ +#define ESC 0x1B /* \e or \033 */ +#define PH 1 /* panel height */ +#define JUMP_NUM 14 /* how long ctrl + u/d jump are */