2021-10-05 18:50:05 +02:00
|
|
|
CC = gcc
|
2021-10-07 20:28:36 +02:00
|
|
|
FLAGS = -Wall -g -fpic
|
|
|
|
LFLAGS =
|
2021-10-05 13:04:32 +02:00
|
|
|
|
|
|
|
all: bin/libcatwalk.so
|
2021-10-06 20:57:01 +02:00
|
|
|
|
2021-10-05 13:04:32 +02:00
|
|
|
bin/libcatwalk.so: obj/directions.o obj/grid.o obj/indicators.o obj/route.o
|
2021-10-07 20:28:36 +02:00
|
|
|
@mkdir -p $(@D)
|
2021-10-05 13:04:32 +02:00
|
|
|
$(CC) -shared -o $@ $(FLAGS) $^ $(LFLAGS)
|
|
|
|
|
|
|
|
obj/%.o: src/%.c
|
2021-10-07 20:28:36 +02:00
|
|
|
@mkdir -p $(@D)
|
2021-10-05 13:04:32 +02:00
|
|
|
$(CC) -o $@ -c $(FLAGS) $<
|
|
|
|
|
|
|
|
obj/directions.o: src/directions.c
|
|
|
|
obj/grid.o: src/grid.c
|
|
|
|
obj/indicators.o: src/indicators.c
|
|
|
|
obj/route.o: src/route.c
|
|
|
|
|
2021-10-31 10:55:28 +01:00
|
|
|
.PHONY: clean mrproper install uninstall
|
2021-10-05 13:04:32 +02:00
|
|
|
clean:
|
2021-10-06 20:57:01 +02:00
|
|
|
rm -rf obj
|
2021-10-05 13:04:32 +02:00
|
|
|
mrproper: clean
|
2021-10-06 20:57:01 +02:00
|
|
|
rm -rf bin
|
2021-10-07 20:28:36 +02:00
|
|
|
|
|
|
|
install: bin/libcatwalk.so
|
|
|
|
@mkdir -p /usr/local/include/catwalk/
|
2021-10-30 15:36:05 +02:00
|
|
|
install -p include/*.h /usr/local/include/catwalk/
|
2021-10-07 20:28:36 +02:00
|
|
|
@mkdir -p /usr/local/lib
|
2021-10-30 15:36:05 +02:00
|
|
|
install -p bin/libcatwalk.so /usr/local/lib/
|
2021-10-30 15:27:06 +02:00
|
|
|
# configuration of links
|
2023-09-18 10:28:06 +02:00
|
|
|
echo "/usr/local/lib/libcatwalk.so" > /etc/ld.so.conf.d/libcatwalk.conf
|
2021-10-30 15:27:06 +02:00
|
|
|
ldconfig /usr/local/lib/libcatwalk.so
|
2021-10-07 20:28:36 +02:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
-rm -rf /usr/local/include/catwalk
|
|
|
|
-rm -f /usr/local/lib/libcatwalk.so
|
2021-10-30 15:36:05 +02:00
|
|
|
# reconfiguration of links
|
|
|
|
ldconfig /usr/local/lib/libcatwalk.so
|