From 4aeba9d13f784c558f688887292bb0945d5d2959 Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 29 Jul 2024 23:04:08 -0600 Subject: [PATCH] Makefile: uses dirname(1) to get normalized prefix, adds libraries to RUSTFLAGS, fixes typo --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 94d0b78..418b564 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,7 @@ DESTDIR ?= dist PREFIX ?= /usr/local # normalized prefix -PREFIX_N != (test -d $(PREFIX) && [ '-' != $(PREFIX) ] \ - && CDPATH= cd -P -- $(PREFIX) && pwd -P) +PREFIX_N != dirname $(PREFIX)/. MANDIR != [ $(PREFIX_N) = / ] && printf '/usr/share/man\n' \ || printf '/share/man\n' SYSEXITS != printf '\043include \n' | cpp -M - | tr ' ' '\n' \ @@ -26,7 +25,7 @@ SYSEXITS != printf '\043include \n' | cpp -M - | tr ' ' '\n' \ CC ?= cc RUSTC ?= rustc -RUSTLIBS = --extern getopt=build/o/libgetopt.rlib \ +RUSTFLAGS += --extern getopt=build/o/libgetopt.rlib \ --extern sysexits=build/o/libsysexits.rlib \ --extern strerror=build/o/libstrerror.rlib CFLAGS += -I$(SYSEXITS) @@ -120,7 +119,7 @@ build/bin/mm: src/mm.rs build rustlibs .PHONY: npc npc: build/bin/npc build/bin/npc: src/npc.c build - $(CC) $(CFLAGAS) -o $@ src/npc.c + $(CC) $(CFLAGS) -o $@ src/npc.c .PHONY: rpn rpn: build/bin/rpn