]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/test/testfloat/sparc64/Makefile
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / test / testfloat / sparc64 / Makefile
1 # Copyright (c) 2010 by Peter Jeremy <peterjeremy@acm.org>
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # 1. Redistributions of source code must retain the above copyright
8 #    notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright
10 #    notice, this list of conditions and the following disclaimer in the
11 #    documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 # IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
17 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 #
24 # $FreeBSD$
25
26 .PATH: ${.CURDIR}/../../../../lib/libc/softfloat/bits64 ${.CURDIR}/..
27
28 LIBC_DIR=       ${.CURDIR}/../../../../lib/libc
29 EMUFLOAT_DIR=   ${LIBC_DIR}/sparc64/fpu
30
31 LN=     ln -sf
32
33 # Common source files
34 SRCS1=  fail.c random.c softfloat.c testCases.c testLoops.c writeHex.c
35
36 # Additional common sources to build testfloat/testemufloat
37 SRCS2=  testFunction.c testfloat.c
38
39 # Additional sources to build testemufloat
40 SRCS3=  fpu.c fpu_add.c fpu_compare.c fpu_div.c fpu_emul.S fpu_explode.c \
41         fpu_implode.c fpu_mul.c fpu_qp.c fpu_sqrt.c fpu_subr.c fpu_util.c
42
43 # Additional sources to build testfloat
44 SRCS4=  systflags.c systfloat.S systmodes.c
45
46 # Additional sources to build testsoftfloat
47 SRCS5=  slowfloat.c testsoftfloat.c
48
49 SRCS=   ${SRCS1} ${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5}
50
51 OBJ_TF=         ${SRCS1:R:S/$/.o/g} ${SRCS2:R:S/$/.o/g} ${SRCS4:R:S/$/.o/g}
52 OBJ_TEF=        ${SRCS1:R:S/$/.o/g} ${SRCS2:R:S/$/.o/g} ${SRCS3:R:S/$/.o/g}
53 OBJ_TSF=        ${SRCS1:R:S/$/.o/g} ${SRCS5:R:S/$/.o/g}
54
55 all: testfloat testemufloat testsoftfloat
56
57 CFLAGS+=        -I. -I${.CURDIR} -I${.CURDIR}/.. -I${LIBC_DIR}/sparc64/fpu \
58         -I${LIBC_DIR}/sparc64/sys -I${LIBC_DIR}/softfloat/bits64 \
59         -I${LIBC_DIR}/softfloat
60
61 CLEANFILES+=    fpu.c fpu_add.c fpu_compare.c fpu_div.c fpu_emu.h \
62         fpu_explode.c fpu_implode.c fpu_mul.c fpu_qp.c fpu_sqrt.c fpu_subr.c \
63         ${SRCS:R:S/$/.o/g} testfloat testemufloat testsoftfloat
64
65 testsoftfloat: ${OBJ_TSF}
66         ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJ_TSF}
67
68 testfloat: ${OBJ_TF}
69         ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJ_TF}
70
71 testemufloat: ${OBJ_TEF}
72         ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJ_TEF}
73
74 beforedepend: fpu_emu.h
75
76 # The emulator code needs to be built with a local fpu_reg.h instead of
77 # the one in ${EMUFLOAT_DIR}.  Unfortunately, C preprocessor semantics
78 # means that a header file in the same directory as the source file
79 # overrides any alternative header file location.  In order to include
80 # the wanted header file, create symlinks pointing to the real files
81 # and compile through the symlink.
82 fpu.c: ${EMUFLOAT_DIR}/fpu.c
83         ${LN} ${.ALLSRC} ${.TARGET}
84 fpu_add.c: ${EMUFLOAT_DIR}/fpu_add.c
85         ${LN} ${.ALLSRC} ${.TARGET}
86 fpu_compare.c: ${EMUFLOAT_DIR}/fpu_compare.c
87         ${LN} ${.ALLSRC} ${.TARGET}
88 fpu_div.c: ${EMUFLOAT_DIR}/fpu_div.c
89         ${LN} ${.ALLSRC} ${.TARGET}
90 fpu_emu.h: ${EMUFLOAT_DIR}/fpu_emu.h
91         ${LN} ${.ALLSRC} ${.TARGET}
92 fpu_explode.c: ${EMUFLOAT_DIR}/fpu_explode.c
93         ${LN} ${.ALLSRC} ${.TARGET}
94 fpu_implode.c: ${EMUFLOAT_DIR}/fpu_implode.c
95         ${LN} ${.ALLSRC} ${.TARGET}
96 fpu_mul.c: ${EMUFLOAT_DIR}/fpu_mul.c
97         ${LN} ${.ALLSRC} ${.TARGET}
98 fpu_qp.c: ${EMUFLOAT_DIR}/fpu_qp.c
99         ${LN} ${.ALLSRC} ${.TARGET}
100 fpu_sqrt.c: ${EMUFLOAT_DIR}/fpu_sqrt.c
101         ${LN} ${.ALLSRC} ${.TARGET}
102 fpu_subr.c: ${EMUFLOAT_DIR}/fpu_subr.c
103         ${LN} ${.ALLSRC} ${.TARGET}
104
105 .include <bsd.prog.mk>