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 Mkfile.old
dkms.conf dkms.conf
# Output
obj/
bin/
# Vim
*.swp

View File

@ -1,15 +1,15 @@
CC = gcc CC = gcc
FLAGS = -Wall -fpic FLAGS = -Wall -g -fpic
LFLAGS = -s LFLAGS =
all: bin/libcatwalk.so all: bin/libcatwalk.so
bin/libcatwalk.so: obj/directions.o obj/grid.o obj/indicators.o obj/route.o 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) $(CC) -shared -o $@ $(FLAGS) $^ $(LFLAGS)
obj/%.o: src/%.c obj/%.o: src/%.c
-@mkdir -p $(@D) @mkdir -p $(@D)
$(CC) -o $@ -c $(FLAGS) $< $(CC) -o $@ -c $(FLAGS) $<
obj/directions.o: src/directions.c obj/directions.o: src/directions.c
@ -22,3 +22,13 @@ clean:
rm -rf obj rm -rf obj
mrproper: clean mrproper: clean
rm -rf bin 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