build: Introduce rustsyntax crate

This commit is contained in:
Brian Anderson 2012-03-22 15:27:35 -07:00
parent c7082ce8e8
commit a0ed1fb20b
8 changed files with 42 additions and 2 deletions

View File

@ -106,13 +106,16 @@ CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
CFG_CORELIB :=$(call CFG_LIB_NAME,core)
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
CFG_LIBRUSTSYNTAX :=$(call CFG_LIB_NAME,rustsyntax)
STDLIB_GLOB :=$(call CFG_LIB_GLOB,std)
CORELIB_GLOB :=$(call CFG_LIB_GLOB,core)
LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc)
LIBRUSTSYNTAX_GLOB :=$(call CFG_LIB_GLOB,rustsyntax)
STDLIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,std)
CORELIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,core)
LIBRUSTC_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustc)
LIBRUSTSYNTAX_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustsyntax)
# version-string calculation
CFG_GIT_DIR := $(CFG_SRC_DIR).git
@ -190,6 +193,10 @@ COMPILER_INPUTS := $(filter-out $(S)src/rustc/driver/rustc.rs, \
$(wildcard $(addprefix $(S)src/rustc/, \
rustc.rc *.rs */*.rs */*/*.rs)))
LIBRUSTSYNTAX_CRATE := $(S)src/librustsyntax/rustsyntax.rc
LIBRUSTSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/librustsyntax/, \
rustsyntax.rc *.rs))
RUSTC_INPUTS := $(S)src/rustc/driver/rustc.rs
######################################################################

View File

@ -70,9 +70,11 @@ clean$(1)_H_$(2):
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_CORELIB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_STDLIB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTC)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTSYNTAX)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CORELIB_GLOB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(STDLIB_GLOB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTC_GLOB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTSYNTAX_GLOB)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUSTLLVM)
$(Q)rm -f $$(HLIB$(1)_H_$(2))/libstd.rlib
@ -94,9 +96,11 @@ clean$(1)_T_$(2)_H_$(3):
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTSYNTAX)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CORELIB_GLOB)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(STDLIB_GLOB)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTC_GLOB)
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTSYNTAX_GLOB)
$(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

View File

@ -28,6 +28,7 @@ PKG_FILES := \
etc \
fuzzer \
libcore \
librustsyntax \
libstd \
rt \
rustdoc \

View File

@ -21,10 +21,9 @@ $$(HBIN$(2)_H_$(4))/rustc$$(X): \
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
# FIXME: The fuzzer depends on this. Remove once it's rpathed to correctly
# find it in the appropriate target directory
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC): \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC) \
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTSYNTAX) \
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME) \
$$(HLIB$(2)_H_$(4))/$$(CFG_RUSTLLVM) \
$$(HCORELIB_DEFAULT$(2)_H_$(3)) \
@ -35,6 +34,18 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC): \
$$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_DSYM_GLOB) \
$$(HLIB$(2)_H_$(4))
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTSYNTAX): \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTSYNTAX) \
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME) \
$$(HLIB$(2)_H_$(4))/$$(CFG_RUSTLLVM) \
$$(HCORELIB_DEFAULT$(2)_H_$(3)) \
$$(HSTDLIB_DEFAULT$(2)_H_$(3))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTSYNTAX_GLOB) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTSYNTAX_DSYM_GLOB) \
$$(HLIB$(2)_H_$(4))
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME): \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_RUNTIME)
@$$(call E, cp: $$@)

View File

@ -42,6 +42,8 @@ install-target-$(1)-host-$(2): $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(STDLIB_GLOB))
$$(Q)$$(call INSTALL_LIB, \
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(LIBRUSTC_GLOB))
$$(Q)$$(call INSTALL_LIB, \
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(LIBRUSTSYNTAX_GLOB))
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
endef
@ -75,6 +77,7 @@ install-host: $(SREQ$(ISTAGE)_T_$(CFG_HOST_TRIPLE)_H_$(CFG_HOST_TRIPLE))
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(CORELIB_GLOB))
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(STDLIB_GLOB))
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(LIBRUSTC_GLOB))
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(LIBRUSTSYNTAX_GLOB))
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM))
$(Q)$(call INSTALL,$(S)/man, \
$(PREFIX_ROOT)/share/man/man1,rustc.1)
@ -95,6 +98,7 @@ uninstall:
$(call HOST_LIB_FROM_HL_GLOB,$(CORELIB_GLOB)) \
$(call HOST_LIB_FROM_HL_GLOB,$(STDLIB_GLOB)) \
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTC_GLOB)) \
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTSYNTAX_GLOB)) \
; \
do rm -f $$i ; \
done

View File

@ -38,6 +38,12 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTSYNTAX)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTSYNTAX): \
$$(LIBRUSTSYNTAX_CRATE) $$(LIBRUSTSYNTAX_INPUTS) \
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM) \
$$(TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3)) \

View File

@ -0,0 +1,5 @@
#[link(name = "rustsyntax",
vers = "0.2",
uuid = "c2b79dd0-a437-4ec7-95f9-858d77808c2f")];
#[crate_type = "lib"];

View File

@ -13,6 +13,8 @@ use std (name = "std",
vers = "0.2",
url = "https://github.com/mozilla/rust/tree/master/src/libstd");
use rustsyntax;
mod middle {
mod trans {
mod common;