2010-06-16 16:30:45 -05:00
|
|
|
######################################################################
|
|
|
|
# Auto-configuration
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
ifdef VERBOSE
|
|
|
|
CFG_QUIET :=
|
|
|
|
CFG_ECHO =
|
|
|
|
else
|
|
|
|
CFG_QUIET := @
|
|
|
|
CFG_ECHO = echo $(1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFG_OSTYPE := $(shell uname -s)
|
|
|
|
CFG_CPUTYPE := $(shell uname -m)
|
|
|
|
|
|
|
|
ifneq ($(MAKE_RESTARTS),)
|
|
|
|
CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFG_INFO := $(info cfg: building on $(CFG_OSTYPE) $(CFG_CPUTYPE))
|
|
|
|
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS :=
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS :=
|
|
|
|
CFG_VALGRIND :=
|
|
|
|
|
2010-07-17 15:26:23 -05:00
|
|
|
CFG_LLVM_CONFIG ?= llvm-config
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_BOOT_FLAGS := $(FLAGS)
|
2010-10-22 16:46:03 -05:00
|
|
|
CFG_RUSTC_FLAGS := -nowarn
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-07-18 18:39:10 -05:00
|
|
|
# On Darwin, we need to run dsymutil so the debugging information ends
|
|
|
|
# up in the right place. On other platforms, it automatically gets
|
|
|
|
# embedded into the executable, so use a no-op command.
|
|
|
|
DSYMUTIL := true
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
ifeq ($(CFG_OSTYPE), Linux)
|
|
|
|
CFG_RUNTIME := librustrt.so
|
|
|
|
CFG_STDLIB := libstd.so
|
2010-08-24 23:06:56 -05:00
|
|
|
CFG_GCC_CFLAGS += -fPIC -march=i686
|
2010-08-11 23:23:34 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -shared -fPIC -ldl -lpthread -lrt
|
2010-06-16 16:30:45 -05:00
|
|
|
ifeq ($(CFG_CPUTYPE), x86_64)
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS += -m32
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -m32
|
|
|
|
endif
|
|
|
|
CFG_NATIVE := 1
|
|
|
|
CFG_UNIXY := 1
|
|
|
|
CFG_VALGRIND := $(shell which valgrind)
|
|
|
|
ifdef CFG_VALGRIND
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_VALGRIND += --leak-check=full \
|
2011-01-28 15:12:31 -06:00
|
|
|
--error-exitcode=1 \
|
2010-06-23 23:03:09 -05:00
|
|
|
--quiet --vex-iropt-level=0 \
|
|
|
|
--suppressions=etc/x86.supp
|
2010-06-16 16:30:45 -05:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CFG_OSTYPE), Darwin)
|
|
|
|
CFG_RUNTIME := librustrt.dylib
|
|
|
|
CFG_STDLIB := libstd.dylib
|
|
|
|
CFG_UNIXY := 1
|
|
|
|
CFG_GCC_LINK_FLAGS += -dynamiclib -lpthread
|
|
|
|
# Darwin has a very blurry notion of "64 bit", and claims it's running
|
|
|
|
# "on an i386" when the whole userspace is 64-bit and the compiler
|
|
|
|
# emits 64-bit binaries by default. So we just force -m32 here. Smarter
|
|
|
|
# approaches welcome!
|
2010-08-27 20:05:03 -05:00
|
|
|
CFG_NATIVE := 1
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS += -m32
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -m32
|
2010-07-18 18:39:10 -05:00
|
|
|
DSYMUTIL := dsymutil
|
2010-06-16 16:30:45 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(findstring MINGW,$(CFG_OSTYPE)),)
|
|
|
|
CFG_WINDOWSY := 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CFG_WINDOWSY
|
|
|
|
CFG_INFO := $(info cfg: windows-y environment)
|
|
|
|
CFG_PATH_MUNGE := | sed -e 's/\\\(.\)/\/\1/g'
|
|
|
|
CFG_FLEXLINK := $(shell which flexlink)
|
|
|
|
ifdef CFG_FLEXLINK
|
|
|
|
CFG_NATIVE := 1
|
|
|
|
endif
|
|
|
|
CFG_RUNTIME := rustrt.dll
|
|
|
|
CFG_STDLIB := std.dll
|
|
|
|
CFG_OBJ_SUFFIX := .o
|
|
|
|
CFG_EXE_SUFFIX := .exe
|
|
|
|
CFG_BOOT := ./rustboot.exe
|
2010-10-22 16:46:03 -05:00
|
|
|
CFG_RUSTC := ./rustc.exe
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS += -march=i686
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -shared -fPIC
|
|
|
|
CFG_RUN_TARG = $(1)
|
|
|
|
# FIXME: support msvc at some point
|
|
|
|
CFG_GCC := 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CFG_UNIXY
|
|
|
|
CFG_INFO := $(info cfg: unix-y environment)
|
|
|
|
CFG_BOOT := ./rustboot
|
2010-10-22 16:46:03 -05:00
|
|
|
CFG_RUSTC := ./rustc
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_OBJ_SUFFIX := .o
|
|
|
|
CFG_RUN_TARG = LD_LIBRARY_PATH=. $(CFG_VALGRIND) $(1)
|
|
|
|
CFG_GCC := 1
|
|
|
|
ifdef MINGW_CROSS
|
|
|
|
CFG_INFO := $(info cfg: mingw-cross)
|
|
|
|
CFG_GCC_CROSS := i586-mingw32msvc-
|
|
|
|
CFG_BOOT_FLAGS += -t win32-x86-pe
|
|
|
|
CFG_RUNTIME := rustrt.dll
|
|
|
|
CFG_STDLIB := std.dll
|
2010-10-22 16:46:03 -05:00
|
|
|
CFG_RUSTC := ./rustc.exe
|
2010-06-16 16:30:45 -05:00
|
|
|
ifdef CFG_VALGRIND
|
|
|
|
CFG_VALGRIND += wine
|
|
|
|
endif
|
|
|
|
CFG_OBJ_SUFFIX := .o
|
|
|
|
CFG_EXE_SUFFIX := .exe
|
2010-08-24 23:06:56 -05:00
|
|
|
CFG_GCC_CFLAGS := -march=i686
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS := -shared
|
|
|
|
ifeq ($(CFG_CPUTYPE), x86_64)
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS += -m32
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -m32
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CFG_GCC
|
|
|
|
CFG_INFO := $(info cfg: using gcc)
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_GCC_CFLAGS += -Wall -Werror -fno-rtti -fno-exceptions -g
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_GCC_LINK_FLAGS += -g
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_COMPILE_C = $(CFG_GCC_CROSS)g++ $(CFG_GCC_CFLAGS) -c -o $(1) $(2)
|
2010-06-16 16:30:45 -05:00
|
|
|
CFG_LINK_C = $(CFG_GCC_CROSS)g++ $(CFG_GCC_LINK_FLAGS) -o $(1)
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_DEPEND_C = $(CFG_GCC_CROSS)g++ $(CFG_GCC_CFLAGS) -MT "$(1)" -MM $(2)
|
2010-06-16 16:30:45 -05:00
|
|
|
else
|
|
|
|
CFG_ERR := $(error please try on a system with gcc)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFG_OCAMLC_OPT := $(shell which ocamlc.opt)
|
|
|
|
ifdef CFG_OCAMLC_OPT
|
|
|
|
$(info cfg: using ocaml native compiler)
|
|
|
|
OPT=.opt
|
|
|
|
else
|
|
|
|
$(info cfg: using ocaml bytecode compiler)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef PROFILE
|
|
|
|
$(info cfg: building with profiling info (forcing native output))
|
|
|
|
CFG_NATIVE := 1
|
|
|
|
CFG_OCAMLOPT_PROFILE_FLAGS := -p
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef DEBUG
|
|
|
|
$(info cfg: forcing bytecode output)
|
|
|
|
CFG_NATIVE :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CFG_NATIVE
|
|
|
|
$(info cfg: building native compiler)
|
|
|
|
else
|
|
|
|
$(info cfg: building bytecode compiler)
|
|
|
|
endif
|
|
|
|
|
2010-07-05 00:40:19 -05:00
|
|
|
ifdef NO_VALGRIND
|
|
|
|
CFG_VALGRIND :=
|
|
|
|
endif
|
|
|
|
|
2010-07-10 21:58:02 -05:00
|
|
|
ifdef NO_LLVM
|
|
|
|
CFG_LLVM_CONFIG :=
|
|
|
|
endif
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
ifneq ($(CFG_LLVM_CONFIG),)
|
|
|
|
CFG_LLVM_CONFIG := $(shell which $(CFG_LLVM_CONFIG))
|
|
|
|
endif
|
|
|
|
ifneq ($(CFG_LLVM_CONFIG),)
|
|
|
|
CFG_LLVM_VERSION := $(shell $(CFG_LLVM_CONFIG) --version)
|
2010-10-19 14:05:22 -05:00
|
|
|
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
|
2010-10-20 17:59:01 -05:00
|
|
|
CFG_LLVM_ALLOWED_VERSIONS := 2.8svn 2.8 2.9svn
|
|
|
|
ifneq ($(findstring $(CFG_LLVM_VERSION),$(CFG_LLVM_ALLOWED_VERSIONS)),)
|
2010-10-19 14:05:22 -05:00
|
|
|
$(info cfg: using LLVM version $(CFG_LLVM_VERSION))
|
2010-06-16 16:30:45 -05:00
|
|
|
else
|
|
|
|
CFG_LLVM_CONFIG :=
|
2010-06-23 23:03:09 -05:00
|
|
|
$(info cfg: incompatible LLVM version $(CFG_LLVM_VERSION), \
|
2010-10-20 18:40:39 -05:00
|
|
|
expected one of $(CFG_LLVM_ALLOWED_VERSIONS))
|
2010-10-19 14:05:22 -05:00
|
|
|
endif
|
|
|
|
endif
|
2010-10-28 17:22:37 -05:00
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
ifdef CFG_LLVM_CONFIG
|
2010-07-17 15:26:23 -05:00
|
|
|
LLC := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llc"
|
2010-06-23 23:03:09 -05:00
|
|
|
CFG_LLC_CFLAGS := -march=x86
|
2010-07-19 22:46:20 -05:00
|
|
|
LLVM-DIS := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llvm-dis"
|
2010-06-16 16:30:45 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
MKFILES := Makefile
|
|
|
|
|
2010-07-21 17:10:16 -05:00
|
|
|
# Add current directory to library search path of CFG_BOOT command line.
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
CFG_BOOT_FLAGS += -L .
|
|
|
|
|
2011-01-26 14:45:51 -06:00
|
|
|
# Commands we now know how to run.
|
|
|
|
|
|
|
|
BOOT := $(CFG_QUIET)OCAMLRUNPARAM="b1" $(CFG_BOOT) $(CFG_BOOT_FLAGS)
|
|
|
|
RUSTC := $(CFG_QUIET)$(CFG_RUSTC) $(CFG_RUSTC_FLAGS)
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
######################################################################
|
|
|
|
# Boot targets and rules
|
|
|
|
######################################################################
|
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
ML_DEP_INCS := -I boot/fe -I boot/me -I boot/be \
|
2010-12-29 18:27:13 -06:00
|
|
|
-I boot/driver -I boot/util
|
2010-12-29 19:46:22 -06:00
|
|
|
ML_INCS := $(ML_DEP_INCS)
|
2010-06-16 16:30:45 -05:00
|
|
|
ML_LIBS := unix.cma nums.cma bigarray.cma
|
|
|
|
ML_NATIVE_LIBS := unix.cmxa nums.cmxa bigarray.cmxa
|
|
|
|
OCAMLC_FLAGS := -g $(ML_INCS) -w Ael -warn-error Ael
|
2010-06-23 23:03:09 -05:00
|
|
|
OCAMLOPT_FLAGS := $(ML_INCS) -w Ael -warn-error Ael \
|
|
|
|
$(CFG_OCAMLOPT_PROFILE_FLAGS)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
# List them in link order.
|
|
|
|
# Nobody calculates the link-order DAG automatically, sadly.
|
|
|
|
|
2010-07-03 02:27:33 -05:00
|
|
|
UTIL_BOT_MLS := $(addprefix boot/util/, version.ml fmt.ml common.ml bits.ml)
|
2010-06-16 16:30:45 -05:00
|
|
|
DRIVER_BOT_MLS := $(addprefix boot/driver/, session.ml)
|
|
|
|
BE_MLS := $(addprefix boot/be/, x86.ml ra.ml pe.ml elf.ml \
|
|
|
|
macho.ml)
|
|
|
|
IL_MLS := $(addprefix boot/be/, asm.ml il.ml abi.ml)
|
2010-06-23 23:03:09 -05:00
|
|
|
ME_MLS := $(addprefix boot/me/, walk.ml semant.ml resolve.ml alias.ml \
|
2010-12-03 14:15:32 -06:00
|
|
|
simplify.ml type.ml dead.ml layer.ml effect.ml typestate.ml \
|
2010-11-02 17:24:46 -05:00
|
|
|
loop.ml layout.ml transutil.ml trans.ml dwarf.ml)
|
2010-10-01 16:54:40 -05:00
|
|
|
FE_MLS := $(addprefix boot/fe/, ast.ml token.ml lexer.ml parser.ml \
|
|
|
|
extfmt.ml pexp.ml item.ml cexp.ml fuzz.ml)
|
2010-12-29 19:46:22 -06:00
|
|
|
DRIVER_TOP_MLS := $(addprefix boot/driver/, lib.ml glue.ml main.ml)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
BOOT_MLS := $(UTIL_BOT_MLS) $(DRIVER_BOT_MLS) $(FE_MLS) $(IL_MLS) $(ME_MLS) \
|
2010-12-29 18:27:13 -06:00
|
|
|
$(BE_MLS) $(DRIVER_TOP_MLS)
|
2010-06-16 16:30:45 -05:00
|
|
|
BOOT_CMOS := $(BOOT_MLS:.ml=.cmo)
|
|
|
|
BOOT_CMXS := $(BOOT_MLS:.ml=.cmx)
|
|
|
|
BOOT_OBJS := $(BOOT_MLS:.ml=.o)
|
|
|
|
BOOT_CMIS := $(BOOT_MLS:.ml=.cmi)
|
|
|
|
|
2010-08-11 23:23:34 -05:00
|
|
|
RUNTIME_CS := rt/sync/timer.cpp \
|
|
|
|
rt/sync/sync.cpp \
|
2010-09-08 21:13:49 -05:00
|
|
|
rt/sync/lock_and_signal.cpp \
|
2010-07-19 16:05:18 -05:00
|
|
|
rt/rust.cpp \
|
2010-06-16 16:30:45 -05:00
|
|
|
rt/rust_builtin.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 \
|
2010-09-10 03:21:29 -05:00
|
|
|
rt/rust_task_list.cpp \
|
2010-09-07 20:08:09 -05:00
|
|
|
rt/rust_proxy.cpp \
|
2010-06-23 23:03:09 -05:00
|
|
|
rt/rust_chan.cpp \
|
2010-07-28 18:46:13 -05:00
|
|
|
rt/rust_port.cpp \
|
2010-06-16 16:30:45 -05:00
|
|
|
rt/rust_upcall.cpp \
|
2010-06-23 23:03:09 -05:00
|
|
|
rt/rust_log.cpp \
|
2010-07-28 18:24:50 -05:00
|
|
|
rt/rust_message.cpp \
|
2010-06-23 23:03:09 -05:00
|
|
|
rt/rust_timer.cpp \
|
2010-07-19 16:05:18 -05:00
|
|
|
rt/circular_buffer.cpp \
|
2010-08-16 16:13:08 -05:00
|
|
|
rt/isaac/randport.cpp \
|
2010-08-18 01:40:07 -05:00
|
|
|
rt/rust_srv.cpp \
|
2010-08-27 20:26:36 -05:00
|
|
|
rt/rust_kernel.cpp \
|
2010-09-07 20:26:19 -05:00
|
|
|
rt/memory_region.cpp \
|
|
|
|
rt/test/rust_test_harness.cpp \
|
2010-09-10 03:21:29 -05:00
|
|
|
rt/test/rust_test_runtime.cpp \
|
2010-09-07 20:26:19 -05:00
|
|
|
rt/test/rust_test_util.cpp
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2010-07-19 16:05:18 -05:00
|
|
|
RUNTIME_HDR := rt/globals.h \
|
2010-07-20 17:15:36 -05:00
|
|
|
rt/rust.h \
|
2010-06-16 16:30:45 -05:00
|
|
|
rt/rust_dwarf.h \
|
|
|
|
rt/rust_internal.h \
|
2010-07-19 16:05:18 -05:00
|
|
|
rt/rust_util.h \
|
|
|
|
rt/rust_chan.h \
|
2010-07-28 18:46:13 -05:00
|
|
|
rt/rust_port.h \
|
2010-07-19 16:05:18 -05:00
|
|
|
rt/rust_dom.h \
|
|
|
|
rt/rust_task.h \
|
2010-09-10 03:21:29 -05:00
|
|
|
rt/rust_task_list.h \
|
2010-07-19 16:05:18 -05:00
|
|
|
rt/rust_proxy.h \
|
2010-07-28 18:48:34 -05:00
|
|
|
rt/rust_log.h \
|
2010-07-28 18:24:50 -05:00
|
|
|
rt/rust_message.h \
|
2010-07-28 18:48:34 -05:00
|
|
|
rt/circular_buffer.h \
|
|
|
|
rt/util/array_list.h \
|
2010-08-27 20:26:36 -05:00
|
|
|
rt/util/indexed_list.h \
|
|
|
|
rt/util/synchronized_indexed_list.h \
|
2010-08-09 09:42:06 -05:00
|
|
|
rt/util/hash_map.h \
|
2010-08-11 23:23:34 -05:00
|
|
|
rt/sync/sync.h \
|
2010-08-16 16:13:08 -05:00
|
|
|
rt/sync/timer.h \
|
2010-08-24 23:06:56 -05:00
|
|
|
rt/sync/lock_free_queue.h \
|
2010-08-18 01:40:07 -05:00
|
|
|
rt/rust_srv.h \
|
2010-08-27 20:26:36 -05:00
|
|
|
rt/rust_kernel.h \
|
2010-08-18 01:40:07 -05:00
|
|
|
rt/memory_region.h \
|
2010-09-07 20:26:19 -05:00
|
|
|
rt/memory.h \
|
|
|
|
rt/test/rust_test_harness.h \
|
2010-09-10 03:21:29 -05:00
|
|
|
rt/test/rust_test_runtime.h \
|
2010-09-07 20:26:19 -05:00
|
|
|
rt/test/rust_test_util.h
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
RUNTIME_INCS := -Irt/isaac -Irt/uthash
|
|
|
|
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=$(CFG_OBJ_SUFFIX))
|
|
|
|
RUNTIME_LIBS := $(CFG_RUNTIME_LIBS)
|
|
|
|
|
|
|
|
STDLIB_CRATE := lib/std.rc
|
|
|
|
STDLIB_INPUTS := $(wildcard lib/*.rc lib/*.rs lib/*/*.rs)
|
|
|
|
COMPILER_CRATE := comp/rustc.rc
|
|
|
|
COMPILER_INPUTS := $(wildcard comp/*.rc comp/*.rs comp/*/*.rs)
|
|
|
|
|
2010-07-03 02:27:33 -05:00
|
|
|
GENERATED := boot/fe/lexer.ml boot/util/version.ml
|
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
all: $(CFG_RUSTC) $(MKFILES) $(GENERATED)
|
2010-07-03 02:27:33 -05:00
|
|
|
|
|
|
|
boot/util/version.ml: Makefile
|
|
|
|
$(CFG_QUIET)git log -1 \
|
2010-12-24 15:01:42 -06:00
|
|
|
--pretty=format:'let version = "prerelease (%h %ci)";;' >$@ || exit 1
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
loc:
|
2010-07-03 02:27:33 -05:00
|
|
|
$(CFG_QUIET)wc -l $(BOOT_MLS) $(RUNTIME_CS) $(RUNTIME_HDR)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
|
|
|
$(CFG_QUIET)$(call CFG_LINK_C, $@) $(RUNTIME_OBJS)
|
|
|
|
|
|
|
|
$(CFG_STDLIB): $(STDLIB_CRATE) $(CFG_BOOT) $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
2011-01-26 14:45:51 -06:00
|
|
|
$(BOOT) -shared -o $@ $(STDLIB_CRATE)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
%$(CFG_OBJ_SUFFIX): %.cpp $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
|
|
|
$(CFG_QUIET)$(call CFG_COMPILE_C, $@, $(RUNTIME_INCS)) $<
|
|
|
|
|
|
|
|
ifdef CFG_NATIVE
|
|
|
|
$(CFG_BOOT): $(BOOT_CMXS) $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)ocamlopt$(OPT) -o $@ $(OCAMLOPT_FLAGS) $(ML_NATIVE_LIBS) \
|
|
|
|
$(BOOT_CMXS)
|
2010-06-16 16:30:45 -05:00
|
|
|
else
|
|
|
|
$(CFG_BOOT): $(BOOT_CMOS) $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
|
|
|
$(CFG_QUIET)ocamlc$(OPT) -o $@ $(OCAMLC_FLAGS) $(ML_LIBS) $(BOOT_CMOS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.cmo: %.ml $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
|
|
|
$(CFG_QUIET)ocamlc$(OPT) -c -o $@ $(OCAMLC_FLAGS) $<
|
|
|
|
|
|
|
|
%.cmo: %.cmi $(MKFILES)
|
|
|
|
|
|
|
|
%.cmx %.o: %.ml $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, compile: $<)
|
|
|
|
$(CFG_QUIET)ocamlopt$(OPT) -c -o $@ $(OCAMLOPT_FLAGS) $<
|
|
|
|
|
|
|
|
%.ml: %.mll $(MKFILES)
|
|
|
|
@$(call CFG_ECHO, lex-gen: $<)
|
|
|
|
$(CFG_QUIET)ocamllex$(OPT) -q -o $@ $<
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Main compiler targets and rules
|
|
|
|
######################################################################
|
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
$(CFG_RUSTC): $(COMPILER_INPUTS) $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, compile: $<)
|
2011-01-26 14:45:51 -06:00
|
|
|
$(BOOT) -minimal -o $@ $<
|
2010-06-16 16:30:45 -05:00
|
|
|
$(CFG_QUIET)chmod 0755 $@
|
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
self: $(CFG_RUSTC)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, compile: $<)
|
2011-01-26 14:45:51 -06:00
|
|
|
$(RUSTC) $(COMPILER_CRATE)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Testing
|
|
|
|
######################################################################
|
|
|
|
|
2010-09-09 17:59:29 -05:00
|
|
|
# Temporarily xfail tests broken by the nominal-tags change.
|
|
|
|
|
|
|
|
NOMINAL_TAG_XFAILS := test/run-pass/mlist.rs
|
|
|
|
|
2010-09-21 01:56:43 -05:00
|
|
|
# Temporarily xfail tests broken by the constant-tags change.
|
|
|
|
|
|
|
|
CONST_TAG_XFAILS := test/run-pass/generic-tag.rs
|
2010-09-09 17:59:29 -05:00
|
|
|
|
2010-09-08 12:40:33 -05:00
|
|
|
# Temporarily xfail some of the task tests, while debugging the
|
|
|
|
# overhauled inter-domain messaging system.
|
2010-07-29 14:47:37 -05:00
|
|
|
|
2011-01-31 14:47:17 -06:00
|
|
|
TASK_XFAILS := test/run-pass/task-comm-8.rs \
|
|
|
|
test/run-pass/task-comm-10.rs \
|
|
|
|
test/run-pass/task-comm-15.rs \
|
|
|
|
test/run-pass/task-comm-12.rs \
|
|
|
|
test/run-pass/task-comm-2.rs \
|
|
|
|
test/run-pass/task-comm-9.rs \
|
|
|
|
test/run-pass/task-life-0.rs \
|
|
|
|
test/run-pass/alt-type-simple.rs \
|
|
|
|
test/run-pass/many.rs
|
2010-07-29 14:47:37 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_XFAILS_BOOT := $(TASK_XFAILS) \
|
2010-09-09 17:59:29 -05:00
|
|
|
$(NOMINAL_TAG_XFAILS) \
|
2010-09-21 01:56:43 -05:00
|
|
|
$(CONST_TAG_XFAILS) \
|
2011-01-31 14:47:17 -06:00
|
|
|
test/run-pass/child-outlives-parent.rs \
|
2010-06-16 16:30:45 -05:00
|
|
|
test/run-pass/clone-with-exterior.rs \
|
2010-08-03 14:20:29 -05:00
|
|
|
test/run-pass/constrained-type.rs \
|
2010-08-20 13:48:31 -05:00
|
|
|
test/run-pass/destructor-ordering.rs \
|
2010-07-17 02:43:59 -05:00
|
|
|
test/run-pass/obj-as.rs \
|
|
|
|
test/run-pass/vec-slice.rs \
|
2010-06-28 23:18:09 -05:00
|
|
|
test/run-pass/fn-lval.rs \
|
2010-06-23 23:03:09 -05:00
|
|
|
test/run-pass/generic-recursive-tag.rs \
|
2011-01-19 18:29:14 -06:00
|
|
|
test/run-pass/generic-tup.rs \
|
2010-07-22 14:24:55 -05:00
|
|
|
test/run-pass/iter-ret.rs \
|
2011-01-31 14:47:17 -06:00
|
|
|
test/run-pass/lib-io.rs \
|
2010-07-19 01:21:19 -05:00
|
|
|
test/run-pass/mlist-cycle.rs \
|
2011-01-31 14:47:17 -06:00
|
|
|
test/run-pass/obj-as.rs \
|
2010-06-23 23:03:09 -05:00
|
|
|
test/run-pass/task-comm.rs \
|
2011-01-31 14:47:17 -06:00
|
|
|
test/run-pass/task-comm-3.rs \
|
|
|
|
test/run-pass/vec-slice.rs \
|
2010-11-04 09:55:33 -05:00
|
|
|
test/run-pass/while-and-do-while.rs \
|
2010-09-07 20:39:07 -05:00
|
|
|
test/run-fail/task-comm-14.rs \
|
2011-01-25 16:54:38 -06:00
|
|
|
test/compile-fail/bad-expr-path.rs \
|
2011-01-10 14:56:55 -06:00
|
|
|
test/compile-fail/import.rs \
|
|
|
|
test/compile-fail/import2.rs \
|
2011-01-12 14:03:00 -06:00
|
|
|
test/compile-fail/import3.rs \
|
2011-01-13 22:19:42 -06:00
|
|
|
test/compile-fail/import4.rs \
|
2010-06-24 18:57:00 -05:00
|
|
|
test/compile-fail/bad-recv.rs \
|
2011-01-31 14:47:17 -06:00
|
|
|
test/compile-fail/bad-send.rs \
|
|
|
|
test/compile-fail/infinite-vec-type-recursion.rs \
|
|
|
|
test/compile-fail/writing-through-read-alias.rs
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
# Same strategy here for the time being: just list the ones that
|
|
|
|
# work and assume the others don't. Invert this when we're closer
|
|
|
|
# to actually bootstrapping.
|
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_XFAILS_RUSTC := $(filter-out \
|
2010-10-22 16:46:03 -05:00
|
|
|
$(addprefix test/run-pass/, \
|
2011-01-27 14:50:19 -06:00
|
|
|
alt-path.rs \
|
2010-12-15 12:15:02 -06:00
|
|
|
alt-pattern-simple.rs \
|
2010-12-15 12:11:33 -06:00
|
|
|
alt-tag.rs \
|
2010-11-21 01:00:52 -06:00
|
|
|
arith-0.rs \
|
2010-11-22 13:35:00 -06:00
|
|
|
arith-1.rs \
|
2010-11-21 01:00:52 -06:00
|
|
|
arith-2.rs \
|
2011-01-24 20:03:31 -06:00
|
|
|
autoderef-full-lval.rs \
|
2011-01-27 15:49:11 -06:00
|
|
|
bind-exterior.rs \
|
2011-01-07 18:26:30 -06:00
|
|
|
bind-interior.rs \
|
2011-01-06 14:56:07 -06:00
|
|
|
bind-thunk.rs \
|
2011-01-05 18:06:01 -06:00
|
|
|
bind-trivial.rs \
|
2010-12-08 16:50:47 -06:00
|
|
|
bitwise.rs \
|
2010-11-21 00:05:17 -06:00
|
|
|
bool-not.rs \
|
2010-12-02 21:44:24 -06:00
|
|
|
box.rs \
|
2010-12-06 19:46:35 -06:00
|
|
|
box-in-tup.rs \
|
2010-12-08 17:04:57 -06:00
|
|
|
cast.rs \
|
2010-11-21 01:00:52 -06:00
|
|
|
char.rs \
|
2010-11-22 16:28:05 -06:00
|
|
|
complex.rs \
|
2011-01-21 14:09:25 -06:00
|
|
|
const.rs \
|
2010-11-21 00:05:17 -06:00
|
|
|
dead-code-one-arm-if.rs \
|
2010-11-21 14:06:09 -06:00
|
|
|
deep.rs \
|
2010-12-06 20:53:16 -06:00
|
|
|
deref.rs \
|
2010-11-22 13:35:00 -06:00
|
|
|
div-mod.rs \
|
2011-01-07 19:28:35 -06:00
|
|
|
drop-bind-thunk-args.rs \
|
2010-12-09 16:37:08 -06:00
|
|
|
drop-on-ret.rs \
|
2011-02-01 18:23:48 -06:00
|
|
|
else-if.rs \
|
2010-11-21 14:06:09 -06:00
|
|
|
fact.rs \
|
2011-01-21 17:56:42 -06:00
|
|
|
fn-lval.rs \
|
|
|
|
fun-call-variants.rs \
|
|
|
|
fun-indirect-call.rs \
|
2011-01-24 14:29:38 -06:00
|
|
|
generic-fn.rs \
|
2011-01-17 18:03:38 -06:00
|
|
|
generic-fn-infer.rs \
|
2011-01-18 19:20:13 -06:00
|
|
|
generic-drop-glue.rs \
|
2011-02-09 11:54:58 -06:00
|
|
|
generic-obj.rs \
|
2011-01-19 18:29:14 -06:00
|
|
|
generic-tup.rs \
|
2011-01-21 14:01:20 -06:00
|
|
|
generic-type.rs \
|
2010-11-21 00:05:17 -06:00
|
|
|
hello.rs \
|
2010-10-22 17:37:42 -05:00
|
|
|
int.rs \
|
2010-11-22 19:41:26 -06:00
|
|
|
i32-sub.rs \
|
|
|
|
i8-incr.rs \
|
2011-01-07 16:38:13 -06:00
|
|
|
import2.rs \
|
|
|
|
import3.rs \
|
2011-01-11 13:19:53 -06:00
|
|
|
import4.rs \
|
2011-01-13 17:02:54 -06:00
|
|
|
import5.rs \
|
2011-01-14 16:20:14 -06:00
|
|
|
import6.rs \
|
2011-01-17 15:17:09 -06:00
|
|
|
import7.rs \
|
2011-01-28 10:54:59 -06:00
|
|
|
import8.rs \
|
2010-10-22 17:37:42 -05:00
|
|
|
item-name-overload.rs \
|
2010-12-06 20:53:16 -06:00
|
|
|
large-records.rs \
|
2010-11-21 03:16:16 -06:00
|
|
|
lazy-init.rs \
|
2010-12-09 18:35:22 -06:00
|
|
|
lazy-and-or.rs \
|
2011-01-27 15:49:11 -06:00
|
|
|
leak-box-as-tydesc.rs \
|
2011-01-21 10:25:13 -06:00
|
|
|
linear-for-loop.rs \
|
2010-10-22 17:37:42 -05:00
|
|
|
multiline-comment.rs \
|
2011-01-21 17:56:42 -06:00
|
|
|
mutual-recursion-group.rs \
|
2011-02-01 12:40:04 -06:00
|
|
|
native2.rs \
|
2010-12-31 17:25:24 -06:00
|
|
|
obj-drop.rs \
|
2010-12-31 15:02:01 -06:00
|
|
|
obj-recursion.rs \
|
2010-12-31 17:25:24 -06:00
|
|
|
obj-with-vec.rs \
|
2010-12-09 18:35:22 -06:00
|
|
|
operator-associativity.rs \
|
2011-01-21 17:56:42 -06:00
|
|
|
opeq.rs \
|
2010-12-08 18:43:59 -06:00
|
|
|
output-slot-variants.rs \
|
2011-01-21 17:56:42 -06:00
|
|
|
over-constrained-vregs.rs \
|
2010-12-07 14:38:51 -06:00
|
|
|
readalias.rs \
|
2010-11-30 12:39:35 -06:00
|
|
|
rec.rs \
|
2010-12-08 17:29:09 -06:00
|
|
|
rec-auto.rs \
|
2010-12-08 13:52:34 -06:00
|
|
|
rec-tup.rs \
|
2010-11-22 13:35:00 -06:00
|
|
|
return-nil.rs \
|
2010-12-20 19:28:07 -06:00
|
|
|
simple-obj.rs \
|
2010-12-30 19:01:44 -06:00
|
|
|
stateful-obj.rs \
|
2011-01-24 20:03:50 -06:00
|
|
|
str-idx.rs \
|
2010-12-09 18:03:22 -06:00
|
|
|
type-in-nested-module.rs \
|
2011-01-19 15:13:33 -06:00
|
|
|
type-param.rs \
|
2010-11-26 19:47:27 -06:00
|
|
|
tup.rs \
|
2010-11-22 19:41:26 -06:00
|
|
|
u32-decr.rs \
|
|
|
|
u8-incr.rs \
|
|
|
|
u8-incr-decr.rs \
|
2010-11-22 18:27:00 -06:00
|
|
|
uint.rs \
|
2010-11-22 13:35:00 -06:00
|
|
|
unit.rs \
|
2010-12-24 19:03:46 -06:00
|
|
|
use.rs \
|
2010-12-17 01:25:32 -06:00
|
|
|
tag.rs \
|
2010-12-13 13:16:04 -06:00
|
|
|
vec.rs \
|
2010-12-13 19:48:33 -06:00
|
|
|
vec-drop.rs \
|
2010-12-13 13:16:04 -06:00
|
|
|
vec-in-tup.rs \
|
|
|
|
vec-late-init.rs \
|
2010-11-22 13:35:00 -06:00
|
|
|
while-and-do-while.rs \
|
2011-01-24 20:03:50 -06:00
|
|
|
while-flow-graph.rs \
|
2010-12-07 14:40:57 -06:00
|
|
|
writealias.rs \
|
2010-11-22 19:38:23 -06:00
|
|
|
) \
|
|
|
|
$(addprefix test/compile-fail/, \
|
2011-01-30 13:28:18 -06:00
|
|
|
alt-tag-nullary.rs \
|
|
|
|
alt-tag-unary.rs \
|
2010-11-22 19:38:23 -06:00
|
|
|
arg-count-mismatch.rs \
|
2010-11-22 19:56:45 -06:00
|
|
|
arg-type-mismatch.rs \
|
2011-01-25 16:54:38 -06:00
|
|
|
bad-expr-path.rs \
|
2011-01-25 17:15:19 -06:00
|
|
|
bad-expr-path2.rs \
|
2011-01-30 13:28:18 -06:00
|
|
|
bogus-tag.rs \
|
2011-01-10 14:56:55 -06:00
|
|
|
import.rs \
|
|
|
|
import2.rs \
|
2011-01-13 17:02:54 -06:00
|
|
|
import3.rs \
|
2011-01-13 22:19:42 -06:00
|
|
|
import4.rs \
|
2011-01-17 17:13:55 -06:00
|
|
|
import-loop.rs \
|
|
|
|
import-loop-2.rs \
|
2011-01-26 11:06:19 -06:00
|
|
|
multiline-comment-line-tracking.rs \
|
2011-01-30 13:28:18 -06:00
|
|
|
output-type-mismatch.rs \
|
|
|
|
rec-missing-fields.rs \
|
|
|
|
type-shadow.rs \
|
2010-11-23 19:02:08 -06:00
|
|
|
while-type-error.rs \
|
2011-01-30 13:28:18 -06:00
|
|
|
wrong-ret-type.rs \
|
2010-10-22 17:37:42 -05:00
|
|
|
), \
|
2010-10-22 16:46:03 -05:00
|
|
|
$(wildcard test/*/*.rs test/*/*.rc))
|
2010-10-22 15:43:25 -05:00
|
|
|
|
|
|
|
|
2010-07-05 00:41:04 -05:00
|
|
|
ifdef MINGW_CROSS
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_XFAILS_BOOT += test/run-pass/native-mod.rc
|
|
|
|
TEST_XFAILS_RUSTC += test/run-pass/native-mod.rc
|
2010-07-05 00:41:04 -05:00
|
|
|
endif
|
2010-06-16 16:30:45 -05:00
|
|
|
ifdef CFG_WINDOWSY
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_XFAILS_BOOT += test/run-pass/native-mod.rc
|
|
|
|
TEST_XFAILS_RUSTC += test/run-pass/native-mod.rc
|
2010-06-16 16:30:45 -05:00
|
|
|
endif
|
|
|
|
|
2010-06-23 23:03:09 -05:00
|
|
|
RPASS_RC := $(wildcard test/run-pass/*.rc)
|
|
|
|
RPASS_RS := $(wildcard test/run-pass/*.rs)
|
|
|
|
RFAIL_RC := $(wildcard test/run-fail/*.rc)
|
|
|
|
RFAIL_RS := $(wildcard test/run-fail/*.rs)
|
|
|
|
CFAIL_RC := $(wildcard test/compile-fail/*.rc)
|
|
|
|
CFAIL_RS := $(wildcard test/compile-fail/*.rs)
|
|
|
|
|
2010-08-04 17:29:59 -05:00
|
|
|
ifdef CHECK_XFAILS
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_RPASS_CRATES_BOOT := $(filter $(TEST_XFAILS_BOOT), $(RPASS_RC))
|
|
|
|
TEST_RPASS_CRATES_RUSTC := $(filter $(TEST_XFAILS_RUSTC), $(RPASS_RC))
|
|
|
|
TEST_RPASS_SOURCES_BOOT := $(filter $(TEST_XFAILS_BOOT), $(RPASS_RS))
|
|
|
|
TEST_RPASS_SOURCES_RUSTC := $(filter $(TEST_XFAILS_RUSTC), $(RPASS_RS))
|
2010-08-04 17:29:59 -05:00
|
|
|
else
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_RPASS_CRATES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(RPASS_RC))
|
|
|
|
TEST_RPASS_CRATES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(RPASS_RC))
|
|
|
|
TEST_RPASS_SOURCES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(RPASS_RS))
|
|
|
|
TEST_RPASS_SOURCES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(RPASS_RS))
|
2010-08-04 17:29:59 -05:00
|
|
|
endif
|
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
TEST_RPASS_EXES_BOOT := \
|
|
|
|
$(TEST_RPASS_CRATES_BOOT:.rc=.boot$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_RPASS_SOURCES_BOOT:.rs=.boot$(CFG_EXE_SUFFIX))
|
|
|
|
TEST_RPASS_EXES_RUSTC := \
|
|
|
|
$(TEST_RPASS_CRATES_RUSTC:.rc=.rustc$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_RPASS_SOURCES_RUSTC:.rs=.rustc$(CFG_EXE_SUFFIX))
|
|
|
|
|
|
|
|
TEST_RPASS_OUTS_BOOT := \
|
|
|
|
$(TEST_RPASS_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot.out)
|
|
|
|
TEST_RPASS_OUTS_RUSTC := \
|
|
|
|
$(TEST_RPASS_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc.out)
|
|
|
|
|
|
|
|
TEST_RPASS_TMPS_BOOT := \
|
|
|
|
$(TEST_RPASS_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
TEST_RPASS_TMPS_RUSTC := \
|
|
|
|
$(TEST_RPASS_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
|
|
|
|
|
|
|
|
TEST_RFAIL_CRATES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(RFAIL_RC))
|
|
|
|
TEST_RFAIL_CRATES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(RFAIL_RC))
|
|
|
|
TEST_RFAIL_SOURCES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(RFAIL_RS))
|
|
|
|
TEST_RFAIL_SOURCES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(RFAIL_RS))
|
|
|
|
|
|
|
|
TEST_RFAIL_EXES_BOOT := \
|
|
|
|
$(TEST_RFAIL_CRATES_BOOT:.rc=.boot$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_RFAIL_SOURCES_BOOT:.rs=.boot$(CFG_EXE_SUFFIX))
|
|
|
|
TEST_RFAIL_EXES_RUSTC := \
|
|
|
|
$(TEST_RFAIL_CRATES_RUSTC:.rc=.rustc$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_RFAIL_SOURCES_RUSTC:.rs=.rustc$(CFG_EXE_SUFFIX))
|
|
|
|
|
|
|
|
TEST_RFAIL_OUTS_BOOT := \
|
|
|
|
$(TEST_RFAIL_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot.out)
|
|
|
|
TEST_RFAIL_OUTS_RUSTC := \
|
|
|
|
$(TEST_RFAIL_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc.out)
|
|
|
|
|
|
|
|
TEST_RFAIL_TMPS_BOOT := \
|
|
|
|
$(TEST_RFAIL_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
TEST_RFAIL_TMPS_RUSTC := \
|
|
|
|
$(TEST_RFAIL_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CFAIL_CRATES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(CFAIL_RC))
|
|
|
|
TEST_CFAIL_CRATES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(CFAIL_RC))
|
|
|
|
TEST_CFAIL_SOURCES_BOOT := $(filter-out $(TEST_XFAILS_BOOT), $(CFAIL_RS))
|
|
|
|
TEST_CFAIL_SOURCES_RUSTC := $(filter-out $(TEST_XFAILS_RUSTC), $(CFAIL_RS))
|
|
|
|
|
|
|
|
TEST_CFAIL_EXES_BOOT := \
|
|
|
|
$(TEST_CFAIL_CRATES_BOOT:.rc=.boot$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_CFAIL_SOURCES_BOOT:.rs=.boot$(CFG_EXE_SUFFIX))
|
|
|
|
TEST_CFAIL_EXES_RUSTC := \
|
|
|
|
$(TEST_CFAIL_CRATES_RUSTC:.rc=.rustc$(CFG_EXE_SUFFIX)) \
|
|
|
|
$(TEST_CFAIL_SOURCES_RUSTC:.rs=.rustc$(CFG_EXE_SUFFIX))
|
|
|
|
|
|
|
|
TEST_CFAIL_OUTS_BOOT := \
|
|
|
|
$(TEST_CFAIL_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot.out)
|
|
|
|
TEST_CFAIL_OUTS_RUSTC := \
|
|
|
|
$(TEST_CFAIL_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc.out)
|
|
|
|
|
|
|
|
TEST_CFAIL_TMPS_BOOT := \
|
|
|
|
$(TEST_CFAIL_EXES_BOOT:.boot$(CFG_EXE_SUFFIX)=.boot$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
TEST_CFAIL_TMPS_RUSTC := \
|
|
|
|
$(TEST_CFAIL_EXES_RUSTC:.rustc$(CFG_EXE_SUFFIX)=.rustc$(CFG_EXE_SUFFIX).tmp)
|
|
|
|
|
|
|
|
|
|
|
|
ALL_TEST_CRATES := $(TEST_CFAIL_CRATES_BOOT) \
|
|
|
|
$(TEST_RFAIL_CRATES_BOOT) \
|
|
|
|
$(TEST_RPASS_CRATES_BOOT)
|
|
|
|
|
|
|
|
ALL_TEST_SOURCES := $(TEST_CFAIL_SOURCES_BOOT) \
|
|
|
|
$(TEST_RFAIL_SOURCES_BOOT) \
|
|
|
|
$(TEST_RPASS_SOURCES_BOOT)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
ALL_TEST_INPUTS := $(wildcard test/*/*.rs test/*/*/*.rs test/*/*.rc)
|
|
|
|
|
2010-12-29 00:04:43 -06:00
|
|
|
# The test suite currently relies on logging to validate results so
|
|
|
|
# make sure that logging uses the default configuration
|
|
|
|
unexport RUST_LOG
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
check_nocompile: $(TEST_CFAIL_OUTS_BOOT)
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
check: tidy \
|
2010-12-29 19:46:22 -06:00
|
|
|
$(TEST_RPASS_EXES_BOOT) $(TEST_RFAIL_EXES_BOOT) \
|
|
|
|
$(TEST_RPASS_OUTS_BOOT) $(TEST_RFAIL_OUTS_BOOT) \
|
|
|
|
$(TEST_CFAIL_OUTS_BOOT)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-07-01 20:37:53 -05:00
|
|
|
compile-check: tidy \
|
2010-12-29 19:46:22 -06:00
|
|
|
$(TEST_RPASS_EXES_BOOT) $(TEST_RFAIL_EXES_BOOT)
|
2010-07-01 20:37:53 -05:00
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
ifdef CFG_LLVM_CONFIG
|
2010-10-28 17:22:37 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
ALL_TEST_CRATES += $(TEST_CFAIL_CRATES_RUSTC) \
|
|
|
|
$(TEST_RFAIL_CRATES_RUSTC) \
|
|
|
|
$(TEST_RPASS_CRATES_RUSTC)
|
2010-10-22 16:46:03 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
ALL_TEST_SOURCES += $(TEST_CFAIL_SOURCES_RUSTC) \
|
|
|
|
$(TEST_RFAIL_SOURCES_RUSTC) \
|
|
|
|
$(TEST_RPASS_SOURCES_RUSTC)
|
2010-10-22 16:46:03 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
check_nocompile: $(TEST_CFAIL_OUTS_RUSTC)
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-06-23 23:03:09 -05:00
|
|
|
check: tidy \
|
2010-12-29 19:46:22 -06:00
|
|
|
$(TEST_RPASS_EXES_RUSTC) $(TEST_RFAIL_EXES_RUSTC) \
|
|
|
|
$(TEST_RPASS_OUTS_RUSTC) $(TEST_RFAIL_OUTS_RUSTC) \
|
|
|
|
$(TEST_CFAIL_OUTS_RUSTC)
|
2010-07-20 16:00:03 -05:00
|
|
|
|
|
|
|
compile-check: tidy \
|
2010-12-29 19:46:22 -06:00
|
|
|
$(TEST_RPASS_EXES_RUSTC) $(TEST_RFAIL_EXES_RUSTC)
|
2010-07-20 16:00:03 -05:00
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
endif
|
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
BREQ := $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
|
|
|
|
SREQ := $(CFG_RUSTC) $(CFG_RUNTIME) $(CFG_STDLIB)
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2010-07-02 14:54:01 -05:00
|
|
|
# Cancel the implicit .out rule in GNU make.
|
|
|
|
%.out: %
|
|
|
|
|
|
|
|
%.out: %.out.tmp
|
|
|
|
$(CFG_QUIET)mv $< $@
|
|
|
|
|
|
|
|
test/run-pass/%.out.tmp: test/run-pass/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME)
|
2010-08-20 14:48:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $<.tmp
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, run: $<)
|
|
|
|
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@
|
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) \
|
2010-10-22 19:23:53 -05:00
|
|
|
$(CFG_RUNTIME)
|
2010-08-20 14:48:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $<.tmp
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, run: $<)
|
2011-01-10 16:53:20 -06:00
|
|
|
$(CFG_QUIET)grep -q error-pattern test/run-fail/$(basename $*).rs
|
2010-06-16 16:30:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $@
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) >$@ 2>&1 ; X=$$? ; \
|
|
|
|
if [ $$X -eq 0 ] ; then exit 1 ; else exit 0 ; fi
|
|
|
|
$(CFG_QUIET)grep --text --quiet \
|
2011-01-26 10:24:49 -06:00
|
|
|
"$$(grep error-pattern test/run-fail/$(basename $*).rs \
|
|
|
|
| cut -d : -f 2- | tr -d '\n\r')" $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/compile-fail/%.boot.out.tmp: test/compile-fail/%.rs $(BREQ)
|
|
|
|
@$(call CFG_ECHO, compile [boot]: $<)
|
2011-01-10 16:53:20 -06:00
|
|
|
$(CFG_QUIET)grep -q error-pattern $<
|
2010-06-16 16:30:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $@
|
2011-01-10 16:53:20 -06:00
|
|
|
$(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1; test $$? -ne 0
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)grep --text --quiet \
|
2011-01-26 10:24:49 -06:00
|
|
|
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2011-01-03 16:20:00 -06:00
|
|
|
test/compile-fail/%.rustc.out.tmp: test/compile-fail/%.rs $(SREQ)
|
2010-11-22 19:38:23 -06:00
|
|
|
@$(call CFG_ECHO, compile [rustc]: $<)
|
2011-01-10 16:53:20 -06:00
|
|
|
$(CFG_QUIET)grep -q error-pattern $<
|
2010-11-22 19:38:23 -06:00
|
|
|
$(CFG_QUIET)rm -f $@
|
2011-01-10 16:53:20 -06:00
|
|
|
$(RUSTC) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1; test $$? -ne 0
|
2010-11-22 19:38:23 -06:00
|
|
|
$(CFG_QUIET)grep --text --quiet \
|
2011-01-26 10:24:49 -06:00
|
|
|
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
|
2010-11-22 19:38:23 -06:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/run-pass/%.boot$(CFG_EXE_SUFFIX): test/run-pass/%.rc $(BREQ)
|
|
|
|
@$(call CFG_ECHO, compile [boot]: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(BOOT) -o $@ $<
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/bench/shootout/%.boot$(CFG_EXE_SUFFIX): \
|
2010-10-22 16:46:03 -05:00
|
|
|
test/bench/shootout/%.rs $(BREQ)
|
2010-12-29 19:46:22 -06:00
|
|
|
@$(call CFG_ECHO, compile [boot]: $<)
|
2010-07-08 23:56:03 -05:00
|
|
|
$(BOOT) -o $@ $<
|
|
|
|
|
2010-07-19 22:46:20 -05:00
|
|
|
%.ll: %.bc
|
|
|
|
@$(call CFG_ECHO, dis [llvm]: $<)
|
|
|
|
$(CFG_QUIET)$(LLVM-DIS) -o $@ $<
|
|
|
|
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
%.s: %.bc
|
|
|
|
@$(call CFG_ECHO, compile [llvm]: $<)
|
2010-07-17 15:26:23 -05:00
|
|
|
$(CFG_QUIET)$(LLC) $(CFG_LLC_CFLAGS) -o $@ $<
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-07-18 18:39:10 -05:00
|
|
|
%.o: %.s
|
|
|
|
@$(call CFG_ECHO, assemble [llvm]: $<)
|
|
|
|
$(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ -c $<
|
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
%.rustc$(CFG_EXE_SUFFIX): %.o $(CFG_RUNTIME)
|
2010-07-18 18:39:10 -05:00
|
|
|
@$(call CFG_ECHO, link [llvm]: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ $< -L. -lrustrt
|
2010-07-18 18:39:10 -05:00
|
|
|
@# dsymutil sometimes fails or prints a warning, but the
|
|
|
|
@# program still runs. Since it simplifies debugging other
|
|
|
|
@# programs, I\'ll live with the noise.
|
|
|
|
-$(CFG_QUIET)$(DSYMUTIL) $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
test/run-pass/%.bc: test/run-pass/%.rc $(SREQ)
|
|
|
|
@$(call CFG_ECHO, compile [rustc]: $<)
|
2010-12-29 19:46:22 -06:00
|
|
|
$(RUSTC) -o $@ $<
|
2010-10-22 16:46:03 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/run-pass/%.boot$(CFG_EXE_SUFFIX): test/run-pass/%.rs $(BREQ)
|
|
|
|
@$(call CFG_ECHO, compile [boot]: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(BOOT) -o $@ $<
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-10-22 16:46:03 -05:00
|
|
|
test/run-pass/%.bc: test/run-pass/%.rs $(SREQ)
|
|
|
|
@$(call CFG_ECHO, compile [rustc]: $<)
|
2010-12-29 19:46:22 -06:00
|
|
|
$(RUSTC) -o $@ $<
|
2010-10-22 16:46:03 -05:00
|
|
|
|
2010-12-29 19:46:22 -06:00
|
|
|
test/run-fail/%.boot$(CFG_EXE_SUFFIX): test/run-fail/%.rs $(BREQ)
|
|
|
|
@$(call CFG_ECHO, compile [boot]: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(BOOT) -o $@ $<
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2011-01-04 19:37:51 -06:00
|
|
|
test/run-fail/%.bc: test/run-fail/%.rs $(SREQ)
|
2010-10-22 16:46:03 -05:00
|
|
|
@$(call CFG_ECHO, compile [rustc]: $<)
|
2010-12-29 19:46:22 -06:00
|
|
|
$(RUSTC) -o $@ $<
|
2010-10-22 16:46:03 -05:00
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Auto-dependency
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
ML_DEPFILES := $(BOOT_MLS:%.ml=%.d)
|
|
|
|
C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d)
|
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
%.d: %.cpp $(MKFILES)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)$(call CFG_DEPEND_C, $@ \
|
|
|
|
$(patsubst %.cpp, %$(CFG_OBJ_SUFFIX), $<), \
|
2010-09-22 16:47:31 -05:00
|
|
|
$(RUNTIME_INCS)) $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
%.d: %.ml $(MKFILES)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(CFG_QUIET)ocamldep$(OPT) $(ML_DEP_INCS) $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
%.d: %.mli $(MKFILES)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(CFG_QUIET)ocamldep$(OPT) $(ML_DEP_INCS) $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
-include $(ML_DEPFILES) $(C_DEPFILES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
RUSTBOOT_PROBE := $(wildcard $(CFG_BOOT))
|
|
|
|
|
|
|
|
ifneq ($(RUSTBOOT_PROBE),)
|
|
|
|
CFG_INFO := $(info cfg: using built $(CFG_BOOT) for rust deps)
|
|
|
|
STDLIB_DEPFILE := $(CFG_STDLIB).d
|
|
|
|
CRATE_DEPFILES := $(ALL_TEST_CRATES:%.rc=%.d) $(STDLIB_DEPFILE)
|
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
$(STDLIB_DEPFILE): $(STDLIB_CRATE) $(MKFILES) $(CFG_BOOT)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(BOOT) -shared -rdeps $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
%.d: %.rc $(MKFILES) $(CFG_BOOT)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(BOOT) -rdeps $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-06-29 12:30:36 -05:00
|
|
|
%.d: %.rs $(MKFILES) $(CFG_BOOT)
|
2010-06-16 16:30:45 -05:00
|
|
|
@$(call CFG_ECHO, dep: $<)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(BOOT) -rdeps $< $(CFG_PATH_MUNGE) >$@.tmp \
|
|
|
|
&& mv $@.tmp $@
|
2010-06-16 16:30:45 -05:00
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
-include $(CRATE_DEPFILES)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Distribution
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
PKG_NAME := rust
|
|
|
|
PKG_VER := $(shell date +"%Y-%m-%d")-snap
|
|
|
|
PKG_DIR := $(PKG_NAME)-$(PKG_VER)
|
|
|
|
PKG_TAR := $(PKG_DIR).tar.gz
|
|
|
|
PKG_3RDPARTY := rt/valgrind.h rt/memcheck.h \
|
|
|
|
rt/isaac/rand.h rt/isaac/standard.h \
|
|
|
|
rt/uthash/uthash.h rt/uthash/utlist.h \
|
|
|
|
rt/bigint/bigint.h rt/bigint/bigint_int.cpp \
|
|
|
|
rt/bigint/bigint_ext.cpp rt/bigint/low_primes.h
|
2010-07-11 16:54:43 -05:00
|
|
|
PKG_FILES := README boot/README \
|
2010-06-23 23:03:09 -05:00
|
|
|
$(wildcard etc/*.*) \
|
2010-06-16 16:30:45 -05:00
|
|
|
$(MKFILES) $(BOOT_MLS) boot/fe/lexer.mll \
|
2010-06-23 23:03:09 -05:00
|
|
|
$(COMPILER_INPUTS) \
|
2010-06-16 16:30:45 -05:00
|
|
|
$(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
|
|
|
$(RUNTIME_CS) $(RUNTIME_HDR) $(PKG_3RDPARTY) \
|
|
|
|
$(ALL_TEST_INPUTS)
|
|
|
|
|
|
|
|
dist:
|
|
|
|
@$(call CFG_ECHO, making dist dir)
|
|
|
|
$(CFG_QUIET)mkdir -p dist/$(PKG_DIR)
|
|
|
|
$(CFG_QUIET)tar -c $(PKG_FILES) | tar -x -C dist/$(PKG_DIR)
|
|
|
|
$(CFG_QUIET)cp ../LICENSE.txt dist/$(PKG_DIR)
|
|
|
|
$(CFG_QUIET)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
|
|
|
|
$(CFG_QUIET)rm -Rf dist
|
|
|
|
|
|
|
|
distcheck:
|
|
|
|
@$(call CFG_ECHO, making dist dir)
|
|
|
|
$(CFG_QUIET)rm -Rf $(PKG_NAME)-*.tar.gz dist
|
|
|
|
$(CFG_QUIET)mkdir -p dist/$(PKG_DIR)
|
|
|
|
$(CFG_QUIET)tar -c $(PKG_FILES) | tar -x -C dist/$(PKG_DIR)
|
|
|
|
@$(call CFG_ECHO, making 'check' in dist dir)
|
|
|
|
$(CFG_QUIET)make -C dist/$(PKG_DIR) check
|
|
|
|
$(CFG_QUIET)make -C dist/$(PKG_DIR) clean
|
|
|
|
@$(call CFG_ECHO, making tarball)
|
|
|
|
$(CFG_QUIET)cp ../LICENSE.txt dist/$(PKG_DIR)
|
|
|
|
$(CFG_QUIET)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
|
|
|
|
$(CFG_QUIET)rm -Rf dist
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_TAR) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Cleanup
|
|
|
|
######################################################################
|
|
|
|
|
2010-07-06 15:51:39 -05:00
|
|
|
.PHONY: clean native-clean tidy
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
tidy:
|
|
|
|
@$(call CFG_ECHO, check: formatting)
|
|
|
|
$(CFG_QUIET) python etc/tidy.py \
|
|
|
|
$(wildcard ../*.txt) \
|
|
|
|
../README \
|
2010-10-13 17:21:42 -05:00
|
|
|
$(filter-out $(GENERATED) $(PKG_3RDPARTY) etc/%, $(PKG_FILES))
|
2010-06-16 16:30:45 -05:00
|
|
|
|
2010-07-06 15:51:39 -05:00
|
|
|
runtime-clean:
|
|
|
|
$(CFG_QUIET)rm -f $(RUNTIME_OBJS) $(CFG_RUNTIME)
|
|
|
|
|
2010-06-16 16:30:45 -05:00
|
|
|
clean:
|
|
|
|
@$(call CFG_ECHO, cleaning)
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)rm -f $(RUNTIME_OBJS)
|
|
|
|
$(CFG_QUIET)rm -f $(BOOT_CMOS) $(BOOT_CMIS) $(BOOT_CMXS) $(BOOT_OBJS)
|
2010-10-22 16:46:03 -05:00
|
|
|
$(CFG_QUIET)rm -f $(CFG_RUSTC)
|
2010-06-16 16:30:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $(ML_DEPFILES) $(C_DEPFILES) $(CRATE_DEPFILES)
|
2010-09-22 16:47:31 -05:00
|
|
|
$(CFG_QUIET)rm -f $(ML_DEPFILES:%.d=%.d.tmp)
|
|
|
|
$(CFG_QUIET)rm -f $(C_DEPFILES:%.d=%.d.tmp)
|
|
|
|
$(CFG_QUIET)rm -f $(CRATE_DEPFILES:%.d=%.d.tmp)
|
2010-07-03 02:27:33 -05:00
|
|
|
$(CFG_QUIET)rm -f $(GENERATED)
|
2010-06-16 16:30:45 -05:00
|
|
|
$(CFG_QUIET)rm -f $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
|
|
|
|
$(CFG_QUIET)rm -Rf $(PKG_NAME)-*.tar.gz dist
|
2010-06-23 23:03:09 -05:00
|
|
|
$(CFG_QUIET)rm -f $(foreach ext,cmx cmi cmo cma o a d exe,\
|
2010-12-29 19:46:22 -06:00
|
|
|
$(wildcard boot/*/*.$(ext) boot/*/*/*.$(ext)))
|
|
|
|
$(CFG_QUIET)rm -Rf $(foreach ext,out llvm x86 boot rustc o s exe dSYM,\
|
|
|
|
$(wildcard test/*/*.$(ext)))
|
2010-09-08 21:13:49 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Local Variables:
|
|
|
|
# mode: makefile-gmake
|
|
|
|
# fill-column: 78;
|
|
|
|
# buffer-file-coding-system: utf-8-unix
|
|
|
|
# compile-command: "make -k 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
|
|
|
# End:
|