mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
![Mattia Dongili](/assets/img/avatar_default.png)
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Thomas Renninger <trenn@suse.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
OUTPUT := ./
|
|
ifeq ("$(origin O)", "command line")
|
|
ifneq ($(O),)
|
|
OUTPUT := $(O)/
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(strip $(STATIC)),true)
|
|
LIBS = -L../ -L$(OUTPUT) -lm
|
|
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
|
|
$(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
|
|
else
|
|
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
|
|
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
|
|
endif
|
|
|
|
CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
|
|
|
|
$(OUTPUT)%.o : %.c
|
|
$(ECHO) " CC " $@
|
|
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
$(OUTPUT)cpufreq-bench: $(OBJS)
|
|
$(ECHO) " CC " $@
|
|
$(QUIET) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
|
|
|
|
all: $(OUTPUT)cpufreq-bench
|
|
|
|
install:
|
|
mkdir -p $(DESTDIR)/$(sbindir)
|
|
mkdir -p $(DESTDIR)/$(bindir)
|
|
mkdir -p $(DESTDIR)/$(docdir)
|
|
mkdir -p $(DESTDIR)/$(confdir)
|
|
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 $(OUTPUT)*.o
|
|
rm -f $(OUTPUT)cpufreq-bench
|