1# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# This file contains definitions which control the C compiler. 6 7 8COPTIONS = \ 9 -g \ 10 -O2 \ 11 -funit-at-a-time 12 13# Compiler is too old to support 14# 15# -Wframe-larger-than=256 16# -Wlarger-than=4096 17# -Wsync-nand 18 19# Enable GC on unused functions and data 20CGC = \ 21 -ffunction-sections \ 22 -fdata-sections 23 24PTHREAD = \ 25 -pthread 26 27LDGC = \ 28 -Xlinker --gc-sections 29 30CWARN = \ 31 -Waddress \ 32 -Waggregate-return \ 33 -Wall \ 34 -Warray-bounds \ 35 -Wbad-function-cast \ 36 -Wcast-align \ 37 -Wchar-subscripts \ 38 -Wclobbered \ 39 -Wcomment \ 40 -Wconversion \ 41 -Wdeclaration-after-statement \ 42 -Wdisabled-optimization \ 43 -Wempty-body \ 44 -Werror \ 45 -Wextra \ 46 -Wfloat-equal \ 47 -Wformat \ 48 -Wformat-nonliteral \ 49 -Wformat-security \ 50 -Wformat-y2k \ 51 -Wignored-qualifiers \ 52 -Wimplicit \ 53 -Winit-self \ 54 -Winline \ 55 -Wlogical-op \ 56 -Wmain \ 57 -Wmissing-braces \ 58 -Wmissing-declarations \ 59 -Wmissing-field-initializers \ 60 -Wmissing-format-attribute \ 61 -Wmissing-include-dirs \ 62 -Wmissing-noreturn \ 63 -Wmissing-parameter-type \ 64 -Wmissing-prototypes \ 65 -Wnested-externs \ 66 -Wold-style-declaration \ 67 -Wold-style-definition \ 68 -Woverlength-strings \ 69 -Woverride-init \ 70 -Wpacked \ 71 -Wparentheses \ 72 -Wpointer-arith \ 73 -Wpointer-sign \ 74 -Wredundant-decls \ 75 -Wreturn-type \ 76 -Wsequence-point \ 77 -Wshadow \ 78 -Wsign-compare \ 79 -Wsign-conversion \ 80 -Wstack-protector \ 81 -Wstrict-aliasing \ 82 -Wstrict-aliasing=3 \ 83 -Wstrict-overflow \ 84 -Wstrict-overflow=5 \ 85 -Wstrict-prototypes \ 86 -Wswitch \ 87 -Wswitch-default \ 88 -Wswitch-enum \ 89 -Wtrigraphs \ 90 -Wtype-limits \ 91 -Wundef \ 92 -Wuninitialized \ 93 -Wunknown-pragmas \ 94 -Wunsafe-loop-optimizations \ 95 -Wunused-function \ 96 -Wunused-label \ 97 -Wunused-parameter \ 98 -Wunused-value \ 99 -Wunused-variable \ 100 -Wvariadic-macros \ 101 -Wvla \ 102 -Wvolatile-register-var \ 103 -Wwrite-strings \ 104 -pedantic-errors 105 106INCLUDES = \ 107 -I$(ADHD_DIR)/include \ 108 -I$(ADHD_SOURCE_DIR) \ 109 -I$(ADHD_DIR)/cras/src/common \ 110 -I$(ADHD_DIR)/cras/src/libcras 111 112CFLAGS = \ 113 -std=gnu99 \ 114 -MD \ 115 $(INCLUDES) \ 116 $(PTHREADS) \ 117 $(CWARN) $(COPTIONS) $(CGC) $(LDGC) 118