Fix makefile

This commit is contained in:
Jeremy Soller
2018-08-26 12:35:41 -06:00
parent ed00ddfb54
commit 124e118f9f
2 changed files with 11 additions and 10 deletions
+9 -8
View File
@@ -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
+2 -2
View File
@@ -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