2012-02-01 19:08:20 +08:00
|
|
|
OUTPUT := ./
|
|
|
|
ifeq ("$(origin O)", "command line")
|
|
|
|
ifneq ($(O),)
|
|
|
|
OUTPUT := $(O)/
|
|
|
|
endif
|
|
|
|
endif
|
2011-03-30 22:30:11 +08:00
|
|
|
|
2012-02-01 19:08:20 +08:00
|
|
|
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
|
|
|
|
|
|
|
|
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
|
2011-03-30 22:30:11 +08:00
|
|
|
CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
|
|
|
|
|
2012-02-01 19:08:20 +08:00
|
|
|
$(OUTPUT)%.o : %.c
|
2011-04-19 15:03:52 +08:00
|
|
|
$(ECHO) " CC " $@
|
|
|
|
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@
|
2011-03-30 22:30:11 +08:00
|
|
|
|
2012-02-01 19:08:20 +08:00
|
|
|
$(OUTPUT)cpufreq-bench: $(OBJS)
|
2011-04-19 15:03:52 +08:00
|
|
|
$(ECHO) " CC " $@
|
|
|
|
$(QUIET) $(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS)
|
2011-03-30 22:30:11 +08:00
|
|
|
|
2012-02-01 19:08:20 +08:00
|
|
|
all: $(OUTPUT)cpufreq-bench
|
2011-03-30 22:30:11 +08:00
|
|
|
|
|
|
|
install:
|
|
|
|
mkdir -p $(DESTDIR)/$(sbindir)
|
|
|
|
mkdir -p $(DESTDIR)/$(bindir)
|
|
|
|
mkdir -p $(DESTDIR)/$(docdir)
|
|
|
|
mkdir -p $(DESTDIR)/$(confdir)
|
2012-02-01 19:08:20 +08:00
|
|
|
install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench
|
2011-03-30 22:30:11 +08:00
|
|
|
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:
|
2012-02-01 19:08:20 +08:00
|
|
|
rm -f $(OUTPUT)*.o
|
|
|
|
rm -f $(OUTPUT)cpufreq-bench
|