-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpupower tool: allow to build in a separate directory
This patch allows cpupower tool to generate its output files in a seperate directory. This is now possible by passing the 'O=<path>' to the command line. This can be usefull for a normal user if the kernel source code is located in a read only location. This is patch stole some bits of the perf makefile. [linux@dominikbrodowski.net: fix commit message] Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
- Loading branch information
Franck Bui-Huu
authored and
Dominik Brodowski
committed
Mar 3, 2012
1 parent
3827150
commit 68bb2c3
Showing
2 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
LIBS = -L../ -lm -lcpupower | ||
OUTPUT := ./ | ||
ifeq ("$(origin O)", "command line") | ||
ifneq ($(O),) | ||
OUTPUT := $(O)/ | ||
endif | ||
endif | ||
|
||
OBJS = main.o parse.o system.o benchmark.o | ||
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower | ||
|
||
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o | ||
CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\" | ||
|
||
%.o : %.c | ||
$(OUTPUT)%.o : %.c | ||
$(ECHO) " CC " $@ | ||
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@ | ||
|
||
cpufreq-bench: $(OBJS) | ||
$(OUTPUT)cpufreq-bench: $(OBJS) | ||
$(ECHO) " CC " $@ | ||
$(QUIET) $(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS) | ||
|
||
all: cpufreq-bench | ||
all: $(OUTPUT)cpufreq-bench | ||
|
||
install: | ||
mkdir -p $(DESTDIR)/$(sbindir) | ||
mkdir -p $(DESTDIR)/$(bindir) | ||
mkdir -p $(DESTDIR)/$(docdir) | ||
mkdir -p $(DESTDIR)/$(confdir) | ||
install -m 755 cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench | ||
install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench | ||
install -m 755 cpufreq-bench_plot.sh $(DESTDIR)/$(bindir)/cpufreq-bench_plot.sh | ||
install -m 644 README-BENCH $(DESTDIR)/$(docdir)/README-BENCH | ||
install -m 755 cpufreq-bench_script.sh $(DESTDIR)/$(docdir)/cpufreq-bench_script.sh | ||
install -m 644 example.cfg $(DESTDIR)/$(confdir)/cpufreq-bench.conf | ||
|
||
clean: | ||
rm -f *.o | ||
rm -f cpufreq-bench | ||
rm -f $(OUTPUT)*.o | ||
rm -f $(OUTPUT)cpufreq-bench |