aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/i386/Makefile.target
blob: 2f27b65e2db4f872047581ae46fac48dbcec0545 (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
# i386 cross compile notes

I386_SRC=$(SRC_PATH)/tests/tcg/i386

# Set search path for all sources
VPATH 		+= $(I386_SRC)

I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
I386_TESTS=$(I386_SRCS:.c=)

# Update TESTS
TESTS+=$(I386_TESTS)

ifneq ($(TARGET_NAME),x86_64)
CFLAGS+=-m32
endif

#
# hello-i386 is a barebones app
#
hello-i386: CFLAGS+=-ffreestanding
hello-i386: LDFLAGS+=-nostdlib

#
# test-386 includes a couple of additional objects that need to be linked together
#

test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
	   $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm