Просмотр исходного кода

bin: Enable static compile targets for more bins

parazyd 2 лет назад
Родитель
Сommit
c423816da5
5 измененных файлов с 25 добавлено и 13 удалено
  1. 1 1
      Makefile
  2. 6 3
      bin/darkirc/Makefile
  3. 6 3
      bin/lilith/Makefile
  4. 6 3
      bin/tau/taud/Makefile
  5. 6 3
      bin/vanityaddr/Makefile

+ 1 - 1
Makefile

@@ -9,7 +9,7 @@ CARGO = cargo +nightly
 # Compile target for system binaries
 # Compile target for system binaries
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
 # Uncomment when doing musl static builds
 # Uncomment when doing musl static builds
-#RUSTFLAGS = "-C target-feature=+crt-static -C link-self-contained=yes"
+#RUSTFLAGS = -C target-feature=+crt-static -C link-self-contained=yes
 
 
 # Binaries to be built
 # Binaries to be built
 BINS = \
 BINS = \

+ 6 - 3
bin/darkirc/Makefile

@@ -6,18 +6,21 @@ PREFIX = $(HOME)/.cargo
 # Cargo binary
 # Cargo binary
 CARGO = cargo +nightly
 CARGO = cargo +nightly
 
 
+# Compile target
+RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
+
 SRC = \
 SRC = \
 	Cargo.toml \
 	Cargo.toml \
 	../../Cargo.toml \
 	../../Cargo.toml \
-	$(shell find src -type f) \
-	$(shell find ../../src -type f) \
+	$(shell find src -type f -name '*.rs') \
+	$(shell find ../../src -type f -name '*.rs') \
 
 
 BIN = ../../darkirc
 BIN = ../../darkirc
 
 
 all: $(BIN)
 all: $(BIN)
 
 
 $(BIN): $(SRC)
 $(BIN): $(SRC)
-	$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package darkirc
+	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package darkirc
 	cp -f ../../target/$(RUST_TARGET)/release/darkirc $@
 	cp -f ../../target/$(RUST_TARGET)/release/darkirc $@
 
 
 android:
 android:

+ 6 - 3
bin/lilith/Makefile

@@ -6,18 +6,21 @@ PREFIX = $(HOME)/.cargo
 # Cargo binary
 # Cargo binary
 CARGO = cargo +nightly
 CARGO = cargo +nightly
 
 
+# Compile target
+RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
+
 SRC = \
 SRC = \
 	Cargo.toml \
 	Cargo.toml \
 	../../Cargo.toml \
 	../../Cargo.toml \
-	$(shell find src -type f) \
-	$(shell find ../../src -type f) \
+	$(shell find src -type f -name '*.rs') \
+	$(shell find ../../src -type f -name '*.rs') \
 
 
 BIN = ../../lilith
 BIN = ../../lilith
 
 
 all: $(BIN)
 all: $(BIN)
 
 
 $(BIN): $(SRC)
 $(BIN): $(SRC)
-	$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package lilith
+	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package lilith
 	cp -f ../../target/$(RUST_TARGET)/release/lilith $@
 	cp -f ../../target/$(RUST_TARGET)/release/lilith $@
 
 
 clean:
 clean:

+ 6 - 3
bin/tau/taud/Makefile

@@ -6,18 +6,21 @@ PREFIX = $(HOME)/.cargo
 # Cargo binary
 # Cargo binary
 CARGO = cargo +nightly
 CARGO = cargo +nightly
 
 
+# Compile target
+RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
+
 SRC = \
 SRC = \
 	Cargo.toml \
 	Cargo.toml \
 	../../../Cargo.toml \
 	../../../Cargo.toml \
-	$(shell find src -type f) \
-	$(shell find ../../../src -type f) \
+	$(shell find src -type f -name '*.rs') \
+	$(shell find ../../../src -type f -name '*.rs') \
 
 
 BIN = ../../../taud
 BIN = ../../../taud
 
 
 all: $(BIN)
 all: $(BIN)
 
 
 $(BIN): $(SRC)
 $(BIN): $(SRC)
-	$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package taud
+	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package taud
 	cp -f ../../../target/$(RUST_TARGET)/release/taud $@
 	cp -f ../../../target/$(RUST_TARGET)/release/taud $@
 
 
 clean:
 clean:

+ 6 - 3
bin/vanityaddr/Makefile

@@ -6,18 +6,21 @@ PREFIX = $(HOME)/.cargo
 # Cargo binary
 # Cargo binary
 CARGO = cargo +nightly
 CARGO = cargo +nightly
 
 
+# Compile target
+RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
+
 SRC = \
 SRC = \
 	Cargo.toml \
 	Cargo.toml \
 	../../Cargo.toml \
 	../../Cargo.toml \
-	$(shell find src -type f) \
-	$(shell find ../../src -type f) \
+	$(shell find src -type f -name '*.rs') \
+	$(shell find ../../src -type f -name '*.rs') \
 
 
 BIN = ../../vanityaddr
 BIN = ../../vanityaddr
 
 
 all: $(BIN)
 all: $(BIN)
 
 
 $(BIN): $(SRC)
 $(BIN): $(SRC)
-	$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package vanityaddr
+	RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package vanityaddr
 	cp -f ../../target/$(RUST_TARGET)/release/vanityaddr $@
 	cp -f ../../target/$(RUST_TARGET)/release/vanityaddr $@
 
 
 clean:
 clean: