diff --git a/.gitignore b/.gitignore index 8eede5e..1fb165a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ bin/ **/*.o # Ignore libs -lib/*.so.** -lib/*.so -lib/*.a -lib/*.h +lib/raylib/include +lib/raylib/lib diff --git a/Makefile b/Makefile index e790a5d..c009b66 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ CC=g++ BINARY=bin/Game -CFLAGS=-Llib -lraylib -lm -lpthread -ldl -lrt -Ilib +CFLAGS=-L./lib/raylib/lib -I./lib/raylib/include -lraylib -lm -lpthread -ldl -lrt OBJECTS=src/main.o src/ball/ball.o src/ball/setter.o src/ball/getter.o src/map/map.o CXXFILES=src/main.cpp src/ball/ball.cpp src/ball/setter.cpp src/ball/getter.cpp src/map/map.cpp # Raylib -LINUX_RAYLIB=lib/raylib-4.5.0_linux_amd64 -WINDOWS_RAYLIB=lib/raylib-4.5.0_win64_mingw-w64 -MACOS_RAYLIB=lib/raylib-4.5.0_macos -RAYLIB_FILES=lib/*.so.** lib/*.so lib/*.a lib/*.h +LINUX_RAYLIB=lib/raylib/raylib-4.5.0_linux_amd64 +WINDOWS_RAYLIB=lib/raylib/raylib-4.5.0_win64_mingw-w64 +MACOS_RAYLIB=lib/raylib/raylib-4.5.0_macos +RAYLIB_FILES=lib/raylib/include lib/raylib/lib # Export to PATH UNAME := $(shell uname) @@ -17,17 +17,14 @@ ifeq ($(UNAME), Linux) RAYLIB_PACKAGE := $(LINUX_RAYLIB) PACKAGE_TYPE = tar.gz EXTRACTOR = tar -xzvf - export LD_LIBRARY_PATH := /usr/local/lib:$(LD_LIBRARY_PATH) else ifeq ($(UNAME), Windows_NT) RAYLIB_PACKAGE := $(WINDOWS_RAYLIB) PACKAGE_TYPE = zip EXTRACTOR = unzip -q - export PATH := /c/raylib:$(PATH) else ifeq ($(UNAME), Darwin) RAYLIB_PACKAGE := $(MACOS_RAYLIB) PACKAGE_TYPE = tar.gz EXTRACTOR = tar -xzvf - export DYLD_LIBRARY_PATH := /usr/local/lib:$(DYLD_LIBRARY_PATH) endif # Compile Game @@ -40,9 +37,12 @@ $(BINARY): $(OBJECTS) install: # Raylib - $(EXTRACTOR) $(RAYLIB_PACKAGE).$(PACKAGE_TYPE) -C lib/ - mv $(RAYLIB_PACKAGE)/include/* lib/ - mv $(RAYLIB_PACKAGE)/lib/* lib/ + $(EXTRACTOR) $(RAYLIB_PACKAGE).$(PACKAGE_TYPE) -C lib/raylib/ + mkdir -p lib/raylib/include + mkdir -p lib/raylib/lib + mv $(RAYLIB_PACKAGE)/include/* lib/raylib/include + mv $(RAYLIB_PACKAGE)/lib/* lib/raylib/lib + export LD_LIBRARY_PATH=./lib/raylib/lib:$LD_LIBRARY_PATH rm -rf $(RAYLIB_PACKAGE) clean: diff --git a/lib/raylib-4.5.0_linux_amd64.tar.gz b/lib/raylib/raylib-4.5.0_linux_amd64.tar.gz similarity index 100% rename from lib/raylib-4.5.0_linux_amd64.tar.gz rename to lib/raylib/raylib-4.5.0_linux_amd64.tar.gz diff --git a/lib/raylib-4.5.0_macos.tar.gz b/lib/raylib/raylib-4.5.0_macos.tar.gz similarity index 100% rename from lib/raylib-4.5.0_macos.tar.gz rename to lib/raylib/raylib-4.5.0_macos.tar.gz diff --git a/lib/raylib-4.5.0_win64_mingw-w64.zip b/lib/raylib/raylib-4.5.0_win64_mingw-w64.zip similarity index 100% rename from lib/raylib-4.5.0_win64_mingw-w64.zip rename to lib/raylib/raylib-4.5.0_win64_mingw-w64.zip