diff --git a/.gitignore b/.gitignore index cba7efc..455ad73 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ a.out +nvimnotes diff --git a/a.out b/a.out deleted file mode 100755 index 0a2f402..0000000 Binary files a/a.out and /dev/null differ diff --git a/makefile b/makefile new file mode 100644 index 0000000..6629a9f --- /dev/null +++ b/makefile @@ -0,0 +1,35 @@ +# Makefile for the Notes Vault project + +# Compiler +CC = gcc + +# Source files +SRC = startup.c + +# Output binary +TARGET = nvimnotes + +# Compiler flags +CFLAGS = -Wall -O2 `pkg-config --cflags libcjson ncurses` + +# Linker flags +LDFLAGS = `pkg-config --libs libcjson ncurses` + +# Debug mode +DEBUG ?= 0 +ifeq ($(DEBUG),1) + CFLAGS += -g +endif + +.PHONY: all clean run + +all: $(TARGET) + +$(TARGET): $(SRC) + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) + +run: $(TARGET) + ./$(TARGET) + +clean: + rm -f $(TARGET)