Makefile: uses dirname(1) to get normalized prefix, adds libraries to RUSTFLAGS, fixes typo
This commit is contained in:
parent
6a5739ea9d
commit
4aeba9d13f
7
Makefile
7
Makefile
@ -17,8 +17,7 @@ DESTDIR ?= dist
|
|||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
# normalized prefix
|
# normalized prefix
|
||||||
PREFIX_N != (test -d $(PREFIX) && [ '-' != $(PREFIX) ] \
|
PREFIX_N != dirname $(PREFIX)/.
|
||||||
&& CDPATH= cd -P -- $(PREFIX) && pwd -P)
|
|
||||||
MANDIR != [ $(PREFIX_N) = / ] && printf '/usr/share/man\n' \
|
MANDIR != [ $(PREFIX_N) = / ] && printf '/usr/share/man\n' \
|
||||||
|| printf '/share/man\n'
|
|| printf '/share/man\n'
|
||||||
SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | tr ' ' '\n' \
|
SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | tr ' ' '\n' \
|
||||||
@ -26,7 +25,7 @@ SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | tr ' ' '\n' \
|
|||||||
|
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
RUSTC ?= rustc
|
RUSTC ?= rustc
|
||||||
RUSTLIBS = --extern getopt=build/o/libgetopt.rlib \
|
RUSTFLAGS += --extern getopt=build/o/libgetopt.rlib \
|
||||||
--extern sysexits=build/o/libsysexits.rlib \
|
--extern sysexits=build/o/libsysexits.rlib \
|
||||||
--extern strerror=build/o/libstrerror.rlib
|
--extern strerror=build/o/libstrerror.rlib
|
||||||
CFLAGS += -I$(SYSEXITS)
|
CFLAGS += -I$(SYSEXITS)
|
||||||
@ -120,7 +119,7 @@ build/bin/mm: src/mm.rs build rustlibs
|
|||||||
.PHONY: npc
|
.PHONY: npc
|
||||||
npc: build/bin/npc
|
npc: build/bin/npc
|
||||||
build/bin/npc: src/npc.c build
|
build/bin/npc: src/npc.c build
|
||||||
$(CC) $(CFLAGAS) -o $@ src/npc.c
|
$(CC) $(CFLAGS) -o $@ src/npc.c
|
||||||
|
|
||||||
.PHONY: rpn
|
.PHONY: rpn
|
||||||
rpn: build/bin/rpn
|
rpn: build/bin/rpn
|
||||||
|
Loading…
Reference in New Issue
Block a user