From 10647a01fd42b59f77f8038950a34b0da4e47230 Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 25 Dec 2023 19:00:17 -0700 Subject: [PATCH] GNUmakefile: updated make recipes --- GNUmakefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 0d30e88..e3be6be 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -15,9 +15,12 @@ .PHONY: test PREFIX=/usr/local + CC=cc CFLAGS=-O3 -Lbuild/lib + RUSTC=rustc +RUSTCFLAGS=-C opt-level=z -C codegen-units=1 -C panic=abort -C lto=y -C strip=symbols ifeq ($(CC), gcc) CFLAGS=-O3 -s -Wl,-z,noseparate-code,-z,nosectionheader -flto \ @@ -53,7 +56,7 @@ test: build tests/posix-compat.sh false: src/false.rs build_dir - $(RUSTC) -o build/bin/false src/false.rs + $(RUSTC) $(RUSTCFLAGS) -o build/bin/false src/false.rs intcmp: src/intcmp.c build_dir $(CC) $(CFLAGS) -o build/bin/intcmp src/intcmp.c @@ -67,8 +70,8 @@ str: src/str.c build_dir strcmp: src/strcmp.c build_dir $(CC) $(CFLAGS) -o build/bin/strcmp src/strcmp.c -true: src/true.c build_dir - $(CC) $(CFLAGS) -o build/bin/true src/true.c +true: src/true.rs build_dir + $(RUSTC) $(RUSTCFLAGS) -o build/bin/true src/true.rs libfileis: src/libfileis.c src/libfileis.h build_dir $(CC) $(CFLAGS) -c -fPIC -o build/o/libfileis.o src/libfileis.c