34 lines
1.2 KiB
Makefile
34 lines
1.2 KiB
Makefile
|
-include ../tools.mk
|
||
|
|
||
|
# construct a fairly exhaustive list of platforms that we
|
||
|
# support. These ones don't follow a pattern
|
||
|
TARGETS=arm-linux-androideabi arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabi
|
||
|
|
||
|
# these ones do, each OS lists the architectures it supports
|
||
|
LINUX=aarch64 i686 x86_64 mips mipsel
|
||
|
WINDOWS=i686 x86_64
|
||
|
# fails with: failed to get iphonesimulator SDK path: no such file or directory
|
||
|
#IOS=i386 aarch64 armv7
|
||
|
DARWIN=i686 x86_64
|
||
|
|
||
|
$(foreach arch,$(LINUX),$(eval TARGETS += $(arch)-unknown-linux-gnu))
|
||
|
$(foreach arch,$(WINDOWS),$(eval TARGETS += $(arch)-pc-windows-gnu))
|
||
|
#$(foreach arch,$(IOS),$(eval TARGETS += $(arch)-apple-ios))
|
||
|
$(foreach arch,$(DARWIN),$(eval TARGETS += $(arch)-apple-darwin))
|
||
|
|
||
|
all: $(TARGETS)
|
||
|
|
||
|
define MK_TARGETS
|
||
|
# compile the rust file to the given target, but only to asm and IR
|
||
|
# form, to avoid having to have an appropriate linker.
|
||
|
#
|
||
|
# we need some features because the integer SIMD instructions are not
|
||
|
# enabled by-default for i686 and ARM; these features will be invalid
|
||
|
# on some platforms, but LLVM just prints a warning so that's fine for
|
||
|
# now.
|
||
|
$(1): simd.rs
|
||
|
$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs -C target-feature='+neon,+sse2'
|
||
|
endef
|
||
|
|
||
|
$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))
|