Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 1 | OUTPUT := ./ |
| 2 | ifeq ("$(origin O)", "command line") |
| 3 | ifneq ($(O),) |
| 4 | OUTPUT := $(O)/ |
| 5 | endif |
| 6 | endif |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 7 | |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 8 | LIBS = -L../ -L$(OUTPUT) -lm -lcpupower |
| 9 | |
| 10 | OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 11 | CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\" |
| 12 | |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 13 | $(OUTPUT)%.o : %.c |
Dominik Brodowski | 7443af9 | 2011-04-19 09:03:52 +0200 | [diff] [blame] | 14 | $(ECHO) " CC " $@ |
| 15 | $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 16 | |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 17 | $(OUTPUT)cpufreq-bench: $(OBJS) |
Dominik Brodowski | 7443af9 | 2011-04-19 09:03:52 +0200 | [diff] [blame] | 18 | $(ECHO) " CC " $@ |
| 19 | $(QUIET) $(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS) |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 20 | |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 21 | all: $(OUTPUT)cpufreq-bench |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 22 | |
| 23 | install: |
| 24 | mkdir -p $(DESTDIR)/$(sbindir) |
| 25 | mkdir -p $(DESTDIR)/$(bindir) |
| 26 | mkdir -p $(DESTDIR)/$(docdir) |
| 27 | mkdir -p $(DESTDIR)/$(confdir) |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 28 | install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench |
Dominik Brodowski | 7fe2f63 | 2011-03-30 16:30:11 +0200 | [diff] [blame] | 29 | 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 | |
| 34 | clean: |
Franck Bui-Huu | 68bb2c3 | 2012-02-01 12:08:20 +0100 | [diff] [blame] | 35 | rm -f $(OUTPUT)*.o |
| 36 | rm -f $(OUTPUT)cpufreq-bench |