commit b3d3a86132803981e9274212bb94e453b7d93594 parent f0c81fd0a17dc6103c7364e595c52af9b5658911 Author: mbjd <vir.ingens@gmail.com> Date: Sat, 19 Nov 2016 14:42:48 +0100 Makefile changes: - install & uninstall rules - Moved stuff to variables Diffstat:
M | Makefile | | | 15 | +++++++++++++-- |
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,9 +1,20 @@ TARGET = diary +SRC = diary.c +INSTALL_DIR = /usr/local/bin + +CC = gcc +CFLAGS = -lncurses default: $(TARGET) -$(TARGET): - gcc diary.c -o $(TARGET) -lncurses +$(TARGET): $(SRC) + $(CC) $(CFLAGS) $(SRC) -o $(TARGET) clean: rm -f $(TARGET) + +install: $(TARGET) + cp $(TARGET) $(INSTALL_DIR)/$(TARGET) + +uninstall: + rm -f $(INSTALL_DIR)/$(TARGET)