blob: 726e8ba41beea93cc8e883609ef99995141885d6 [file] [log] [blame]
Daniel Dunbarb3a69012009-06-26 16:47:03 +00001###
2# Configuration variables.
3
4# Assume make is always run from top-level of source directory. Note
5# than an Apple style build overrides these variables later in the
6# makefile.
7ProjSrcRoot := $(shell pwd)
8ProjObjRoot := $(ProjSrcRoot)
9
10Configs := Debug Release Profile
11Archs := i386 ppc x86_64
12
13Common.CFLAGS := -Wall -Werror
14
15# These names must match the configs, see GetArgs function.
16Debug.CFLAGS := -g
17Release.CFLAGS := -O3 -fomit-frame-pointer
18Profile.CFLAGS := -pg -g
19
20# Function: GetArgs config arch
21#
22# Return the compiler flags for the given config & arch.
23GetArgs = $(if $($(1).CFLAGS),$(Common.CFLAGS) $($(1).CFLAGS) -arch $(2), \
24 $(error "Invalid configuration: $(1)"))
25
26###
27# Tool configuration variables.
28
29CC := gcc
30# FIXME: LLVM uses autoconf/mkinstalldirs ?
31MKDIR := mkdir -p
32DATE := date
33AR := ar
34# FIXME: Remove these pipes once ranlib errors are fixed.
35AR.Flags := cru 2> /dev/null
36RANLIB := ranlib
37# FIXME: Remove these pipes once ranlib errors are fixed.
38RANLIB.Flags := 2> /dev/null
39LIPO := lipo
40
41###
42# Automatic and derived variables.
43
44# Adjust settings for verbose mode
45ifndef VERBOSE
46 Verb := @
47else
48 Verb :=
49endif
50
51Echo := @echo
52Archive := $(AR) $(AR.Flags)
53Ranlib := $(RANLIB) $(RANLIB.Flags)
54Lipo := $(LIPO)
55ifndef Summary
56 Summary = $(Echo)
57endif