Skip to content

Commit

Permalink
rusti: Remove linenoise module, add to rt, remove core::rl
Browse files Browse the repository at this point in the history
  • Loading branch information
z0w0 committed Oct 30, 2012
1 parent 1afa299 commit ea99655
Show file tree
Hide file tree
Showing 21 changed files with 764 additions and 124 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "src/libuv"]
path = src/libuv
url = git://github.com/graydon/libuv.git
[submodule "src/linenoise"]
path = src/linenoise
url = git://github.com/antirez/linenoise.git
7 changes: 2 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ endif

CFG_RUSTC_FLAGS := $(RUSTFLAGS)
CFG_GCCISH_CFLAGS :=
CFG_GCCISH_CXXFLAGS :=
CFG_GCCISH_LINK_FLAGS :=

ifdef CFG_DISABLE_OPTIMIZE
Expand Down Expand Up @@ -337,8 +336,7 @@ HSREQ$(1)_H_$(3) = \
TSREQ$(1)_T_$(2)_H_$(3) = \
$$(HSREQ$(1)_H_$(3)) \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME) \
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a \
$$(TLIB$(1)_T_$(2)_H_$(3))/liblinenoise.a
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a

# Prerequisites for complete stageN targets
SREQ$(1)_T_$(2)_H_$(3) = \
Expand Down Expand Up @@ -451,8 +449,8 @@ TSREQS := \
$(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
FUZZ := $(HBIN2_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
CARGO := $(HBIN2_H_$(CFG_HOST_TRIPLE))/cargo$(X)
RUSTI := $(HBIN2_H_$(CFG_HOST_TRIPLE))/rusti$(X)
RUSTDOC := $(HBIN2_H_$(CFG_HOST_TRIPLE))/rustdoc$(X)
RUSTI := $(HBIN2_H_$(CFG_HOST_TRIPLE))/rusti$(X)

all: rustc $(GENERATED) docs $(FUZZ) $(CARGO) $(RUSTDOC) $(RUSTI)

Expand Down Expand Up @@ -492,7 +490,6 @@ include $(CFG_SRC_DIR)mk/host.mk
include $(CFG_SRC_DIR)mk/stage0.mk
include $(CFG_SRC_DIR)mk/rt.mk
include $(CFG_SRC_DIR)mk/rustllvm.mk
include $(CFG_SRC_DIR)mk/linenoise.mk
include $(CFG_SRC_DIR)mk/tools.mk
include $(CFG_SRC_DIR)mk/docs.mk
include $(CFG_SRC_DIR)mk/llvm.mk
Expand Down
8 changes: 1 addition & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,12 @@ do
make_dir rustllvm/$t
done

make_dir linenoise
for t in $CFG_TARGET_TRIPLES
do
make_dir linenoise/$t
done

make_dir rt
for t in $CFG_TARGET_TRIPLES
do
make_dir rt/$t
for i in \
isaac bigint sync test arch/i386 arch/x86_64 \
isaac linenoise bigint sync test arch/i386 arch/x86_64 \
libuv libuv/src/ares libuv/src/eio libuv/src/ev
do
make_dir rt/$t/$i
Expand Down
8 changes: 2 additions & 6 deletions mk/clean.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ clean: clean-misc $(CLEAN_STAGE_RULES)

clean-misc:
@$(call E, cleaning)
$(Q)find linenoise rustllvm rt $(CFG_HOST_TRIPLE)/test \
$(Q)find rustllvm rt $(CFG_HOST_TRIPLE)/test \
-name '*.[odasS]' -o \
-name '*.so' -o \
-name '*.dylib' -o \
-name '*.dll' -o \
-name '*.def' -o \
-name '*.bc' \
| xargs rm -f
$(Q)find linenoise rustllvm rt $(CFG_HOST_TRIPLE)\
$(Q)find rustllvm rt $(CFG_HOST_TRIPLE)\
-name '*.dSYM' \
| xargs rm -Rf
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
$(Q)rm -f $(LINENOISE_OBJS)
$(Q)rm -Rf $(DOCS)
$(Q)rm -Rf $(GENERATED)
$(Q)rm -f tmp/*.log tmp/*.rc tmp/*.rs
Expand All @@ -56,7 +55,6 @@ clean$(1)_H_$(2):
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustc$(X)
$(Q)rm -f $$(HBIN$(1)_H_$(2))/fuzzer$(X)
$(Q)rm -f $$(HBIN$(1)_H_$(2))/cargo$(X)
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rusti$(X)
$(Q)rm -f $$(HBIN$(1)_H_$(2))/serializer$(X)
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustdoc$(X)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUNTIME)
Expand All @@ -83,7 +81,6 @@ clean$(1)_T_$(2)_H_$(3):
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$(X)
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/fuzzer$(X)
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/cargo$(X)
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rusti$(X)
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/serializer$(X)
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustdoc$(X)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME)
Expand All @@ -98,7 +95,6 @@ clean$(1)_T_$(2)_H_$(3):
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/liblinenoise.a
endef

$(foreach host, $(CFG_TARGET_TRIPLES), \
Expand Down
1 change: 0 additions & 1 deletion mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ PKG_FILES := \
libcore \
libsyntax \
libstd \
linenoise \
rt \
rustdoc \
rustllvm \
Expand Down
23 changes: 0 additions & 23 deletions mk/linenoise.mk

This file was deleted.

42 changes: 21 additions & 21 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ endif

# Hack: not sure how to test if a file exists in make other than this
OS_SUPP = $(patsubst %,--suppressions=%,\
$(wildcard $(CFG_SRC_DIR)src/etc/$(CFG_OSTYPE).supp*))
$(wildcard $(CFG_SRC_DIR)src/etc/$(CFG_OSTYPE).supp*))

ifneq ($(findstring mingw,$(CFG_OSTYPE)),)
CFG_WINDOWSY := 1
Expand Down Expand Up @@ -231,18 +231,18 @@ ifeq ($(CFG_C_COMPILER),clang)
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
$$(call CFG_INSTALL_NAME,$$(4))
CFG_COMPILE_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_CFLAGS) $$(CFG_CLANG_CFLAGS) \
CFG_COMPILE_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_CFLAGS) $$(CFG_CLANG_CFLAGS) \
$$(CFG_GCCISH_CXXFLAGS) \
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
$$(CFG_CLANG_CFLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
$$(CFG_CLANG_CFLAGS_$$(HOST_$(1))) \
$$(CFG_DEPEND_FLAGS) \
-c -o $$(1) $$(2)
CFG_LINK_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
$$(call CFG_INSTALL_NAME,$$(4))
-c -o $$(1) $$(2)
CFG_LINK_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
$$(call CFG_INSTALL_NAME,$$(4))
endef

$(foreach target,$(CFG_TARGET_TRIPLES), \
Expand Down Expand Up @@ -278,18 +278,18 @@ ifeq ($(CFG_C_COMPILER),gcc)
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
$$(call CFG_INSTALL_NAME,$$(4))
CFG_COMPILE_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_CFLAGS) \
CFG_COMPILE_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_CFLAGS) \
$$(CFG_GCCISH_CXXFLAGS) \
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
$$(CFG_GCC_CFLAGS) \
$$(CFG_GCC_CFLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
$$(CFG_GCC_CFLAGS) \
$$(CFG_GCC_CFLAGS_$$(HOST_$(1))) \
$$(CFG_DEPEND_FLAGS) \
-c -o $$(1) $$(2)
CFG_LINK_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
CFG_LINK_CXX_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
$$(CFG_GCCISH_LINK_FLAGS_$$(HOST_$(1))) \
$$(CFG_GCCISH_DEF_FLAG)$$(3) $$(2) \
$$(call CFG_INSTALL_NAME,$$(4))
endef

Expand All @@ -312,4 +312,4 @@ define CFG_MAKE_ASSEMBLER
endef

$(foreach target,$(CFG_TARGET_TRIPLES),\
$(eval $(call CFG_MAKE_ASSEMBLER,$(target))))
$(eval $(call CFG_MAKE_ASSEMBLER,$(target))))
2 changes: 1 addition & 1 deletion mk/pp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
$(wildcard $(S)src/test/*/*.rs \
$(S)src/test/*/*/*.rs) \
$(wildcard $(S)src/fuzzer/*.rs) \
$(wildcard $(S)src/cargo/*.rs)
$(wildcard $(S)src/cargo/*.rs) \
$(wildcard $(S)src/rusti/*.rs)

PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
Expand Down
17 changes: 13 additions & 4 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define DEF_RUNTIME_TARGETS
# Runtime (C++) library variables
######################################################################

RUNTIME_CS_$(1) := \
RUNTIME_CXXS_$(1) := \
rt/sync/timer.cpp \
rt/sync/lock_and_signal.cpp \
rt/sync/rust_thread.cpp \
Expand Down Expand Up @@ -78,6 +78,8 @@ RUNTIME_CS_$(1) := \
rt/arch/$$(HOST_$(1))/context.cpp \
rt/arch/$$(HOST_$(1))/gpr.cpp

RUNTIME_CS_$(1) := rt/linenoise/linenoise.c

RUNTIME_S_$(1) := rt/arch/$$(HOST_$(1))/_context.S \
rt/arch/$$(HOST_$(1))/ccall.S \
rt/arch/$$(HOST_$(1))/record_sp.S
Expand All @@ -104,9 +106,11 @@ endif

RUNTIME_DEF_$(1) := rt/rustrt$$(CFG_DEF_SUFFIX)
RUNTIME_INCS_$(1) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
-I $$(S)src/rt/arch/$$(HOST_$(1)) \
-I $$(S)src/libuv/include
RUNTIME_OBJS_$(1) := $$(RUNTIME_CS_$(1):rt/%.cpp=rt/$(1)/%.o) \
-I $$(S)src/rt/arch/$$(HOST_$(1)) \
-I $$(S)src/rt/linenoise \
-I $$(S)src/libuv/include
RUNTIME_OBJS_$(1) := $$(RUNTIME_CXXS_$(1):rt/%.cpp=rt/$(1)/%.o) \
$$(RUNTIME_CS_$(1):rt/%.c=rt/$(1)/%.o) \
$$(RUNTIME_S_$(1):rt/%.S=rt/$(1)/%.o)
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1))

Expand All @@ -120,6 +124,11 @@ rt/$(1)/%.o: rt/%.cpp $$(MKFILE_DEPS)
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
$$(SNAP_DEFINES)) $$<

rt/$(1)/%.o: rt/%.c $$(MKFILE_DEPS)
@$$(call E, compile: $$@)
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
$$(SNAP_DEFINES)) $$<

rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS) \
$$(LLVM_CONFIG_$$(CFG_HOST_TRIPLE))
@$$(call E, compile: $$@)
Expand Down
5 changes: 0 additions & 5 deletions mk/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(TLIB$(1)_T_$(2)_H_$(3))/liblinenoise.a: \
linenoise/$(2)/liblinenoise.a
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM): \
rustllvm/$(2)/$$(CFG_RUSTLLVM)
@$$(call E, cp: $$@)
Expand Down
7 changes: 2 additions & 5 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ check-stage$(1)-T-$(2)-H-$(3): \
check-stage$(1)-T-$(2)-H-$(3)-bench \
check-stage$(1)-T-$(2)-H-$(3)-pretty \
check-stage$(1)-T-$(2)-H-$(3)-rustdoc \
check-stage$(1)-T-$(2)-H-$(3)-rusti \
check-stage$(1)-T-$(2)-H-$(3)-rusti \
check-stage$(1)-T-$(2)-H-$(3)-cargo \
check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial \
check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi \
Expand Down Expand Up @@ -392,6 +392,7 @@ check-stage$(1)-T-$(2)-H-$(3)-rusti-dummy: \
$$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS) \
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rusti.log


# Rules for the cargo test runner

$(3)/test/cargotest.stage$(1)-$(2)$$(X): \
Expand Down Expand Up @@ -870,9 +871,6 @@ check-stage$(1)-H-all-pretty-pretty: \
check-stage$(1)-H-all-rustdoc: \
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
check-stage$(1)-H-$$(target)-rustdoc)
check-stage$(1)-H-all-rusti: \
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
check-stage$(1)-H-$$(target)-rusti)
check-stage$(1)-H-all-cargo: \
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
check-stage$(1)-H-$$(target)-cargo)
Expand Down Expand Up @@ -907,7 +905,6 @@ check-stage$(1)-pretty-rfail: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-rfail
check-stage$(1)-pretty-bench: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-bench
check-stage$(1)-pretty-pretty: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-pretty
check-stage$(1)-rustdoc: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rustdoc
check-stage$(1)-rusti: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rusti
check-stage$(1)-cargo: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-cargo
check-stage$(1)-doc-tutorial: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial
check-stage$(1)-doc-tutorial-ffi: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial-ffi
Expand Down
36 changes: 18 additions & 18 deletions mk/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
CARGO_CRATE := $(S)src/cargo/cargo.rc
CARGO_INPUTS := $(wildcard $(S)src/cargo/*rs)

# Rusti, the JIT REPL
RUSTI_CRATE := $(S)src/rusti/rusti.rc
RUSTI_INPUTS := $(wildcard $(S)src/rusti/*rs)

# Rustdoc, the documentation tool
RUSTDOC_CRATE := $(S)src/rustdoc/rustdoc.rc
RUSTDOC_INPUTS := $(wildcard $(S)src/rustdoc/*.rs)

# Rusti, the JIT REPL
RUSTI_CRATE := $(S)src/rusti/rusti.rc
RUSTI_INPUTS := $(wildcard $(S)src/rusti/*.rs)

# FIXME: These are only built for the host arch. Eventually we'll
# have tools that need to built for other targets.
define TOOLS_STAGE_N
Expand Down Expand Up @@ -66,38 +66,38 @@ $$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X): \
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<

$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X): \
$$(RUSTI_CRATE) $$(RUSTI_INPUTS) \
$$(HBIN$(2)_H_$(4))/cargo$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X) \
$$(HSREQ$(2)_H_$(4))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
$$(RUSTDOC_CRATE) $$(RUSTDOC_INPUTS) \
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<

$$(HBIN$(2)_H_$(4))/cargo$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X) \
$$(HSREQ$(2)_H_$(4))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(HBIN$(2)_H_$(4))/rusti$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X) \
$$(HBIN$(2)_H_$(4))/rustdoc$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X) \
$$(HSREQ$(2)_H_$(4))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
$$(RUSTDOC_CRATE) $$(RUSTDOC_INPUTS) \
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X): \
$$(RUSTI_CRATE) $$(RUSTI_INPUTS) \
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<

$$(HBIN$(2)_H_$(4))/rustdoc$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X) \
$$(HBIN$(2)_H_$(4))/rusti$$(X): \
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X) \
$$(HSREQ$(2)_H_$(4))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
Expand Down
Loading

0 comments on commit ea99655

Please sign in to comment.