66 docker build \
77 -t $(REPOSITORY ) /rust-linux-darwin-builder:$(TAG ) \
88 --network=host \
9- -f Dockerfile .
9+ -f docker/amd64/ Dockerfile .
1010.PHONY : build
1111
1212# Use to build both arm64 and amd64 images at the same time.
@@ -50,21 +50,23 @@ test-app:
5050 @echo
5151 @cd tests/hello-world \
5252\
53+ && echo "Compiling application (linux-gnu x86_64)..." \
54+ && cargo build --release --target x86_64-unknown-linux-gnu \
5355 && if [ "$$(uname -m)" = "x86_64" ]; then \
54- echo "Compiling application (linux-gnu x86_64)..."; \
55- cargo build --release --target x86_64-unknown-linux-gnu; \
5656 target/x86_64-unknown-linux-gnu/release/hello-world-test; \
57- du -sh target/x86_64-unknown-linux-gnu/release/hello-world-test; \
58- file target/x86_64-unknown-linux-gnu/release/hello-world-test; \
59- echo; \
57+ fi \
58+ && du -sh target/x86_64-unknown-linux-gnu/release/hello-world-test \
59+ && file target/x86_64-unknown-linux-gnu/release/hello-world-test \
60+ && echo \
6061\
61- echo "Compiling application (linux-musl x86_64)..."; \
62- cargo build --release --target x86_64-unknown-linux-musl; \
62+ && echo "Compiling application (linux-musl x86_64)..." \
63+ && cargo build --release --target x86_64-unknown-linux-musl \
64+ && if [ "$$(uname -m)" = "x86_64" ]; then \
6365 target/x86_64-unknown-linux-musl/release/hello-world-test; \
64- du -sh target/x86_64-unknown-linux-musl/release/hello-world-test; \
65- file target/x86_64-unknown-linux-musl/release/hello-world-test; \
66- echo; \
6766 fi \
67+ && du -sh target/x86_64-unknown-linux-musl/release/hello-world-test \
68+ && file target/x86_64-unknown-linux-musl/release/hello-world-test \
69+ && echo \
6870\
6971 && echo "Cross-compiling application (apple-darwin x86_64)..." \
7072 && cargo build --release --target x86_64-apple-darwin \
@@ -94,6 +96,7 @@ test-app:
9496 && cargo build --release --target aarch64-apple-darwin \
9597 && du -sh target/aarch64-apple-darwin/release/hello-world-test \
9698 && file target/aarch64-apple-darwin/release/hello-world-test
99+ && echo
97100.ONESHELL : test-app
98101
99102test-zlib :
@@ -105,30 +108,34 @@ test-zlib:
105108 @echo
106109 @cd tests/zlib \
107110\
108- && if [ "$$(uname -m)" = " x86_64" ]; then \
109- echo "Compiling application (linux-gnu x86_64)..."; \
110- cargo build --release --target x86_64-unknown-linux-gnu; \
111+ && echo "Compiling application (linux-gnu x86_64)..." \
112+ && cargo build --release --target x86_64-unknown-linux-gnu \
113+ && if [ "$$(uname -m)" = " x86_64" ]; then
111114 target/x86_64-unknown-linux-gnu/release/zlib-test; \
112- du -sh target/x86_64-unknown-linux-gnu/release/zlib-test; \
113- file target/x86_64-unknown-linux-gnu/release/zlib-test; \
114- echo; \
115+ fi \
116+ && du -sh target/x86_64-unknown-linux-gnu/release/zlib-test \
117+ && file target/x86_64-unknown-linux-gnu/release/zlib-test \
118+ && echo \
115119\
116- echo "Compiling application (linux-musl x86_64)..."; \
117- cargo build --release --target x86_64-unknown-linux-musl; \
120+ && echo "Compiling application (linux-musl x86_64)..." \
121+ && cargo build --release --target x86_64-unknown-linux-musl \
122+ && if [ "$$(uname -m)" = "x86_64" ]; then
118123 target/x86_64-unknown-linux-musl/release/zlib-test; \
119- du -sh target/x86_64-unknown-linux-musl/release/zlib-test; \
120- file target/x86_64-unknown-linux-musl/release/zlib-test; \
121- echo; \
122124 fi \
125+ && du -sh target/x86_64-unknown-linux-musl/release/zlib-test \
126+ && file target/x86_64-unknown-linux-musl/release/zlib-test \
127+ && echo \
123128\
124129 && echo "Cross-compiling application (apple-darwin x86_64)..." \
125- && LIBZ_SYS_STATIC=1 CC=o64-clang CXX=o64-clang++ \
130+ && CC=o64-clang CXX=o64-clang++ \
126131 cargo build --release --target x86_64-apple-darwin \
127132 && du -sh target/x86_64-apple-darwin/release/zlib-test \
128133 && file target/x86_64-apple-darwin/release/zlib-test \
134+ && echo \
129135\
130136 && echo "Cross-compiling application (linux-gnu aarch64)..." \
131- && CC=aarch64-linux-gnu-gcc cargo build --release --target aarch64-unknown-linux-gnu \
137+ && CC=aarch64-linux-gnu-gcc \
138+ cargo build --release --target aarch64-unknown-linux-gnu \
132139 && if [ "$$(uname -m)" = "aarch64" ]; then \
133140 target/aarch64-unknown-linux-gnu/release/zlib-test; \
134141 fi \
@@ -146,7 +153,7 @@ test-zlib:
146153 && echo \
147154\
148155 && echo "Cross-compiling application (apple-darwin aarch64)..." \
149- && LIBZ_SYS_STATIC=1 CC=oa64-clang CXX=oa64-clang++ \
156+ && CC=oa64-clang CXX=oa64-clang++ \
150157 cargo build --release --target aarch64-apple-darwin \
151158 && du -sh target/aarch64-apple-darwin/release/zlib-test \
152159 && file target/aarch64-apple-darwin/release/zlib-test
@@ -162,34 +169,49 @@ test-openssl:
162169 @echo
163170 @cd tests/openssl \
164171\
172+ && echo "Compiling application (linux-gnu x86_64)..." \
173+ && cargo build --release --target x86_64-unknown-linux-gnu \
165174 && if [ "$$(uname -m)" = "x86_64" ]; then \
166- echo "Compiling application (linux-gnu x86_64)..."; \
167- cargo build --release --target x86_64-unknown-linux-gnu; \
168175 target/x86_64-unknown-linux-gnu/release/openssl; \
169- du -sh target/x86_64-unknown-linux-gnu/release/openssl; \
170- file target/x86_64-unknown-linux-gnu/release/openssl; \
171- echo; \
176+ fi \
177+ && du -sh target/x86_64-unknown-linux-gnu/release/openssl \
178+ && file target/x86_64-unknown-linux-gnu/release/openssl \
179+ && echo \
172180\
173- echo "Compiling application (linux-musl x86_64)..."; \
174- OPENSSL_STATIC=1 \
175- cargo build --release --target x86_64-unknown-linux-musl; \
181+ && echo "Cross-compiling application (linux-gnu aarch64)..." \
182+ && CC=aarch64-linux-gnu-gcc \
183+ cargo build --release --target aarch64-unknown-linux-gnu \
184+ && if [ "$$(uname -m)" = "aarch64" ]; then \
185+ target/aarch64-unknown-linux-gnu/release/openssl; \
186+ fi \
187+ && du -sh target/aarch64-unknown-linux-gnu/release/openssl \
188+ && file target/aarch64-unknown-linux-gnu/release/openssl \
189+ && echo \
190+ \
191+ && echo "Compiling application (linux-musl x86_64)..." \
192+ && OPENSSL_STATIC=1 \
193+ cargo build --release --target x86_64-unknown-linux-musl \
194+ && if [ "$$(uname -m)" = "x86_64" ]; then \
176195 target/x86_64-unknown-linux-musl/release/openssl; \
177- du -sh target/x86_64-unknown-linux-musl/release/openssl; \
178- file target/x86_64-unknown-linux-musl/release/openssl; \
179- echo; \
180196 fi \
197+ && du -sh target/x86_64-unknown-linux-musl/release/openssl \
198+ && file target/x86_64-unknown-linux-musl/release/openssl \
199+ && echo \
181200\
182201 && echo "Cross-compiling application (apple-darwin x86_64)..." \
183202 && OPENSSL_STATIC=1 \
184203 CC=o64-clang CXX=o64-clang++ \
185- cargo build --release --target x86_64-apple-darwin \
204+ cargo build --release --target x86_64-apple-darwin \
186205 && du -sh target/x86_64-apple-darwin/release/openssl \
187206 && file target/x86_64-apple-darwin/release/openssl \
188207 && echo \
189208\
190209 && echo "Cross-compiling application (linux-musl aarch64)..." \
191210 && OPENSSL_STATIC=1 \
192211 cargo build --release --target aarch64-unknown-linux-musl \
212+ && if [ "$$(uname -m)" = "aarch64" ]; then \
213+ target/aarch64-unknown-linux-musl/release/openssl;
214+ fi \
193215 && du -sh target/aarch64-unknown-linux-musl/release/openssl \
194216 && file target/aarch64-unknown-linux-musl/release/openssl \
195217 && echo \
@@ -200,5 +222,6 @@ test-openssl:
200222 cargo build --release --target aarch64-apple-darwin \
201223 && du -sh target/aarch64-apple-darwin/release/openssl \
202224 && file target/aarch64-apple-darwin/release/openssl \
203- && echo \
225+ && echo
226+
204227.ONESHELL : test-openssl
0 commit comments