xref: /dflybsd-src/share/mk/bsd.cpu.mk (revision dc77152fd0d00e1b1f8b8cb04d0706817b468ddd)
1# $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.2.2.5 2002/07/19 08:09:32 ru Exp $
2# $DragonFly: src/share/mk/bsd.cpu.mk,v 1.7 2004/06/15 07:53:32 joerg Exp $
3
4# include compiler-specific bsd.cpu.mk.  Note that CCVER may or may not
5# be passed as an environment variable.  If not set we make it consistent
6# within make but do not otherwise export it.
7#
8# _CCVER is used to detect changes to CCVER made in Makefile's after the
9# fact.
10CCVER ?= gcc2
11_CCVER := ${CCVER}
12
13.if ${CCVER} == "gcc2"
14.  include <bsd.cpu.gcc2.mk>
15.elif ${CCVER} == "gcc3"
16.  include <bsd.cpu.gcc3.mk>
17.elif ${CCVER} == "gcc34"
18.  include <bsd.cpu.gcc34.mk>
19.elif defined(CCVER_BSD_CPU_MK)
20.  if ${CCVER_BSD_CPU_MK} != ""
21.    include "${CCVER_BSD_CPU_MK}"
22.  endif
23.else
24.error "Either set CCVER to a known compiler or specify CCVER_BSD_CPU_MK"
25.endif
26
27# /usr/bin/cc depend on the CCVER environment variable, make sure CCVER is
28# exported for /usr/bin/cc and friends.  Note that CCVER is unsupported when
29# cross compiling from 4.x or older versions of DFly and should not be set
30# by the user.
31#
32.if defined(.DIRECTIVE_MAKEENV)
33.makeenv CCVER
34.endif
35
36# We can reassign _CPUCFLAGS and CFLAGS will evaluate properly to the
37# new value, we do not have to add the variable to CFLAGS twice.
38#
39.if !defined(NO_CPU_CFLAGS) && !defined(_CPUCFLAGS_ASSIGNED)
40_CPUCFLAGS_ASSIGNED=TRUE
41CFLAGS += ${_CPUCFLAGS}
42.endif
43
44