CC = gcc 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 RELEASE_TAG = $(shell git describe) all: $(BIN) $(BIN): $(CC) $(CFLAGS) -DNDEBUG -s $(SRC)/$(BIN).c -o $(BINDIR)/$@ debug: $(CC) $(CFLAGS) -g $(SRC)/$(BIN).c -o $(BINDIR)/$(BIN) release: clean tar czf homemade_speedstep-$(RELEASE_TAG).tar.gz $(shell ls -A | grep -v "*.tar.gz") install: mv $(BINDIR)/$(BIN) /usr/bin/$(BIN) install-openrc: install cp init.d/$(BIN) /etc/init.d/$(BIN) cp conf.d/$(BIN) /etc/conf.d/$(BIN) rc-update add homemade_speedstep clean: $(RM) -r $(BINDIR)/* $(RM) ./*.tar.gz