summary refs log tree commit diff
path: root/src/test/run-make/simd-ffi/Makefile
blob: dc0fcec1980fd1f18ad85d728f7ef0dbcb998419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-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' -C extra-filename=-$(1)
endef

$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))