Skip to content

Commit

Permalink
πŸ– fix raylib
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeFTN committed May 3, 2023
1 parent 0f283e7 commit 337bdeb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ bin/
**/*.o

# Ignore libs
lib/*.so.**
lib/*.so
lib/*.a
lib/*.h
lib/raylib/include
lib/raylib/lib
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand All @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 337bdeb

Please sign in to comment.