2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
|
|
|
# Runtime (C++) library variables
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
RUNTIME_CS := rt/sync/timer.cpp \
|
|
|
|
rt/sync/sync.cpp \
|
|
|
|
rt/sync/lock_and_signal.cpp \
|
|
|
|
rt/rust.cpp \
|
|
|
|
rt/rust_builtin.cpp \
|
|
|
|
rt/rust_run_program.cpp \
|
|
|
|
rt/rust_crate_cache.cpp \
|
|
|
|
rt/rust_comm.cpp \
|
2011-07-27 21:34:39 +00:00
|
|
|
rt/rust_env.cpp \
|
2011-06-28 19:15:41 +00:00
|
|
|
rt/rust_scheduler.cpp \
|
2011-05-01 20:18:52 +00:00
|
|
|
rt/rust_task.cpp \
|
|
|
|
rt/rust_task_list.cpp \
|
|
|
|
rt/rust_chan.cpp \
|
|
|
|
rt/rust_port.cpp \
|
|
|
|
rt/rust_upcall.cpp \
|
2011-06-16 05:04:31 +00:00
|
|
|
rt/rust_uv.cpp \
|
2011-05-01 20:18:52 +00:00
|
|
|
rt/rust_log.cpp \
|
|
|
|
rt/rust_timer.cpp \
|
|
|
|
rt/circular_buffer.cpp \
|
|
|
|
rt/isaac/randport.cpp \
|
|
|
|
rt/rust_srv.cpp \
|
|
|
|
rt/rust_kernel.cpp \
|
2011-08-04 03:25:44 +00:00
|
|
|
rt/rust_shape.cpp \
|
2011-05-01 20:18:52 +00:00
|
|
|
rt/memory_region.cpp \
|
2011-06-28 19:54:41 +00:00
|
|
|
rt/test/rust_test_harness.cpp \
|
|
|
|
rt/test/rust_test_runtime.cpp \
|
|
|
|
rt/test/rust_test_util.cpp \
|
2011-06-01 00:44:54 +00:00
|
|
|
rt/arch/i386/context.cpp \
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2011-06-16 01:03:15 +00:00
|
|
|
RUNTIME_LL :=
|
2011-05-18 19:43:48 +00:00
|
|
|
|
2011-06-01 00:44:54 +00:00
|
|
|
RUNTIME_S := rt/arch/i386/_context.s
|
2011-05-24 21:00:45 +00:00
|
|
|
|
2011-05-01 20:18:52 +00:00
|
|
|
RUNTIME_HDR := rt/globals.h \
|
|
|
|
rt/rust.h \
|
|
|
|
rt/rust_internal.h \
|
|
|
|
rt/rust_util.h \
|
|
|
|
rt/rust_chan.h \
|
2011-07-27 21:34:39 +00:00
|
|
|
rt/rust_env.h \
|
2011-05-01 20:18:52 +00:00
|
|
|
rt/rust_port.h \
|
2011-06-28 19:15:41 +00:00
|
|
|
rt/rust_scheduler.h \
|
2011-05-01 20:18:52 +00:00
|
|
|
rt/rust_task.h \
|
|
|
|
rt/rust_task_list.h \
|
|
|
|
rt/rust_log.h \
|
|
|
|
rt/circular_buffer.h \
|
|
|
|
rt/util/array_list.h \
|
|
|
|
rt/util/indexed_list.h \
|
|
|
|
rt/util/synchronized_indexed_list.h \
|
|
|
|
rt/util/hash_map.h \
|
|
|
|
rt/sync/sync.h \
|
|
|
|
rt/sync/timer.h \
|
|
|
|
rt/sync/lock_and_signal.h \
|
|
|
|
rt/sync/lock_free_queue.h \
|
|
|
|
rt/rust_srv.h \
|
|
|
|
rt/rust_kernel.h \
|
|
|
|
rt/memory_region.h \
|
|
|
|
rt/memory.h \
|
2011-06-28 19:54:41 +00:00
|
|
|
rt/test/rust_test_harness.h \
|
|
|
|
rt/test/rust_test_runtime.h \
|
|
|
|
rt/test/rust_test_util.h \
|
2011-06-01 00:44:54 +00:00
|
|
|
rt/arch/i386/context.h \
|
2011-05-01 20:18:52 +00:00
|
|
|
|
|
|
|
RUNTIME_DEF := rt/rustrt$(CFG_DEF_SUFFIX)
|
2011-06-01 00:44:54 +00:00
|
|
|
RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash \
|
2011-07-09 00:22:48 +00:00
|
|
|
-I $(S)src/rt/arch/i386 -I $(S)src/rt/libuv/include
|
2011-05-24 21:00:45 +00:00
|
|
|
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o) $(RUNTIME_LL:.ll=.o) $(RUNTIME_S:.s=.o)
|
2011-06-14 15:28:10 +00:00
|
|
|
RUNTIME_LIBS := $(S)src/rt/libuv/uv.a
|
2011-05-01 20:18:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
rt/%.o: rt/%.cpp $(MKFILES)
|
|
|
|
@$(call E, compile: $@)
|
|
|
|
$(Q)$(call CFG_COMPILE_C, $@, $(RUNTIME_INCS)) $<
|
|
|
|
|
2011-05-24 21:00:45 +00:00
|
|
|
rt/%.o: rt/%.s $(MKFILES)
|
|
|
|
@$(call E, compile: $@)
|
|
|
|
$(Q)$(call CFG_COMPILE_C, $@, $(RUNTIME_INCS)) $<
|
|
|
|
|
2011-06-07 20:41:19 +00:00
|
|
|
ifdef CFG_WINDOWSY
|
|
|
|
rt/main.ll: rt/main.ll.in
|
2011-06-25 19:23:27 +00:00
|
|
|
@$(call E, sed: $@)
|
|
|
|
$(Q)sed 's/MAIN/WinMain@16/' < $^ > $@
|
2011-06-07 20:41:19 +00:00
|
|
|
else
|
|
|
|
rt/main.ll: rt/main.ll.in
|
2011-06-25 19:23:27 +00:00
|
|
|
@$(call E, sed: $@)
|
|
|
|
$(Q)sed 's/MAIN/main/' < $^ > $@
|
2011-06-07 20:41:19 +00:00
|
|
|
endif
|
|
|
|
|
2011-05-18 19:43:48 +00:00
|
|
|
rt/%.o: rt/%.ll $(MKFILES)
|
|
|
|
@$(call E, llc: $@)
|
|
|
|
$(Q)$(LLC) -filetype=obj -relocation-model=pic -march=x86 -o $@ $<
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2011-06-14 15:28:10 +00:00
|
|
|
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) $(RUNTIME_LIBS)
|
2011-05-01 20:18:52 +00:00
|
|
|
@$(call E, link: $@)
|
2011-08-04 18:44:23 +00:00
|
|
|
$(Q)$(call CFG_LINK_C,$@, $(RUNTIME_OBJS) \
|
|
|
|
$(CFG_GCCISH_POST_LIB_FLAGS) $(RUNTIME_LIBS) -lpthread,$(RUNTIME_DEF))
|
2011-06-14 15:28:10 +00:00
|
|
|
|
2011-07-09 00:22:48 +00:00
|
|
|
$(S)src/rt/libuv/uv.a: $(S)src/rt/libuv/LIBUV_REVISION
|
2011-06-14 15:28:10 +00:00
|
|
|
$(Q)$(MAKE) -C $(S)src/rt/libuv CFLAGS=\"-m32\" LDFLAGS=\"-m32\"
|
|
|
|
$(Q)mkdir -p rt/libuv
|
|
|
|
$(Q)cp $(S)src/rt/libuv/uv.a rt/libuv/uv.a
|
2011-05-01 20:18:52 +00:00
|
|
|
|
|
|
|
# These could go in rt.mk or rustllvm.mk, they're needed for both.
|
|
|
|
|
|
|
|
%.linux.def: %.def.in $(MKFILES)
|
|
|
|
@$(call E, def: $@)
|
|
|
|
$(Q)echo "{" > $@
|
|
|
|
$(Q)sed 's/.$$/&;/' $< >> $@
|
|
|
|
$(Q)echo "};" >> $@
|
|
|
|
|
|
|
|
%.darwin.def: %.def.in $(MKFILES)
|
|
|
|
@$(call E, def: $@)
|
|
|
|
$(Q)sed 's/^./_&/' $< > $@
|
|
|
|
|
|
|
|
ifdef CFG_WINDOWSY
|
|
|
|
%.def: %.def.in $(MKFILES)
|
|
|
|
@$(call E, def: $@)
|
|
|
|
$(Q)echo LIBRARY $* > $@
|
|
|
|
$(Q)echo EXPORTS >> $@
|
|
|
|
$(Q)sed 's/^./ &/' $< >> $@
|
|
|
|
endif
|