From 7e3039e76a49c8231627e9e33d76ed8bf043a8d2 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Thu, 2 Mar 2023 23:06:40 -0700 Subject: Improve makefile This renames the targets so they don't conflict after the targets are built. This also adds CCOPTS so compile arguments are centralized. --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3420642..d308a8a 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -all: memleak balloon +CCOPTS = -std=gnu99 -O2 -Wall +all: _memleak _balloon _fdleak clean: rm -vf memleak balloon fdleak -memleak: - cc --std=gnu99 -O2 -Wall src/memleak.c -o memleak +_memleak: + cc $(CCOPTS) src/memleak.c -o memleak -balloon: - cc --std=gnu99 -O2 -Wall src/balloon.c -o balloon +_balloon: + cc $(CCOPTS) src/balloon.c -o balloon -fdleak: - cc --std=gnu99 -O2 -Wall src/fdleak.c -o fdleak +_fdleak: + cc $(CCOPTS) src/fdleak.c -o fdleak -- cgit v1.2.3