Skip to content
Snippets Groups Projects
Commit 124e118f authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix makefile

parent ed00ddfb
No related branches found
No related tags found
No related merge requests found
......@@ -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,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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment