Adding install and uninstall commands

This commit is contained in:
Valentin Moguérou 2021-10-07 20:28:36 +02:00
parent 896226f67f
commit aab962a7b8
2 changed files with 20 additions and 4 deletions

6
.gitignore vendored
View File

@ -52,3 +52,9 @@ Module.symvers
Mkfile.old
dkms.conf
# Output
obj/
bin/
# Vim
*.swp

View File

@ -1,15 +1,15 @@
CC = gcc
FLAGS = -Wall -fpic
LFLAGS = -s
FLAGS = -Wall -g -fpic
LFLAGS =
all: bin/libcatwalk.so
bin/libcatwalk.so: obj/directions.o obj/grid.o obj/indicators.o obj/route.o
-@mkdir -p $(@D)
@mkdir -p $(@D)
$(CC) -shared -o $@ $(FLAGS) $^ $(LFLAGS)
obj/%.o: src/%.c
-@mkdir -p $(@D)
@mkdir -p $(@D)
$(CC) -o $@ -c $(FLAGS) $<
obj/directions.o: src/directions.c
@ -22,3 +22,13 @@ clean:
rm -rf obj
mrproper: clean
rm -rf bin
install: bin/libcatwalk.so
@mkdir -p /usr/local/include/catwalk/
install include/*.h /usr/local/include/catwalk/
@mkdir -p /usr/local/lib
install bin/libcatwalk.so /usr/local/lib/
uninstall:
-rm -rf /usr/local/include/catwalk
-rm -f /usr/local/lib/libcatwalk.so