diff options
-rw-r--r-- | Makefile | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile b/Makefile index a23289a..09212b9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ CFLAGS := -Wall -Wextra -O2 DEP := cli.c numericx.o +INSTALL := install + +prefix = /usr + .PHONY: all all: decimal-to-earth earth-to-decimal decimal-to-sun sun-to-decimal decimal-to-lori decimal-to-nonal_inf decimal-to-nonal lori-to-decimal nonal_inf-to-decimal nonal-to-decimal uninfinity decimal-to-binary binary-to-decimal @@ -13,19 +17,24 @@ numericx.o: numericx.c numericx.h .PHONY: libnumericx.a libnumericx.so libnumericx.a: numericx.o - @make lib-dirs + @$(MAKE) lib-dirs ar -rcs lib/static/$@ $^ + @echo Compiled successfully to ./lib/static/ numericx-pic.o: numericx.c numericx.h $(CC) $(CFLAGS) -fPIC -c numericx.c -o $@ libnumericx.so: numericx-pic.o - @make lib-dirs + @$(MAKE) lib-dirs $(CC) -shared $^ -o lib/shared/$@ + @echo Compiled successfully to ./lib/shared/ -.PHONY: libs +.PHONY: libs install-lib libs: libnumericx.a libnumericx.so +install-lib: libnumericx.so + $(INSTALL) -m 755 lib/shared/libnumericx.so $(prefix)/lib/ + .PHONY: doc doc: rm -Rf doc/* |