@@ -338,19 +338,28 @@ $(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/host_interface/componen
338
338
339
339
# Shared builtins build ########################################################
340
340
341
- shared-builtins : shared/builtins.a shared/librust_url.a shared/librust_encoding.a
341
+ .PHONY : shared-builtins
342
+ shared-builtins : shared.a
342
343
343
- shared/builtins.a : $(OBJ_DIR ) /builtins/shared/* .o
344
- shared/builtins.a : $(OBJ_DIR ) /builtin.o
345
- shared/builtins.a : $(OBJ_DIR ) /core/encode.o
346
- shared/builtins.a : | shared
347
- $(call cmd,wasi_ar,$^ )
348
-
349
- shared/librust_url.a : $(RUST_URL_LIB ) | shared
344
+ .PHONY : shared.a
345
+ shared.a : $(OBJ_DIR ) /shared.a
350
346
$(call cmd,cp,$@ )
351
347
352
- shared/librust_encoding.a : $(RUST_ENCODING_LIB ) | shared
353
- $(call cmd,cp,$@ )
348
+ extract_lib = $(call cmd_format,WASI_AR [x],$2) $(WASI_AR ) -x --output $1 $2
349
+
350
+ $(OBJ_DIR ) /shared : $(OBJ_DIR ) /builtins.a $(RUST_URL_LIB ) $(RUST_ENCODING_LIB )
351
+ $(call cmd,mkdir,$@ )
352
+ $(call extract_lib,$(OBJ_DIR ) /shared,$(OBJ_DIR ) /builtins.a)
353
+ $(call extract_lib,$(OBJ_DIR ) /shared,$(RUST_URL_LIB ) )
354
+ $(call extract_lib,$(OBJ_DIR ) /shared,$(RUST_ENCODING_LIB ) )
355
+
356
+ $(OBJ_DIR ) /shared.a : | $(OBJ_DIR ) /shared
357
+ $(call cmd,wasi_ar,$(wildcard $(OBJ_DIR ) /shared/* .o) )
358
+
359
+ $(OBJ_DIR ) /builtins.a : $(filter $(OBJ_DIR ) /builtins/shared/% .o,$(FSM_OBJ ) )
360
+ $(OBJ_DIR ) /builtins.a : $(OBJ_DIR ) /builtin.o
361
+ $(OBJ_DIR ) /builtins.a : $(OBJ_DIR ) /core/encode.o
362
+ $(call cmd,wasi_ar,$^ )
354
363
355
364
# These two rules copy the built artifacts into the $(FSM_SRC) directory, and
356
365
# are both marked phony as we need to do the right thing when running the
0 commit comments