Skip to content

Commit

Permalink
Added option to install the driver as a command
Browse files Browse the repository at this point in the history
Also moved the order of compiling to support other distros
  • Loading branch information
mckset authored Feb 1, 2023
1 parent 5df2251 commit 5ea6ce8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
CC = gcc
FLAGS = -lusb-1.0
USER = $(shell id -u)
DIR = $(shell pwd)
HOME = "/home/"$(shell logname)

install:
${CC} ${FLAGS} KD100.c -o KD100
@if [ "${USER}" = "0" ]; then\
${CC} KD100.c ${FLAGS} -o /bin/KD100;\
mkdir "${HOME}/.config/KD100";\
cp "default.cfg" "${HOME}/.config/KD100/";\
chmod a+wr "${HOME}/.config/KD100/default.cfg";\
echo "Default config file is located in: ${HOME}/.config/KD100/";\
else\
${CC} KD100.c ${FLAGS} -o KD100;\
fi


clean:
${CC} ${FLAGS} KD100.c -o KD100
rm -f KD100.c

0 comments on commit 5ea6ce8

Please sign in to comment.