2022-11-10 05:27:34 -03:00
|
|
|
CC = gcc
|
2022-11-22 18:32:12 -03:00
|
|
|
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)
|
2022-11-10 05:27:34 -03:00
|
|
|
SRC = src
|
|
|
|
BINDIR = bin
|
|
|
|
BIN = homemade_speedstep
|
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
$(BIN):
|
|
|
|
$(CC) $(CFLAGS) -DNDEBUG -s $(SRC)/$(BIN).c -o $(BINDIR)/$@
|
|
|
|
|
|
|
|
debug:
|
|
|
|
$(CC) $(CFLAGS) -g $(SRC)/$(BIN).c -o $(BINDIR)/$(BIN)
|
|
|
|
|
2022-11-22 16:53:34 -03:00
|
|
|
install: $(BIN)
|
2022-11-10 05:27:34 -03:00
|
|
|
cp $(BINDIR)/$(BIN) /usr/bin/$(BIN)
|
|
|
|
|
2022-11-22 18:35:17 -03:00
|
|
|
install-openrc: install
|
2022-11-19 13:22:12 -03:00
|
|
|
cp init.d/$(BIN) /etc/init.d/$(BIN)
|
|
|
|
cp conf.d/$(BIN) /etc/conf.d/$(BIN)
|
2022-11-19 13:27:26 -03:00
|
|
|
rc-update add homemade_speedstep
|
2022-11-19 13:22:12 -03:00
|
|
|
|
2022-11-10 05:27:34 -03:00
|
|
|
clean:
|
|
|
|
$(RM) -r $(BINDIR)/*
|