From 124e118f9f5ad9c2383afb1e9f2d6cbf3edc0fae Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Sun, 26 Aug 2018 12:35:41 -0600 Subject: [PATCH] Fix makefile --- Makefile | 17 +++++++++-------- header.sh => include.sh | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) rename header.sh => include.sh (76%) diff --git a/Makefile b/Makefile index c30f02b7..0f1d15e9 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ SRC=\ src/*/*/* \ src/*/*/*/* -.PHONY: all clean fmt install libc libm test +.PHONY: all clean fmt include install libc libm test all: | libc libm @@ -45,18 +45,19 @@ install: all cp -rv "openlibm/src"/*.h "$(DESTDIR)/include" cp -v "$(BUILD)/openlibm/libopenlibm.a" "$(DESTDIR)/lib/libm.a" -header: - mkdir -p header - ./header.sh - touch header - -libc: $(BUILD)/release/libc.a $(BUILD)/release/crt0.o +libc: $(BUILD)/include $(BUILD)/release/libc.a $(BUILD)/release/crt0.o libm: $(BUILD)/openlibm/libopenlibm.a test: all make -C tests run +$(BUILD)/include: $(SRC) + rm -rf $@ $@.partial + mkdir -p $@.partial + ./include.sh $@.partial + mv $@.partial $@ + $(BUILD)/debug/libc.a: $(SRC) cargo build $(CARGOFLAGS) touch $@ @@ -80,5 +81,5 @@ $(BUILD)/openlibm: openlibm mv $@.partial $@ touch $@ -$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm +$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm $(BUILD)/include make CC=$(CC) CPPFLAGS="-fno-stack-protector -I$(shell pwd)/include -I $(shell pwd)/target/include" -C $< libopenlibm.a diff --git a/header.sh b/include.sh similarity index 76% rename from header.sh rename to include.sh index 2c835809..b9b7cc15 100755 --- a/header.sh +++ b/include.sh @@ -2,7 +2,7 @@ set -ex -header="$(realpath header)" +include="$(realpath "$1")" cbindgen="$(realpath cbindgen)" for config in src/header/*/cbindgen.toml @@ -11,6 +11,6 @@ do name="$(basename "$dir")" pushd "$dir" cargo run --release --manifest-path "$cbindgen/Cargo.toml" -- \ - -c cbindgen.toml -o "$header/$name.h" mod.rs + -c cbindgen.toml -o "$include/$name.h" mod.rs popd done -- GitLab