Portable Makefile

This commit is contained in:
2025-05-28 19:31:56 +02:00
parent 61a398f402
commit fec9f2633d

View File

@ -1,4 +1,6 @@
tests : libstrops.a libstrops.so
.POSIX :
tests : libstrops.a libstrops.so strops.h
gcc -ansi -I . -L. -o tests tests.c -Wl,-Bstatic -lstrops -Wl,-Bdynamic
# gcc -ansi -I . -L. -o tests tests.c -lstrops
@ -8,6 +10,18 @@ libstrops.so : strops.o
libstrops.a : strops.o
ar cr libstrops.a strops.o
strops.o : strops.c strops.h
gcc -c -fPIC -ansi -ggdb -o strops.o strops.c
# gcc -c -ansi -O2 -pipe -o strops.o strops.c
strops.o : strops.c
# gcc -c -fPIC -ansi -ggdb -o strops.o strops.c
gcc -c -ansi -O2 -pipe -o strops.o strops.c
.PHONY : install uninstall
install: libstrops.a libstrops.so strops.h
sudo mv libstrops.a /usr/local/lib
sudo mv libstrops.so /usr/local/lib
sudo cp strops.h /usr/local/include
uninstall:
sudo rm /usr/local/lib/libstrops.a
sudo rm /usr/local/lib/libstrops.so
sudo rm /usr/local/include/strops.h