]> git.ipfire.org Git - thirdparty/kernel/linux.git/blob - tools/power/cpupower/bench/Makefile
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / tools / power / cpupower / bench / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 OUTPUT := ./
3 ifeq ("$(origin O)", "command line")
4 ifneq ($(O),)
5 OUTPUT := $(O)/
6 endif
7 endif
8
9 ifeq ($(strip $(STATIC)),true)
10 LIBS = -L../ -L$(OUTPUT) -lm
11 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
12 $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
13 else
14 LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
15 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
16 endif
17
18 CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
19
20 $(OUTPUT)%.o : %.c
21 $(ECHO) " CC " $@
22 $(QUIET) $(CC) -c $(CFLAGS) $< -o $@
23
24 $(OUTPUT)cpufreq-bench: $(OBJS)
25 $(ECHO) " CC " $@
26 $(QUIET) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
27
28 all: $(OUTPUT)cpufreq-bench
29
30 install:
31 mkdir -p $(DESTDIR)/$(sbindir)
32 mkdir -p $(DESTDIR)/$(bindir)
33 mkdir -p $(DESTDIR)/$(docdir)
34 mkdir -p $(DESTDIR)/$(confdir)
35 install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench
36 install -m 755 cpufreq-bench_plot.sh $(DESTDIR)/$(bindir)/cpufreq-bench_plot.sh
37 install -m 644 README-BENCH $(DESTDIR)/$(docdir)/README-BENCH
38 install -m 755 cpufreq-bench_script.sh $(DESTDIR)/$(docdir)/cpufreq-bench_script.sh
39 install -m 644 example.cfg $(DESTDIR)/$(confdir)/cpufreq-bench.conf
40
41 clean:
42 rm -f $(OUTPUT)*.o
43 rm -f $(OUTPUT)cpufreq-bench