libc: make stdio_impl.h an internal libc header
[unleashed/tickless.git] / usr / src / lib / libm / Makefile.libm.com
blob0bd84ec09c13353adabb2aaca91ba639a3d11a03
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source.  A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
16 LIBMDIR         = $(SRC)/lib/libm
18 LIBMSRC         = $(LIBMDIR)/common
20 ASSUFFIX_sparc  = S
21 ASSUFFIX_i386   = s
22 ASSUFFIX        = $(ASSUFFIX_$(MACH))
24 # With studio C99MODE of neither enabled nor disabled is "no_lib", whereby we
25 # expect C99-the-language, but don't modify the behaviour of library routines.
26 # This is VERY IMPORTANT, as -std=gnu99, for instance, would link us with
27 # values-xpg6, which would introduce an __xpg6 to our object with the C99
28 # flags set, causing us to default C99 libm behaviour on, breaking
29 # compatibility.
31 # We must then, unfortunately, defeat the GNU compiler _defaulting_ to C99, by
32 # in that case setting it back to gnu89, which _also_ accepts C99 syntax as
33 # far as is important.
34 C99MODE         =
35 CFLAGS          += -std=gnu89
36 CFLAGS64        += -std=gnu89
38 M4FLAGS         = -D__STDC__ -DPIC
40 LDBLDIR_sparc   = Q
41 LDBLDIR_i386    = LD
42 LDBLDIR         = $(LDBLDIR_$(MACH))
44 CFLAGS          += $(C_PICFLAGS)
45 CFLAGS64        += $(C_PICFLAGS)
46 sparc_CFLAGS    += -Wa,-xarch=v8plus
48 CPPFLAGS        += -I$(LIBMSRC)/C \
49                 -I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
51 # GCC needs __C99FEATURES__ such that the implementations of isunordered,
52 # isgreaterequal, islessequal, etc, exist.  This gets us the C99 language
53 # features, but not values-xpg6, the reason for which is outlined with
54 # C99MODE.
55 CFLAGS          += -D__C99FEATURES__
56 CFLAGS64        += -D__C99FEATURES__
58 # libm depends on integer overflow characteristics
59 CFLAGS          += -fno-strict-overflow
60 CFLAGS64        += -fno-strict-overflow
62 $(DYNLIB)       := LDLIBS += -lc
64 CLEANFILES      += pics/*.s pics/*.S
66 FPDEF_amd64     = -DARCH_amd64
67 FPDEF_sparc     = -DCG89 -DARCH_v8plus -DFPADD_TRAPS_INCOMPLETE_ON_NAN
68 FPDEF_sparcv9   = -DARCH_v9 -DFPADD_TRAPS_INCOMPLETE_ON_NAN
69 FPDEF           = $(FPDEF_$(TARGET_ARCH))
71 ASFLAGS         = -D_ASM $(FPDEF)
73 XARCH_sparc     = v8plus
74 XARCH_sparcv9   = v9
75 XARCH_i386      = f80387
76 XARCH_amd64     = amd64
77 XARCH           = $(XARCH_$(TARGET_ARCH))
79 ASOPT_sparc     = -xarch=$(XARCH) $(AS_PICFLAGS)
80 ASOPT_sparcv9   = -xarch=$(XARCH) $(AS_PICFLAGS)
81 ASOPT_i386      = 
82 ASOPT_amd64     = $(AS_PICFLAGS)
83 ASOPT           = $(ASOPT_$(TARGET_ARCH))
85 ASFLAGS         += $(ASOPT)
87 CPPFLAGS_sparc = -DFPADD_TRAPS_INCOMPLETE_ON_NAN \
88         -DFDTOS_TRAPS_INCOMPLETE_IN_FNS_MODE
90 CPPFLAGS        += $(CPPFLAGS_$(MACH))
91 ASFLAGS         += $(CPPFLAGS)