aboutsummaryrefslogtreecommitdiff
path: root/mk/rt.mk
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-05-01 20:18:52 +0000
committerGraydon Hoare <[email protected]>2011-05-01 20:20:25 +0000
commit40624e35d74e5d200ae689c02753f0d60924e668 (patch)
treee1e259098d5c49cd49844b40abd46ec35219d94a /mk/rt.mk
parentrustc: Preserve dots in input path when using an implicit output path (diff)
downloadrust-40624e35d74e5d200ae689c02753f0d60924e668.tar.xz
rust-40624e35d74e5d200ae689c02753f0d60924e668.zip
Start splitting up Makefile.in
Diffstat (limited to 'mk/rt.mk')
-rw-r--r--mk/rt.mk97
1 files changed, 97 insertions, 0 deletions
diff --git a/mk/rt.mk b/mk/rt.mk
new file mode 100644
index 00000000..ad43b616
--- /dev/null
+++ b/mk/rt.mk
@@ -0,0 +1,97 @@
+######################################################################
+# 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.cpp \
+ rt/rust_crate_cache.cpp \
+ rt/rust_crate_reader.cpp \
+ rt/rust_comm.cpp \
+ rt/rust_dom.cpp \
+ rt/rust_task.cpp \
+ rt/rust_task_list.cpp \
+ rt/rust_proxy.cpp \
+ rt/rust_chan.cpp \
+ rt/rust_port.cpp \
+ rt/rust_upcall.cpp \
+ rt/rust_log.cpp \
+ rt/rust_message.cpp \
+ rt/rust_timer.cpp \
+ rt/circular_buffer.cpp \
+ rt/isaac/randport.cpp \
+ rt/rust_srv.cpp \
+ rt/rust_kernel.cpp \
+ rt/memory_region.cpp \
+ rt/test/rust_test_harness.cpp \
+ rt/test/rust_test_runtime.cpp \
+ rt/test/rust_test_util.cpp
+
+RUNTIME_HDR := rt/globals.h \
+ rt/rust.h \
+ rt/rust_dwarf.h \
+ rt/rust_internal.h \
+ rt/rust_util.h \
+ rt/rust_chan.h \
+ rt/rust_port.h \
+ rt/rust_dom.h \
+ rt/rust_task.h \
+ rt/rust_task_list.h \
+ rt/rust_proxy.h \
+ rt/rust_log.h \
+ rt/rust_message.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 \
+ rt/test/rust_test_harness.h \
+ rt/test/rust_test_runtime.h \
+ rt/test/rust_test_util.h
+
+RUNTIME_DEF := rt/rustrt$(CFG_DEF_SUFFIX)
+RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash
+RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o)
+RUNTIME_LIBS := $(CFG_GCC_POST_LIB_FLAGS)
+
+
+rt/%.o: rt/%.cpp $(MKFILES)
+ @$(call E, compile: $@)
+ $(Q)$(call CFG_COMPILE_C, $@, $(RUNTIME_INCS)) $<
+
+
+rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF)
+ @$(call E, link: $@)
+ $(Q)$(call CFG_LINK_C,$@,$(RUNTIME_LIBS) $(RUNTIME_OBJS),$(RUNTIME_DEF))
+
+# 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