From 60944e7649d64f8a4487c3698d3e76c56f5037b7 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Mon, 3 Jan 2022 18:47:36 +0300 Subject: [PATCH] Improve Makefile --- Makefile | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3369416..20cc5cc 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,24 @@ -ascii-breakout: ./*.c ./*.h - cc -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wextra -Wpedantic -Werror=implicit-function-declaration ./*.c -o ascii-breakout +CC = cc +CFLAGS = -std=c99 -D_POSIX_C_SOURCE=200809L +WARN = -Wall -Wextra -Wpedantic -Werror=implicit-function-declaration + +PREFIX = /usr/local + +SRC = main.c + +all: ascii-breakout + +ascii-breakout: $(SRC) rogueutil.h + $(CC) $(CFLAGS) $(WARN) -o $@ $(SRC) + +clean: + rm -f ascii-breakout + +install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp ascii-breakout $(DESTDIR)$(PREFIX)/bin + +uninstall: + rm $(DESTDIR)$(PREFIX)/bin/ascii-breakout + +.PHONY: all clean install uninstall -- 2.34.4