From a1b29bb6ed91bf43d49389bf97b5d6861d5d2a2a Mon Sep 17 00:00:00 2001 From: DTB Date: Tue, 16 Jan 2024 00:06:48 -0700 Subject: [PATCH] Makefile: fix PHONYness of existing recipes and make non-PHONY recipes --- Makefile | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index b47084e..083e262 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Copyright (c) 2023–2024 Emma Tebibyte -# Copyright (c) 2023 DTB +# Copyright (c) 2023–2024 DTB # Copyright (c) 2023 Sasha Koshka # SPDX-License-Identifier: FSFAP # @@ -60,27 +60,43 @@ libgetopt: src/getopt-rs/lib.rs $(RUSTC) $(RUSTCFLAGS) --crate-type=lib --crate-name=getopt \ -o build/o/libgetopt.rlib src/getopt-rs/lib.rs -dj: src/dj.c build - $(CC) $(CFLAGS) -o build/bin/dj src/dj.c +.PHONY: dj +dj: build/bin/dj +build/bin/dj: src/dj.c build + $(CC) $(CFLAGS) -o $@ src/dj.c -false: src/false.c build - $(CC) $(CFLAGS) -o build/bin/false src/false.c +.PHONY: false +false: build/bin/false +build/bin/false: src/false.c build + $(CC) $(CFLAGS) -o $@ src/false.c -fop: src/fop.rs build libgetopt sysexits +.PHONY: fop +fop: build/bin/fop +build/bin/fop: src/fop.rs build libgetopt sysexits $(RUSTC) $(RUSTFLAGS) --extern getopt=build/o/libgetopt.rlib \ - -o build/bin/fop src/fop.rs + -o $@ src/fop.rs -intcmp: src/intcmp.c build - $(CC) $(CFLAGS) -o build/bin/intcmp src/intcmp.c +.PHONY: intcmp +intcmp: build/bin/intcmp +build/bin/intcmp: src/intcmp.c build + $(CC) $(CFLAGS) -o $@ src/intcmp.c -scrut: src/scrut.c build - $(CC) $(CFLAGS) -o build/bin/scrut src/scrut.c +.PHONY: scrut +scrut: build/bin/scrut +build/bin/scrut: src/scrut.c build + $(CC) $(CFLAGS) -o $@ src/scrut.c -str: src/str.c build - $(CC) $(CFLAGS) -o build/bin/str src/str.c +.PHONY: str +str: build/bin/str +build/bin/str: src/str.c build + $(CC) $(CFLAGS) -o $@ src/str.c -strcmp: src/strcmp.c build - $(CC) $(CFLAGS) -o build/bin/strcmp src/strcmp.c +.PHONY: strcmp +strcmp: build/bin/strcmp +build/bin/strcmp: src/strcmp.c build + $(CC) $(CFLAGS) -o $@ src/strcmp.c -true: src/true.c build - $(CC) $(CFLAGS) -o build/bin/true src/true.c +.PHONY: true +true: build/bin/true +build/bin/true: src/true.c build + $(CC) $(CFLAGS) -o $@ src/true.c