automatically detect threads and prompt user for polling time at build time
This commit is contained in:
parent
ed9a20cbe3
commit
b24cc115fa
5
Makefile
5
Makefile
|
@ -1,5 +1,8 @@
|
|||
CC = gcc
|
||||
CFLAGS = -Wall -Wpedantic -Wextra -O2 -march=native
|
||||
CFLAGS = -Wall -Wpedantic -Wextra -O2 -march=native\
|
||||
-DTHREADS=$(shell grep processor /proc/cpuinfo | wc -l)\
|
||||
-DPOLLING_TIME=$(shell read -p "type seconds between temp checks >" P;\
|
||||
echo $$P)
|
||||
SRC = src
|
||||
BINDIR = bin
|
||||
BIN = homemade_speedstep
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#define VERSION "1.1"
|
||||
#define POLLING_TIME 1
|
||||
#define THREADS 4 /* TODO: automatically figure out how many threads host system has */
|
||||
#define FREQS "/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies"
|
||||
#define MAXSPDPREFIX "/sys/devices/system/cpu/cpu"
|
||||
#define MAXSPDSUFFIX "/cpufreq/scaling_max_freq"
|
||||
|
|
Loading…
Reference in New Issue