From e72e24f8f8cd2c235b1a5f48644b051f7ba8ca7b Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 25 Feb 2024 19:24:38 +0200 Subject: [PATCH] Makefile - Added seperate stage to _create_ the `main.o` and then only later link with the intent of making an executable. - This is BETTER because it means we could treat everything in the same way (nevermind a `main` or library) --- scratch/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scratch/Makefile b/scratch/Makefile index 6ccef17..4a38f5f 100644 --- a/scratch/Makefile +++ b/scratch/Makefile @@ -3,7 +3,11 @@ library: clean: rm library.o + rm main.o rm main main: - gcc main.c library.o -o main + gcc -c main.c library.o -o main.o + +exec: + gcc main.o library.o -o main