blob: 7ec7021a29cd8d37a9abf4ecc08c396d50368501 [file] [log] [blame]
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +01001OUTPUT := ./
2ifeq ("$(origin O)", "command line")
3ifneq ($(O),)
4 OUTPUT := $(O)/
5endif
6endif
Dominik Brodowski7fe2f632011-03-30 16:30:11 +02007
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +01008LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
9
10OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
Dominik Brodowski7fe2f632011-03-30 16:30:11 +020011CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
12
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +010013$(OUTPUT)%.o : %.c
Dominik Brodowski7443af92011-04-19 09:03:52 +020014 $(ECHO) " CC " $@
15 $(QUIET) $(CC) -c $(CFLAGS) $< -o $@
Dominik Brodowski7fe2f632011-03-30 16:30:11 +020016
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +010017$(OUTPUT)cpufreq-bench: $(OBJS)
Dominik Brodowski7443af92011-04-19 09:03:52 +020018 $(ECHO) " CC " $@
19 $(QUIET) $(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS)
Dominik Brodowski7fe2f632011-03-30 16:30:11 +020020
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +010021all: $(OUTPUT)cpufreq-bench
Dominik Brodowski7fe2f632011-03-30 16:30:11 +020022
23install:
24 mkdir -p $(DESTDIR)/$(sbindir)
25 mkdir -p $(DESTDIR)/$(bindir)
26 mkdir -p $(DESTDIR)/$(docdir)
27 mkdir -p $(DESTDIR)/$(confdir)
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +010028 install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench
Dominik Brodowski7fe2f632011-03-30 16:30:11 +020029 install -m 755 cpufreq-bench_plot.sh $(DESTDIR)/$(bindir)/cpufreq-bench_plot.sh
30 install -m 644 README-BENCH $(DESTDIR)/$(docdir)/README-BENCH
31 install -m 755 cpufreq-bench_script.sh $(DESTDIR)/$(docdir)/cpufreq-bench_script.sh
32 install -m 644 example.cfg $(DESTDIR)/$(confdir)/cpufreq-bench.conf
33
34clean:
Franck Bui-Huu68bb2c32012-02-01 12:08:20 +010035 rm -f $(OUTPUT)*.o
36 rm -f $(OUTPUT)cpufreq-bench