Makefile (664b0bae0b87f69bc9deb098f5e0158b9cf18e04) Makefile (dbc4ca339c8dbdd8652ce57c16bf5ef45ee4307e)
1# Makefile for cpupower
2#
3# Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
4#
5# Based largely on the Makefile for udev by:
6#
7# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
8#

--- 115 unchanged lines hidden (view full) ---

124# use '-Os' optimization if available, else use -O2
125OPTIMIZATION := $(call cc-supports,-Os,-O2)
126
127WARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
128WARNINGS += $(call cc-supports,-Wno-pointer-sign)
129WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
130WARNINGS += -Wshadow
131
1# Makefile for cpupower
2#
3# Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
4#
5# Based largely on the Makefile for udev by:
6#
7# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
8#

--- 115 unchanged lines hidden (view full) ---

124# use '-Os' optimization if available, else use -O2
125OPTIMIZATION := $(call cc-supports,-Os,-O2)
126
127WARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
128WARNINGS += $(call cc-supports,-Wno-pointer-sign)
129WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
130WARNINGS += -Wshadow
131
132CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
132override CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
133 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
134
135UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \
136 utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
137 utils/helpers/pci.o utils/helpers/bitmask.o \
138 utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
139 utils/idle_monitor/hsw_ext_idle.o \
140 utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \

--- 10 unchanged lines hidden (view full) ---

151 utils/helpers/bitmask.h \
152 utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
153
154LIB_HEADERS = lib/cpufreq.h lib/cpupower.h lib/cpuidle.h
155LIB_SRC = lib/cpufreq.c lib/cpupower.c lib/cpuidle.c
156LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
157LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))
158
133 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
134
135UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \
136 utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
137 utils/helpers/pci.o utils/helpers/bitmask.o \
138 utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
139 utils/idle_monitor/hsw_ext_idle.o \
140 utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \

--- 10 unchanged lines hidden (view full) ---

151 utils/helpers/bitmask.h \
152 utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
153
154LIB_HEADERS = lib/cpufreq.h lib/cpupower.h lib/cpuidle.h
155LIB_SRC = lib/cpufreq.c lib/cpupower.c lib/cpuidle.c
156LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
157LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))
158
159CFLAGS += -pipe
159override CFLAGS += -pipe
160
161ifeq ($(strip $(NLS)),true)
162 INSTALL_NLS += install-gmo
163 COMPILE_NLS += create-gmo
160
161ifeq ($(strip $(NLS)),true)
162 INSTALL_NLS += install-gmo
163 COMPILE_NLS += create-gmo
164 CFLAGS += -DNLS
164 override CFLAGS += -DNLS
165endif
166
167ifeq ($(strip $(CPUFREQ_BENCH)),true)
168 INSTALL_BENCH += install-bench
169 COMPILE_BENCH += compile-bench
170endif
171
172ifeq ($(strip $(STATIC)),true)
173 UTIL_OBJS += $(LIB_OBJS)
174 UTIL_HEADERS += $(LIB_HEADERS)
175 UTIL_SRC += $(LIB_SRC)
176endif
177
165endif
166
167ifeq ($(strip $(CPUFREQ_BENCH)),true)
168 INSTALL_BENCH += install-bench
169 COMPILE_BENCH += compile-bench
170endif
171
172ifeq ($(strip $(STATIC)),true)
173 UTIL_OBJS += $(LIB_OBJS)
174 UTIL_HEADERS += $(LIB_HEADERS)
175 UTIL_SRC += $(LIB_SRC)
176endif
177
178CFLAGS += $(WARNINGS)
178override CFLAGS += $(WARNINGS)
179
180ifeq ($(strip $(V)),false)
181 QUIET=@
182 ECHO=@echo
183else
184 QUIET=
185 ECHO=@\#
186endif
187export QUIET ECHO
188
189# if DEBUG is enabled, then we do not strip or optimize
190ifeq ($(strip $(DEBUG)),true)
179
180ifeq ($(strip $(V)),false)
181 QUIET=@
182 ECHO=@echo
183else
184 QUIET=
185 ECHO=@\#
186endif
187export QUIET ECHO
188
189# if DEBUG is enabled, then we do not strip or optimize
190ifeq ($(strip $(DEBUG)),true)
191 CFLAGS += -O1 -g -DDEBUG
191 override CFLAGS += -O1 -g -DDEBUG
192 STRIPCMD = /bin/true -Since_we_are_debugging
193else
192 STRIPCMD = /bin/true -Since_we_are_debugging
193else
194 CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
194 override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
195 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
196endif
197
198
199# the actual make rules
200
201all: libcpupower $(OUTPUT)cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
202

--- 132 unchanged lines hidden ---
195 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
196endif
197
198
199# the actual make rules
200
201all: libcpupower $(OUTPUT)cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
202

--- 132 unchanged lines hidden ---