installation target in makefile

This commit is contained in:
Mario Fink 2020-02-17 10:49:47 +00:00
parent 9a588570cc
commit b9064e2c82
2 changed files with 23 additions and 2 deletions

View File

View File

@ -1,14 +1,35 @@
SHELL:=/bin/bash
RAW = ../raw/
SRC = src/
EXE = eatit
EXE = eatraw
CCC = g++ -std=c++11
OPT = -O3 -Wall -mavx -mno-tbm -mf16c -mno-f16c
# build executable
$(EXE) : $(SRC)main.cpp $(SRC)raweat.hpp $(SRC)half_precision_floating_point.hpp
$(CCC) $(OPT) $< -o $@
# remove executable
clean :
rm -f $(EXE)
# check existence of name of executable globally
chexe:=$(shell command -v $(EXE))
# install executable if name does not exist yet
install : $(EXE)
ifeq ($(chexe),)
sudo cp $(EXE) /usr/local/bin/
else
@echo "executable with same name already exists! choose different name!"
@exit 1
endif
# deinstall
deinstall :
sudo rm /usr/local/bin/$(EXE)