Browse Source

Review build release path, default to src directory

raysan5 6 years ago
parent
commit
0bbf857b00

+ 3 - 32
src/Makefile

@@ -42,7 +42,7 @@
 .PHONY: all clean install uninstall
 .PHONY: all clean install uninstall
 
 
 # Define required raylib variables
 # Define required raylib variables
-RAYLIB_VERSION     = 2.0.0
+RAYLIB_VERSION     = 2.4.0
 RAYLIB_API_VERSION = 2
 RAYLIB_API_VERSION = 2
 
 
 # See below for alternatives.
 # See below for alternatives.
@@ -180,34 +180,10 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID)
     endif
     endif
 endif
 endif
 
 
-# RAYLIB_RELEASE_PATH points to library build path, right now 
+# Define output directory for compiled library, defaults to src directory
+# NOTE: If externally provided, make sure directory exists
 RAYLIB_RELEASE_PATH  ?= $(RAYLIB_PATH)/src
 RAYLIB_RELEASE_PATH  ?= $(RAYLIB_PATH)/src
 
 
-# Define output directory for compiled library
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS),WINDOWS)
-        RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)\mingw\i686-w64-mingw32\lib
-    endif
-    ifeq ($(PLATFORM_OS),LINUX)
-        RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-    endif
-    ifeq ($(PLATFORM_OS),OSX)
-        RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-    endif
-    ifeq ($(PLATFORM_OS),BSD)
-        RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_RPI)
-    RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src/android/$(ANDROID_ARCH_NAME)
-endif
-
 # Define raylib graphics api depending on selected platform
 # Define raylib graphics api depending on selected platform
 ifeq ($(PLATFORM),PLATFORM_DESKTOP)
 ifeq ($(PLATFORM),PLATFORM_DESKTOP)
     # By default use OpenGL 3.3 on desktop platforms
     # By default use OpenGL 3.3 on desktop platforms
@@ -444,11 +420,6 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
 	emcc -O1 $(OBJS) -o $(RAYLIB_RELEASE_PATH)/libraylib.bc
 	emcc -O1 $(OBJS) -o $(RAYLIB_RELEASE_PATH)/libraylib.bc
 	@echo "raylib library generated (libraylib.bc)!"
 	@echo "raylib library generated (libraylib.bc)!"
 else
 else
-    ifeq ($(PLATFORM_OS),WINDOWS)
-		if not exist $(RAYLIB_RELEASE_PATH) mkdir $(RAYLIB_RELEASE_PATH)
-    else
-		mkdir -p $(RAYLIB_RELEASE_PATH)
-    endif
     ifeq ($(RAYLIB_LIBTYPE),SHARED)
     ifeq ($(RAYLIB_LIBTYPE),SHARED)
         ifeq ($(PLATFORM),PLATFORM_DESKTOP)
         ifeq ($(PLATFORM),PLATFORM_DESKTOP)
             ifeq ($(PLATFORM_OS),WINDOWS)
             ifeq ($(PLATFORM_OS),WINDOWS)

+ 5 - 5
templates/advance_game/Makefile

@@ -26,7 +26,7 @@
 # Define required raylib variables
 # Define required raylib variables
 # WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
 # WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
 PLATFORM            ?= PLATFORM_DESKTOP
 PLATFORM            ?= PLATFORM_DESKTOP
-RAYLIB_PATH         = ../..
+RAYLIB_PATH         ?= ../..
 PROJECT_NAME        ?= advance_game
 PROJECT_NAME        ?= advance_game
 
 
 # Default path for raylib on Raspberry Pi, if installed in different path, update it!
 # Default path for raylib on Raspberry Pi, if installed in different path, update it!
@@ -58,7 +58,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
         ifeq ($(UNAMEOS),Linux)
         ifeq ($(UNAMEOS),Linux)
             PLATFORM_OS=LINUX
             PLATFORM_OS=LINUX
         endif
         endif
-       ifeq ($(UNAMEOS),FreeBSD)
+        ifeq ($(UNAMEOS),FreeBSD)
             PLATFORM_OS=BSD
             PLATFORM_OS=BSD
         endif
         endif
         ifeq ($(UNAMEOS),OpenBSD)
         ifeq ($(UNAMEOS),OpenBSD)
@@ -209,7 +209,7 @@ endif
 LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src 
 LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src 
 
 
 ifeq ($(PLATFORM),PLATFORM_DESKTOP)
 ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS),FREEBSD)
+    ifeq ($(PLATFORM_OS),BSD)
         INCLUDE_PATHS += -I/usr/local/include
         INCLUDE_PATHS += -I/usr/local/include
         LDFLAGS += -L. -Lsrc -L/usr/local/lib
         LDFLAGS += -L. -Lsrc -L/usr/local/lib
     endif
     endif
@@ -249,8 +249,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
         # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
         # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
         LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
         LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
     endif
     endif
-    ifeq ($(PLATFORM_OS),FREEBSD)
-        # Libraries for FreeBSD desktop compiling
+    ifeq ($(PLATFORM_OS),BSD)
+        # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
         # NOTE: Required packages: mesa-libs
         # NOTE: Required packages: mesa-libs
         LDLIBS = -lraylib -lGL -lpthread -lm
         LDLIBS = -lraylib -lGL -lpthread -lm
 
 

+ 4 - 2
templates/advance_game/Makefile.Android

@@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib
 
 
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 RAYLIB_LIBTYPE ?= STATIC
 RAYLIB_LIBTYPE ?= STATIC
-RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME)
+
+# Library path for libraylib.s/libraylib.so
+RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
 
 
 # Shared libs must be added to APK if required
 # Shared libs must be added to APK if required
 # NOTE: Generated NativeLoader.java automatically load those libraries
 # NOTE: Generated NativeLoader.java automatically load those libraries
@@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 
 
 # Paths containing required header files
 # Paths containing required header files
-INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue
+INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
 
 
 # Linker options
 # Linker options
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 

+ 4 - 2
templates/simple_game/Makefile.Android

@@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib
 
 
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 RAYLIB_LIBTYPE ?= STATIC
 RAYLIB_LIBTYPE ?= STATIC
-RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME)
+
+# Library path for libraylib.s/libraylib.so
+RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
 
 
 # Shared libs must be added to APK if required
 # Shared libs must be added to APK if required
 # NOTE: Generated NativeLoader.java automatically load those libraries
 # NOTE: Generated NativeLoader.java automatically load those libraries
@@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 
 
 # Paths containing required header files
 # Paths containing required header files
-INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue
+INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
 
 
 # Linker options
 # Linker options
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 

+ 4 - 2
templates/standard_game/Makefile.Android

@@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib
 
 
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
 RAYLIB_LIBTYPE ?= STATIC
 RAYLIB_LIBTYPE ?= STATIC
-RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME)
+
+# Library path for libraylib.s/libraylib.so
+RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
 
 
 # Shared libs must be added to APK if required
 # Shared libs must be added to APK if required
 # NOTE: Generated NativeLoader.java automatically load those libraries
 # NOTE: Generated NativeLoader.java automatically load those libraries
@@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
 
 
 # Paths containing required header files
 # Paths containing required header files
-INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue
+INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
 
 
 # Linker options
 # Linker options
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a 
 LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a