rust/src/Makefile

960 lines
33 KiB
Makefile
Raw Normal View History

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 :=
CFG_LLVM_CONFIG ?= llvm-config
2010-06-23 23:03:09 -05:00
CFG_BOOT_FLAGS := $(FLAGS)
2010-06-16 16:30:45 -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
CFG_GCC_CFLAGS += -fPIC -march=i686
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 \
--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!
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
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
CFG_COMPILER := ./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
CFG_COMPILER := ./rustc
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
CFG_COMPILER := ./rustc.exe
ifdef CFG_VALGRIND
CFG_VALGRIND += wine
endif
CFG_OBJ_SUFFIX := .o
CFG_EXE_SUFFIX := .exe
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
NO_LLVM := 1
2010-06-16 16:30:45 -05:00
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
ifdef NO_VALGRIND
CFG_VALGRIND :=
endif
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)
ifeq ($(CFG_LLVM_VERSION),2.8svn)
$(info cfg: using LLVM version 2.8svn)
WHERE := $(shell $(CFG_LLVM_CONFIG) --libdir)/ocaml
ifneq ($(shell test -e $(WHERE)/llvm.cma && echo ok),ok)
CFG_LLVM_CONFIG := $(info cfg: LLVM ocaml bindings not found)
endif
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), \
expected 2.8svn)
2010-06-16 16:30:45 -05:00
endif
endif
ifdef CFG_LLVM_CONFIG
VARIANT=llvm
LLVM_LIBS := llvm.cma llvm_bitwriter.cma
2010-07-17 16:58:01 -05:00
LLVM_NATIVE_LIBS := llvm.cmxa llvm_bitwriter.cmxa
2010-06-23 23:03:09 -05:00
LLVM_CLIBS := $(shell for c in `$(CFG_LLVM_CONFIG) --ldflags --libs` \
-lllvm -lllvm_bitwriter; do echo -cclib && echo $$c; done | xargs echo)
2010-06-16 16:30:45 -05:00
LLVM_INCS := -I boot/llvm -I $(WHERE)
2010-06-23 23:03:09 -05:00
LLVM_MLS := $(addprefix boot/llvm/, llabi.ml llasm.ml llfinal.ml \
lltrans.ml llemit.ml)
LLC := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llc"
2010-06-23 23:03:09 -05:00
CFG_LLC_CFLAGS := -march=x86
LLVM-DIS := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llvm-dis"
2010-06-16 16:30:45 -05:00
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
else
VARIANT=x86
LLVM_CLIBS :=
LLVM_INCS :=
LLVM_MLS :=
$(info cfg: disabling LLVM backend)
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 .
######################################################################
# Boot targets and rules
######################################################################
ML_DEP_INCS := -I boot/fe -I boot/me -I boot/be -I boot/driver/$(VARIANT) \
2010-07-17 16:58:01 -05:00
-I boot/driver -I boot/util -I boot/llvm
ML_INCS := $(ML_DEP_INCS) $(LLVM_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
ifdef CFG_LLVM_CONFIG
ML_LIBS += $(LLVM_LIBS) -custom -cclib -lstdc++ $(LLVM_CLIBS)
ML_NATIVE_LIBS += $(LLVM_NATIVE_LIBS) -cclib -lstdc++ $(LLVM_CLIBS)
endif
# List them in link order.
# Nobody calculates the link-order DAG automatically, sadly.
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 \
type.ml dead.ml effect.ml typestate.ml loop.ml layout.ml \
transutil.ml trans.ml dwarf.ml)
FE_MLS := $(addprefix boot/fe/, ast.ml token.ml lexer.ml parser.ml pexp.ml \
item.ml cexp.ml)
DRIVER_TOP_MLS := $(addprefix boot/driver/, lib.ml $(VARIANT)/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) \
$(BE_MLS) $(LLVM_MLS) $(DRIVER_TOP_MLS)
BOOT_CMOS := $(BOOT_MLS:.ml=.cmo)
BOOT_CMXS := $(BOOT_MLS:.ml=.cmx)
BOOT_OBJS := $(BOOT_MLS:.ml=.o)
BOOT_CMIS := $(BOOT_MLS:.ml=.cmi)
RUNTIME_CS := rt/sync/timer.cpp \
rt/sync/sync.cpp \
rt/sync/lock_and_signal.cpp \
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 \
rt/rust_task_list.cpp \
rt/rust_proxy.cpp \
2010-06-23 23:03:09 -05:00
rt/rust_chan.cpp \
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 \
rt/rust_message.cpp \
2010-06-23 23:03:09 -05:00
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
2010-06-23 23:03:09 -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 \
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_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
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)
GENERATED := boot/fe/lexer.ml boot/util/version.ml
all: $(CFG_COMPILER) $(MKFILES) $(GENERATED)
boot/util/version.ml: Makefile
$(CFG_QUIET)git log -1 \
--format='let version = "prerelease (%h %ci)";;' >$@ || exit 1
2010-06-16 16:30:45 -05:00
loc:
$(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: $<)
2010-06-23 23:03:09 -05:00
$(CFG_QUIET)OCAMLRUNPARAM="b1" $(CFG_BOOT) $(CFG_BOOT_FLAGS) \
-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-06-23 23:03:09 -05:00
$(CFG_COMPILER): $(COMPILER_INPUTS) $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile: $<)
$(CFG_QUIET)OCAMLRUNPARAM="b1" $(CFG_BOOT) $(CFG_BOOT_FLAGS) -o $@ $<
$(CFG_QUIET)chmod 0755 $@
self: $(CFG_COMPILER)
@$(call CFG_ECHO, compile: $<)
$(CFG_QUIET)$(call CFG_RUN_TARG, $(CFG_COMPILER)) $(COMPILER_CRATE)
######################################################################
# Testing
######################################################################
# Temporarily xfail tests broken by the nominal-tags change.
NOMINAL_TAG_XFAILS := test/run-pass/mlist.rs
# Temporarily xfail some of the task tests, while debugging the
# overhauled inter-domain messaging system.
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
TEST_XFAILS_X86 := $(TASK_XFAILS) \
$(NOMINAL_TAG_XFAILS) \
test/run-pass/child-outlives-parent.rs \
2010-06-16 16:30:45 -05:00
test/run-pass/clone-with-exterior.rs \
test/run-pass/constrained-type.rs \
test/run-pass/destructor-ordering.rs \
test/run-pass/obj-as.rs \
test/run-pass/vec-slice.rs \
test/run-pass/fn-lval.rs \
2010-06-16 16:30:45 -05:00
test/run-pass/generic-fn-infer.rs \
2010-06-23 23:03:09 -05:00
test/run-pass/generic-recursive-tag.rs \
test/run-pass/iter-ret.rs \
test/run-pass/lib-io.rs \
test/run-pass/mlist-cycle.rs \
test/run-pass/obj-as.rs \
2010-06-23 23:03:09 -05:00
test/run-pass/task-comm.rs \
test/run-pass/vec-slice.rs \
2010-07-20 14:15:44 -05:00
test/run-pass/task-comm-3.rs \
test/run-fail/task-comm-14.rs \
test/compile-fail/bad-recv.rs \
test/compile-fail/bad-send.rs \
2010-06-16 16:30:45 -05:00
test/compile-fail/infinite-tag-type-recursion.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
TEST_XFAILS_LLVM := $(TASK_XFAILS) \
$(NOMINAL_TAG_XFAILS) \
$(addprefix test/run-pass/, \
2010-08-09 10:49:54 -05:00
arith-1.rs \
2010-06-16 16:30:45 -05:00
acyclic-unwind.rs \
alt-pattern-drop.rs \
alt-pattern-simple.rs \
2010-06-16 16:30:45 -05:00
alt-tag.rs \
append-units.rs \
argv.rs \
autoderef-full-lval.rs \
autoderef-objfn.rs \
auto-instantiate.rs \
2010-06-16 16:30:45 -05:00
basic.rs \
2010-08-09 10:49:54 -05:00
basic-1.rs \
basic-2.rs \
bind-exterior.rs \
2010-06-16 16:30:45 -05:00
bind-obj-ctor.rs \
bind-thunk.rs \
bind-trivial.rs \
2010-06-23 23:03:09 -05:00
bitwise.rs \
bool-not.rs \
box-in-tup.rs \
2010-06-23 23:03:09 -05:00
box-unbox.rs \
2010-06-16 16:30:45 -05:00
cast.rs \
child-outlives-parent.rs \
2010-06-16 16:30:45 -05:00
clone-with-exterior.rs \
comm.rs \
2010-06-23 23:03:09 -05:00
command-line-args.rs \
2010-06-16 16:30:45 -05:00
complex.rs \
constrained-type.rs \
2010-06-16 16:30:45 -05:00
deep.rs \
2010-07-02 14:55:12 -05:00
deref.rs \
destructor-ordering.rs \
2010-06-23 23:03:09 -05:00
export-non-interference.rs \
2010-06-16 16:30:45 -05:00
exterior.rs \
fn-lval.rs \
foreach-nested-2.rs \
foreach-nested.rs \
2010-06-16 16:30:45 -05:00
foreach-put-structured.rs \
2010-06-23 23:03:09 -05:00
foreach-simple-outer-slot.rs \
foreach-simple.rs \
2010-06-16 16:30:45 -05:00
fun-call-variants.rs \
fun-indirect-call.rs \
generic-derived-type.rs \
generic-drop-glue.rs \
2010-06-23 23:03:09 -05:00
generic-exterior-box.rs \
generic-fn-infer.rs \
2010-06-16 16:30:45 -05:00
generic-fn.rs \
generic-obj-with-derived-type.rs \
2010-06-23 23:03:09 -05:00
generic-obj.rs \
generic-recursive-tag.rs \
generic-tag-alt.rs \
generic-tag-values.rs \
2010-06-16 16:30:45 -05:00
generic-tag.rs \
i32-sub.rs \
i8-incr.rs \
2010-06-23 23:03:09 -05:00
import.rs \
integral-indexing.rs \
iter-range.rs \
iter-ret.rs \
2010-06-16 16:30:45 -05:00
large-records.rs \
2010-06-23 23:03:09 -05:00
lazy-and-or.rs \
lazy-init.rs \
2010-06-16 16:30:45 -05:00
lazychan.rs \
lib-deque.rs \
lib-int.rs \
lib-io.rs \
lib-map.rs \
lib-rand.rs \
lib-str.rs \
lib-task.rs \
lib-uint.rs \
lib-vec.rs \
lib-vec-str-conversions.rs \
2010-06-16 16:30:45 -05:00
linear-for-loop.rs \
2010-06-23 23:03:09 -05:00
list.rs \
2010-06-16 16:30:45 -05:00
many.rs \
2010-06-23 23:03:09 -05:00
mlist-cycle.rs \
2010-06-16 16:30:45 -05:00
mlist.rs \
mutable-alias-vec.rs \
2010-06-23 23:03:09 -05:00
mutable-vec-drop.rs \
2010-06-16 16:30:45 -05:00
mutual-recursion-group.rs \
2010-06-23 23:03:09 -05:00
obj-as.rs \
obj-drop.rs \
obj-dtor.rs \
2010-06-25 17:42:24 -05:00
obj-recursion.rs \
obj-return-polytypes.rs \
2010-06-23 23:03:09 -05:00
obj-with-vec.rs \
operator-associativity.rs \
output-slot-variants.rs \
over-constrained-vregs.rs \
2010-06-16 16:30:45 -05:00
pred.rs \
preempt.rs \
2010-06-16 16:30:45 -05:00
readalias.rs \
rec-auto.rs \
rec-extend.rs \
2010-06-23 23:03:09 -05:00
rec-tup.rs \
2010-06-16 16:30:45 -05:00
rec.rs \
2010-06-23 23:03:09 -05:00
simple-obj.rs \
size-and-align.rs \
2010-06-16 16:30:45 -05:00
spawn-fn.rs \
spawn-module-qualified.rs \
2010-06-16 16:30:45 -05:00
spawn.rs \
stateful-obj.rs \
str-append.rs \
str-concat.rs \
str-idx.rs \
tag.rs \
tail-cps.rs \
tail-direct.rs \
task-comm.rs \
task-comm-0.rs \
task-comm-1.rs \
task-comm-2.rs \
task-comm-3.rs \
task-comm-4.rs \
task-comm-5.rs \
2010-07-28 18:58:17 -05:00
task-comm-6.rs \
task-comm-7.rs \
task-comm-8.rs \
task-comm-9.rs \
2010-08-16 17:04:33 -05:00
task-comm-10.rs \
task-comm-11.rs \
task-comm-12.rs \
task-comm-13.rs \
task-comm-13-thread.rs \
task-comm-15.rs \
2010-08-16 17:04:33 -05:00
task-life-0.rs \
2010-06-16 16:30:45 -05:00
threads.rs \
2010-06-23 23:03:09 -05:00
type-sizes.rs \
u8-incr.rs \
u8-incr-decr.rs \
u32-decr.rs \
uint.rs \
2010-06-16 16:30:45 -05:00
unit.rs \
use-import-export.rs \
user.rs \
2010-06-23 23:03:09 -05:00
utf8.rs \
vec-alloc-append.rs \
2010-06-23 23:03:09 -05:00
vec-append.rs \
vec-concat.rs \
vec-drop.rs \
vec-in-tup.rs \
vec-late-init.rs \
2010-06-23 23:03:09 -05:00
vec-slice.rs \
2010-06-16 16:30:45 -05:00
vec.rs \
while-flow-graph.rs \
2010-06-16 16:30:45 -05:00
writealias.rs \
yield.rs \
yield2.rs \
) \
$(addprefix test/run-fail/, \
explicit-fail.rs \
fail.rs \
linked-failure.rs \
pred.rs \
2010-06-23 23:03:09 -05:00
str-overrun.rs \
vec-overrun.rs \
2010-06-23 23:03:09 -05:00
vec-underrun.rs \
task-comm-14.rs \
2010-06-16 16:30:45 -05:00
) \
$(addprefix test/compile-fail/, \
bad-recv.rs \
bad-send.rs \
2010-06-16 16:30:45 -05:00
infinite-tag-type-recursion.rs \
infinite-vec-type-recursion.rs \
rec-missing-fields.rs \
writing-through-read-alias.rs \
2010-06-16 16:30:45 -05:00
)
ifdef MINGW_CROSS
TEST_XFAILS_X86 += test/run-pass/native-mod.rc
TEST_XFAILS_LLVM += test/run-pass/native-mod.rc
endif
2010-06-16 16:30:45 -05:00
ifdef CFG_WINDOWSY
2010-06-23 23:03:09 -05:00
TEST_XFAILS_X86 += test/run-pass/native-mod.rc
TEST_XFAILS_LLVM += 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)
ifdef CHECK_XFAILS
TEST_RPASS_CRATES_X86 := $(filter $(TEST_XFAILS_X86), $(RPASS_RC))
TEST_RPASS_CRATES_LLVM := $(filter $(TEST_XFAILS_LLVM), $(RPASS_RC))
TEST_RPASS_SOURCES_X86 := $(filter $(TEST_XFAILS_X86), $(RPASS_RS))
TEST_RPASS_SOURCES_LLVM := $(filter $(TEST_XFAILS_LLVM), $(RPASS_RS))
else
2010-06-23 23:03:09 -05:00
TEST_RPASS_CRATES_X86 := $(filter-out $(TEST_XFAILS_X86), $(RPASS_RC))
TEST_RPASS_CRATES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(RPASS_RC))
TEST_RPASS_SOURCES_X86 := $(filter-out $(TEST_XFAILS_X86), $(RPASS_RS))
TEST_RPASS_SOURCES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(RPASS_RS))
endif
2010-06-23 23:03:09 -05:00
TEST_RPASS_EXTRAS := $(wildcard test/run-pass/*/*.rs)
TEST_RPASS_EXES_X86 := \
$(TEST_RPASS_CRATES_X86:.rc=.x86$(CFG_EXE_SUFFIX)) \
$(TEST_RPASS_SOURCES_X86:.rs=.x86$(CFG_EXE_SUFFIX))
TEST_RPASS_EXES_LLVM := \
$(TEST_RPASS_CRATES_LLVM:.rc=.llvm$(CFG_EXE_SUFFIX)) \
$(TEST_RPASS_SOURCES_LLVM:.rs=.llvm$(CFG_EXE_SUFFIX))
TEST_RPASS_OUTS_X86 := \
$(TEST_RPASS_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86.out)
TEST_RPASS_OUTS_LLVM := \
$(TEST_RPASS_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm.out)
TEST_RPASS_TMPS_X86 := \
$(TEST_RPASS_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86$(CFG_EXE_SUFFIX).tmp)
TEST_RPASS_TMPS_LLVM := \
$(TEST_RPASS_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm$(CFG_EXE_SUFFIX).tmp)
2010-06-23 23:03:09 -05:00
TEST_RFAIL_CRATES_X86 := $(filter-out $(TEST_XFAILS_X86), $(RFAIL_RC))
TEST_RFAIL_CRATES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(RFAIL_RC))
TEST_RFAIL_SOURCES_X86 := $(filter-out $(TEST_XFAILS_X86), $(RFAIL_RS))
TEST_RFAIL_SOURCES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(RFAIL_RS))
TEST_RFAIL_EXTRAS := $(wildcard test/run-fail/*/*.rs)
TEST_RFAIL_EXES_X86 := \
$(TEST_RFAIL_CRATES_X86:.rc=.x86$(CFG_EXE_SUFFIX)) \
$(TEST_RFAIL_SOURCES_X86:.rs=.x86$(CFG_EXE_SUFFIX))
TEST_RFAIL_EXES_LLVM := \
$(TEST_RFAIL_CRATES_LLVM:.rc=.llvm$(CFG_EXE_SUFFIX)) \
$(TEST_RFAIL_SOURCES_LLVM:.rs=.llvm$(CFG_EXE_SUFFIX))
TEST_RFAIL_OUTS_X86 := \
$(TEST_RFAIL_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86.out)
TEST_RFAIL_OUTS_LLVM := \
$(TEST_RFAIL_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm.out)
TEST_RFAIL_TMPS_X86 := \
$(TEST_RFAIL_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86$(CFG_EXE_SUFFIX).tmp)
TEST_RFAIL_TMPS_LLVM := \
$(TEST_RFAIL_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm$(CFG_EXE_SUFFIX).tmp)
2010-06-23 23:03:09 -05:00
TEST_CFAIL_CRATES_X86 := $(filter-out $(TEST_XFAILS_X86), $(CFAIL_RC))
TEST_CFAIL_CRATES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(CFAIL_RC))
TEST_CFAIL_SOURCES_X86 := $(filter-out $(TEST_XFAILS_X86), $(CFAIL_RS))
TEST_CFAIL_SOURCES_LLVM := $(filter-out $(TEST_XFAILS_LLVM), $(CFAIL_RS))
TEST_CFAIL_EXTRAS := $(wildcard test/compile-fail/*/*.rs)
TEST_CFAIL_EXES_X86 := \
$(TEST_CFAIL_CRATES_X86:.rc=.x86$(CFG_EXE_SUFFIX)) \
$(TEST_CFAIL_SOURCES_X86:.rs=.x86$(CFG_EXE_SUFFIX))
TEST_CFAIL_EXES_LLVM := \
$(TEST_CFAIL_CRATES_LLVM:.rc=.llvm$(CFG_EXE_SUFFIX)) \
$(TEST_CFAIL_SOURCES_LLVM:.rs=.llvm$(CFG_EXE_SUFFIX))
TEST_CFAIL_OUTS_X86 := \
$(TEST_CFAIL_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86.out)
TEST_CFAIL_OUTS_LLVM := \
$(TEST_CFAIL_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm.out)
TEST_CFAIL_TMPS_X86 := \
$(TEST_CFAIL_EXES_X86:.x86$(CFG_EXE_SUFFIX)=.x86$(CFG_EXE_SUFFIX).tmp)
TEST_CFAIL_TMPS_LLVM := \
$(TEST_CFAIL_EXES_LLVM:.llvm$(CFG_EXE_SUFFIX)=.llvm$(CFG_EXE_SUFFIX).tmp)
2010-06-23 23:03:09 -05:00
ALL_TEST_CRATES := $(TEST_CFAIL_CRATES_X86) \
$(TEST_RFAIL_CRATES_X86) \
$(TEST_RPASS_CRATES_X86)
ALL_TEST_SOURCES := $(TEST_CFAIL_SOURCES_X86) \
$(TEST_RFAIL_SOURCES_X86) \
$(TEST_RPASS_SOURCES_X86)
2010-06-16 16:30:45 -05:00
ALL_TEST_INPUTS := $(wildcard test/*/*.rs test/*/*/*.rs test/*/*.rc)
2010-06-23 23:03:09 -05:00
check_nocompile: $(TEST_CFAIL_OUTS_X86)
check: tidy \
$(TEST_RPASS_EXES_X86) $(TEST_RFAIL_EXES_X86) \
$(TEST_RPASS_OUTS_X86) $(TEST_RFAIL_OUTS_X86) \
$(TEST_CFAIL_OUTS_X86)
2010-06-16 16:30:45 -05:00
compile-check: tidy \
$(TEST_RPASS_EXES_X86) $(TEST_RFAIL_EXES_X86)
2010-06-16 16:30:45 -05:00
ifeq ($(VARIANT),llvm)
2010-06-23 23:03:09 -05:00
ALL_TEST_CRATES += $(TEST_CFAIL_CRATES_LLVM) \
$(TEST_RFAIL_CRATES_LLVM) \
$(TEST_RPASS_CRATES_LLVM)
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
ALL_TEST_SOURCES += $(TEST_CFAIL_SOURCES_LLVM) \
$(TEST_RFAIL_SOURCES_LLVM) \
$(TEST_RPASS_SOURCES_LLVM)
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
check_nocompile: $(TEST_CFAIL_OUTS_LLVM)
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
check: tidy \
$(TEST_RPASS_EXES_LLVM) $(TEST_RFAIL_EXES_LLVM) \
$(TEST_RPASS_OUTS_LLVM) $(TEST_RFAIL_OUTS_LLVM) \
$(TEST_CFAIL_OUTS_LLVM)
2010-07-20 16:00:03 -05:00
compile-check: tidy \
$(TEST_RPASS_EXES_LLVM) $(TEST_RFAIL_EXES_LLVM)
2010-06-16 16:30:45 -05:00
endif
2010-06-23 23:03:09 -05:00
REQ := $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
BOOT := $(CFG_QUIET)OCAMLRUNPARAM="b1" $(CFG_BOOT) $(CFG_BOOT_FLAGS)
# 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)
$(CFG_QUIET)rm -f $<.tmp
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, run: $<)
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@
test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME)
$(CFG_QUIET)rm -f $<.tmp
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, run: $<)
$(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 \
"`awk -F: '/error-pattern/ { print $$2 }' \
2010-07-02 15:35:29 -05:00
$(basename $(basename $(basename $@))).rs | tr -d '\n\r'`" $@
2010-06-16 16:30:45 -05:00
test/compile-fail/%.x86.out.tmp: test/compile-fail/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [x86]: $<)
$(CFG_QUIET)rm -f $@
2010-06-23 23:03:09 -05:00
$(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true
$(CFG_QUIET)grep --text --quiet \
"`awk -F: '/error-pattern/ { print $$2 }' $< | tr -d '\n\r'`" $@
2010-06-16 16:30:45 -05:00
test/compile-fail/%.llvm.out.tmp: test/compile-fail/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [llvm]: $<)
$(CFG_QUIET)rm -f $@
2010-06-23 23:03:09 -05:00
$(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true
$(CFG_QUIET)grep --text --quiet \
"`awk -F: '/error-pattern/ { print $$2 }' $< | tr -d '\n\r'`" $@
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
test/run-pass/%.x86$(CFG_EXE_SUFFIX): test/run-pass/%.rc $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [x86]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ $<
2010-06-16 16:30:45 -05:00
2010-07-08 23:56:03 -05:00
test/bench/shootout/%.x86$(CFG_EXE_SUFFIX): test/bench/shootout/%.rs $(REQ)
@$(call CFG_ECHO, compile [x86]: $<)
$(BOOT) -o $@ $<
%.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]: $<)
$(CFG_QUIET)$(LLC) $(CFG_LLC_CFLAGS) -o $@ $<
2010-06-16 16:30:45 -05:00
%.o: %.s
@$(call CFG_ECHO, assemble [llvm]: $<)
$(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ -c $<
%.llvm$(CFG_EXE_SUFFIX): %.o $(CFG_RUNTIME)
@$(call CFG_ECHO, link [llvm]: $<)
2010-06-23 23:03:09 -05:00
$(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ $< -L. -lrustrt
@# 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-06-23 23:03:09 -05:00
test/run-pass/%.bc: test/run-pass/%.rc $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [llvm]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ -llvm $<
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
test/run-pass/%.x86$(CFG_EXE_SUFFIX): test/run-pass/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [x86]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ $<
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
test/run-pass/%.bc: test/run-pass/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [llvm]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ -llvm $<
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
test/run-fail/%.x86$(CFG_EXE_SUFFIX): test/run-fail/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [x86]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ $<
2010-06-16 16:30:45 -05:00
2010-06-23 23:03:09 -05:00
test/run-fail/%.bc: test/run-fail/%.rs $(REQ)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, compile [llvm]: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -o $@ -llvm $<
2010-06-16 16:30:45 -05:00
######################################################################
# Auto-dependency
######################################################################
ML_DEPFILES := $(BOOT_MLS:%.ml=%.d)
C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d)
%.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), $<), \
$(RUNTIME_INCS)) $< $(CFG_PATH_MUNGE) >$@
2010-06-16 16:30:45 -05:00
%.d: %.ml $(MKFILES)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, dep: $<)
$(CFG_QUIET)ocamldep$(OPT) $(ML_DEP_INCS) $< $(CFG_PATH_MUNGE) >$@
2010-06-16 16:30:45 -05:00
%.d: %.mli $(MKFILES)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, dep: $<)
$(CFG_QUIET)ocamldep$(OPT) $(ML_DEP_INCS) $< $(CFG_PATH_MUNGE) >$@
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)
$(STDLIB_DEPFILE): $(STDLIB_CRATE) $(MKFILES) $(CFG_BOOT)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, dep: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -shared -rdeps $< $(CFG_PATH_MUNGE) >$@
2010-06-16 16:30:45 -05:00
%.d: %.rc $(MKFILES) $(CFG_BOOT)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, dep: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -rdeps $< $(CFG_PATH_MUNGE) >$@
2010-06-16 16:30:45 -05:00
%.d: %.rs $(MKFILES) $(CFG_BOOT)
2010-06-16 16:30:45 -05:00
@$(call CFG_ECHO, dep: $<)
2010-06-23 23:03:09 -05:00
$(BOOT) -rdeps $< $(CFG_PATH_MUNGE) >$@
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
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 \
$(filter-out $(GENERATED) $(PKG_3RDPARTY), $(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-06-16 16:30:45 -05:00
$(CFG_QUIET)rm -f $(CFG_COMPILER)
$(CFG_QUIET)rm -f $(ML_DEPFILES) $(C_DEPFILES) $(CRATE_DEPFILES)
$(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 -f $(TEST_RPASS_EXES_X86) $(TEST_RPASS_OUTS_X86) \
$(TEST_RPASS_TMPS_X86)
$(CFG_QUIET)rm -f $(TEST_RPASS_EXES_LLVM) $(TEST_RPASS_OUTS_LLVM) \
$(TEST_RPASS_TMPS_LLVM)
$(CFG_QUIET)rm -f $(TEST_RFAIL_EXES_X86) $(TEST_RFAIL_OUTS_X86) \
$(TEST_RFAIL_TMPS_X86)
$(CFG_QUIET)rm -f $(TEST_RFAIL_EXES_LLVM) $(TEST_RFAIL_OUTS_LLVM) \
$(TEST_RFAIL_TMPS_LLVM)
$(CFG_QUIET)rm -f $(TEST_CFAIL_EXES_X86) $(TEST_CFAIL_OUTS_X86) \
$(TEST_CFAIL_TMPS_X86)
$(CFG_QUIET)rm -f $(TEST_CFAIL_EXES_LLVM) $(TEST_CFAIL_OUTS_LLVM) \
$(TEST_CFAIL_TMPS_LLVM)
$(CFG_QUIET)rm -rf $(TEST_RPASS_EXES_LLVM:.llvm=.llvm.dSYM)
$(CFG_QUIET)rm -rf $(TEST_RFAIL_EXES_LLVM:.llvm=.llvm.dSYM)
2010-06-16 16:30:45 -05:00
$(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,\
$(wildcard boot/*/*.$(ext) boot/*/*/*.$(ext)))
# 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: