Răsfoiți Sursa

Add Makefile (WIP)

Jeremy Soller 7 ani în urmă
părinte
comite
d9e4622f83
2 a modificat fișierele cu 25 adăugiri și 4 ștergeri
  1. 24 0
      Makefile
  2. 1 4
      test.sh

+ 24 - 0
Makefile

@@ -0,0 +1,24 @@
+.PHONY: all clean fmt test
+
+all: openlibm/libopenlibm.a target/debug/libc.a target/debug/libcrt0.a
+	cargo build
+
+clean:
+	cargo clean
+	make -C openlibm clean
+	make -C tests clean
+
+fmt:
+	./fmt.sh
+
+test: openlibm/libopenlibm.a
+	make -C tests run
+
+target/debug/libc.a:
+	cargo build
+
+target/debug/libcrt0.a:
+	cargo build --manifest-path src/crt0/Cargo.toml
+
+openlibm/libopenlibm.a:
+	CFLAGS=-fno-stack-protector make -C openlibm libopenlibm.a

+ 1 - 4
test.sh

@@ -1,10 +1,7 @@
 #!/bin/bash
 set -ex
 
-cargo build
-cargo build --manifest-path src/crt0/Cargo.toml
-
-CFLAGS=-fno-stack-protector make -C openlibm
+make
 
 make -C tests clean
 make -C tests run