From b3110c14feee4036e5504b2a16b2b8e506fc9b7a Mon Sep 17 00:00:00 2001 From: Martinfx Date: Sat, 28 Oct 2017 17:30:02 +0200 Subject: Added support FreeBSD --- src/Makefile | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 13be7844..14d9760d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,6 +6,7 @@ # PLATFORM_DESKTOP: Windows (win32/Win64) # PLATFORM_DESKTOP: Linux # PLATFORM_DESKTOP: OSX (Mac) +# PLATFORM_DESKTOP: FreeBSD # PLATFORM_ANDROID: Android (ARM or ARM64) # PLATFORM_RPI: Raspberry Pi (Raspbian) # PLATFORM_WEB: HTML5 (Chrome, Firefox) @@ -76,11 +77,13 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) UNAMEOS=$(shell uname) ifeq ($(UNAMEOS),Linux) PLATFORM_OS=LINUX - else + endif + ifeq ($(UNAMEOS),FreeBSD) + PLATFORM_OS=FREEBSD + endif ifeq ($(UNAMEOS),Darwin) PLATFORM_OS=OSX endif - endif endif endif @@ -117,6 +120,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),OSX) RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx endif + ifeq ($(PLATFORM_OS),FREEBSD) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi @@ -165,6 +171,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # OSX default compiler CC = clang endif + ifeq ($(PLATFORM_OS),FREEBSD) + # default compiler + CC = clang + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(RPI_CROSS_COMPILE),YES) @@ -259,6 +269,13 @@ endif # NOTE: Several external required libraries (stb and others) INCLUDE_PATHS = -I. -Iexternal -Iexternal/include +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),FREEBSD) + INCLUDE_PATHS += -I/usr/local/include + LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) + endif +endif + # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) # RPI requried libraries @@ -333,6 +350,12 @@ else install_name_tool -id "libraylib.dylib" $(RAYLIB_RELEASE_PATH)/libraylib.dylib @echo "raylib shared library generated (libraylib.dylib)!" endif + ifeq ($(PLATFORM_OS),FREEBSD) + # Compile raylib to shared library version for FreeBSD + # WARNING: you should type "make clean" before doing this target + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lpthread + @echo "raylib shared library generated (libraylib.so)!" + endif ifeq ($(PLATFORM),PLATFORM_ANDROID) $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) $(LDFLAGS) $(LDLIBS) @echo "raylib shared library generated (libraylib.so)!" -- cgit v1.2.3 From 47c7f3624f187db057cd5a05a46247f99730c7b2 Mon Sep 17 00:00:00 2001 From: Martinfx Date: Sat, 28 Oct 2017 18:41:29 +0200 Subject: Added support FreeBSD for example --- src/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 14d9760d..176991bb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -172,7 +172,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CC = clang endif ifeq ($(PLATFORM_OS),FREEBSD) - # default compiler + # FreeBSD default compiler CC = clang endif endif @@ -351,8 +351,7 @@ else @echo "raylib shared library generated (libraylib.dylib)!" endif ifeq ($(PLATFORM_OS),FREEBSD) - # Compile raylib to shared library version for FreeBSD - # WARNING: you should type "make clean" before doing this target + # WARNING: you should type "gmake clean" before doing this target $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lpthread @echo "raylib shared library generated (libraylib.so)!" endif -- cgit v1.2.3 From 743cc6add68111cde0366476823537210c38cab4 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 30 Oct 2017 00:14:13 +0100 Subject: Review new build platform: FreeBSD Corrected issue with RPI_CROSS_COMPILE --- src/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 176991bb..29b3fb75 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,11 +3,11 @@ # raylib makefile # # Platforms supported: -# PLATFORM_DESKTOP: Windows (win32/Win64) +# PLATFORM_DESKTOP: Windows (Win32, Win64) # PLATFORM_DESKTOP: Linux -# PLATFORM_DESKTOP: OSX (Mac) +# PLATFORM_DESKTOP: OSX/macOS # PLATFORM_DESKTOP: FreeBSD -# PLATFORM_ANDROID: Android (ARM or ARM64) +# PLATFORM_ANDROID: Android (ARM, ARM64) # PLATFORM_RPI: Raspberry Pi (Raspbian) # PLATFORM_WEB: HTML5 (Chrome, Firefox) # @@ -57,9 +57,12 @@ endif # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) - RPI_CROSS_COMPILE ?= YES - RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry - RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot + RPI_CROSS_COMPILE ?= NO + + ifeq ($(RPI_CROSS_COMPILE),YES) + RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry + RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot + endif endif # Determine if the file has root access (only for installing raylib) @@ -352,8 +355,8 @@ else endif ifeq ($(PLATFORM_OS),FREEBSD) # WARNING: you should type "gmake clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lpthread - @echo "raylib shared library generated (libraylib.so)!" + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lpthread + @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM),PLATFORM_ANDROID) $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) $(LDFLAGS) $(LDLIBS) -- cgit v1.2.3 From 9a7524661fd31aef254abc1266132775aa4f0d07 Mon Sep 17 00:00:00 2001 From: Ray San Date: Thu, 30 Nov 2017 16:59:09 +0100 Subject: Removed GLFW3 linking and added rglfw --- src/Makefile | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 29b3fb75..2408f0f1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -89,6 +89,12 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif endif +ifeq ($(PLATFORM),PLATFORM_RPI) + UNAMEOS=$(shell uname) + ifeq ($(UNAMEOS),Linux) + PLATFORM_OS=LINUX + endif +endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables @@ -224,7 +230,7 @@ endif # Define compiler flags: # -O1 defines optimization level -# -Og enable debugging +# -g enable debugging # -s strip unnecessary data from build # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) @@ -270,7 +276,7 @@ endif # Define include paths for required headers # NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -Iexternal -Iexternal/include +INCLUDE_PATHS = -I. -Iexternal -Iexternal/include -Iexternal/glfw/include ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),FREEBSD) @@ -310,8 +316,23 @@ endif # Define all object files required with a wildcard # The wildcard takes all files that finish with ".c", # and replaces extentions with ".o", that are the object files -OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) -OBJS += stb_vorbis.o +# NOTE: Some objects depend on the PLATFORM to be added or not! +# OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) + +# Define object required on compilation +OBJS = core.o \ + rlgl.o \ + shapes.o \ + textures.o \ + text.o \ + models.o \ + audio.o \ + stb_vorbis.o \ + utils.o + +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + OBJS += rglfw.o +endif # Default target entry all: raylib @@ -338,24 +359,24 @@ else ifeq ($(RAYLIB_LIBTYPE),SHARED) # NOTE: If using OpenAL Soft as static library, all its dependencies must be also linked in the shared library ifeq ($(PLATFORM_OS),WINDOWS) - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -lglfw3 -lgdi32 -lopenal32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -lgdi32 -lopenal32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" @echo "expected OpenAL Soft static library linking" endif ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lm -lpthread -ldl + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lopenal -lm -lpthread -ldl @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM_OS),OSX) - $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.dylib $(OBJS) -L/usr/local/Cellar/glfw/3.2.1/lib -lglfw -framework OpenGL -framework OpenAL -framework Cocoa + $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.dylib $(OBJS) -L/usr/local/Cellar/glfw/3.2.1/lib -framework OpenGL -framework OpenAL -framework Cocoa install_name_tool -id "libraylib.dylib" $(RAYLIB_RELEASE_PATH)/libraylib.dylib @echo "raylib shared library generated (libraylib.dylib)!" endif ifeq ($(PLATFORM_OS),FREEBSD) # WARNING: you should type "gmake clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lglfw -lGL -lopenal -lpthread + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lopenal -lpthread @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM),PLATFORM_ANDROID) @@ -380,6 +401,10 @@ endif # Compile core module core.o : core.c raylib.h rlgl.h utils.h raymath.h gestures.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) + +# Compile rglfw module +rglfw.o : rglfw.c + $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) # Compile rlgl module rlgl.o : rlgl.c rlgl.h raymath.h -- cgit v1.2.3 From 3b5a26099e0cde67084481eb6048058578b30a0c Mon Sep 17 00:00:00 2001 From: Ray San Date: Tue, 5 Dec 2017 14:01:35 +0100 Subject: Removed OpenAL Soft dependency on building OpenAL Soft backend is still available in audio module, I'm thinking if exposing it for building in some way or just left it there for advance users to switch to it manually in case of necessity... --- src/Makefile | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 2408f0f1..83aec5dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,7 @@ # # Platforms supported: # PLATFORM_DESKTOP: Windows (Win32, Win64) -# PLATFORM_DESKTOP: Linux +# PLATFORM_DESKTOP: Linux (32 and 64 bit) # PLATFORM_DESKTOP: OSX/macOS # PLATFORM_DESKTOP: FreeBSD # PLATFORM_ANDROID: Android (ARM, ARM64) @@ -14,7 +14,7 @@ # Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline. # Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline. # -# Copyright (c) 2014-2017 Ramon Santamaria (@raysan5) +# Copyright (c) 2014-2018 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. # In no event will the authors be held liable for any damages arising from @@ -43,17 +43,10 @@ # Define required raylib variables PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH ?= .. +RAYLIB_PATH = .. -# Library type used for raylib and OpenAL Soft: STATIC (.a) or SHARED (.so/.dll) -# NOTE: OpenAL Soft library should be provided in the selected form +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC -OPENAL_LIBTYPE ?= STATIC - -# On PLATFORM_WEB force OpenAL Soft shared library -ifeq ($(PLATFORM),PLATFORM_WEB) - OPENAL_LIBTYPE = SHARED -endif # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) @@ -269,14 +262,9 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED endif -# Define required compilation flags for OpenAL Soft STATIC lib -ifeq ($(OPENAL_LIBTYPE),STATIC) - ALFLAGS = -DAL_LIBTYPE_STATIC -Wl,-allow-multiple-definition -endif - # Define include paths for required headers # NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -Iexternal -Iexternal/include -Iexternal/glfw/include +INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),FREEBSD) @@ -310,7 +298,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) # Library paths containing required libs LDFLAGS += -L. -Lsrc -L$(RAYLIB_RELEASE_PATH) - LDLIBS = -lopenal -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm + LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm endif # Define all object files required with a wildcard @@ -327,6 +315,7 @@ OBJS = core.o \ text.o \ models.o \ audio.o \ + mini_al.o \ stb_vorbis.o \ utils.o @@ -357,16 +346,14 @@ ifeq ($(PLATFORM),PLATFORM_WEB) @echo "raylib library generated (libraylib.bc)!" else ifeq ($(RAYLIB_LIBTYPE),SHARED) - # NOTE: If using OpenAL Soft as static library, all its dependencies must be also linked in the shared library ifeq ($(PLATFORM_OS),WINDOWS) - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -lgdi32 -lopenal32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -static-libgcc -lopengl32 -lgdi32 -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" - @echo "expected OpenAL Soft static library linking" endif ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lopenal -lm -lpthread -ldl + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lm -lpthread -ldl @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM_OS),OSX) @@ -376,7 +363,7 @@ else endif ifeq ($(PLATFORM_OS),FREEBSD) # WARNING: you should type "gmake clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lopenal -lpthread + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lpthread @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM),PLATFORM_ANDROID) @@ -388,11 +375,6 @@ else @echo raylib library release path is $(RAYLIB_RELEASE_PATH) $(AR) rcs $(RAYLIB_RELEASE_PATH)/libraylib.a $(OBJS) @echo "raylib static library generated (libraylib.a)!" - ifeq ($(OPENAL_LIBTYPE),STATIC) - @echo "expected OpenAL Soft static library linking" - else - @echo "expected OpenAL Soft shared library linking" - endif endif endif @@ -428,7 +410,11 @@ models.o : models.c raylib.h rlgl.h raymath.h # Compile audio module audio.o : audio.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) $(ALFLAGS) + $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) + +# Compile mini_al audio library +mini_al.o : external/mini_al.c external/mini_al.h + $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) # Compile stb_vorbis library stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h -- cgit v1.2.3 From 5ae2c0d15b349ce59425c319165505bda8298a6c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 9 Dec 2017 19:05:42 +0100 Subject: Added Wayland support Updated to latest GLFW library and working on Wayland support, still looking how to implement it on raylib because it just exposes PLATFORM_DESKTOP and defaults to X11 windowing system on Linux... --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 83aec5dd..e3bb91cc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -353,7 +353,7 @@ else ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lm -lpthread -ldl + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lm -lpthread -ldl -lrt @echo "raylib shared library generated (libraylib.so)!" endif ifeq ($(PLATFORM_OS),OSX) -- cgit v1.2.3 From d24b89bb0ec8abe7243963bdbca96cb254c27256 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 10 Dec 2017 21:57:25 +0100 Subject: Add library versioning to Make/CMake build systems See #401 for the discussion. Also bumps version number to 1.9.2 without the -dev, because neither ELF nor MachO like such a suffix. The -dev suffix will have to be restricted to the git tags. --- src/Makefile | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index e3bb91cc..b9c21929 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,6 +42,8 @@ .PHONY: all clean install uninstall # Define required raylib variables +VERSION = 1.9.2 +API_VERSION = 1 PLATFORM ?= PLATFORM_DESKTOP RAYLIB_PATH = .. @@ -172,6 +174,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),OSX) # OSX default compiler CC = clang + GLFW_CFLAGS = -x objective-c endif ifeq ($(PLATFORM_OS),FREEBSD) # FreeBSD default compiler @@ -291,7 +294,7 @@ endif # Define linker options ifeq ($(PLATFORM),PLATFORM_ANDROID) - LDFLAGS = -Wl,-soname,libraylib.so -Wl,--exclude-libs,libatomic.a + LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings # Force linking of library module to define symbol LDFLAGS += -u ANativeActivity_onCreate @@ -353,22 +356,30 @@ else ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lm -lpthread -ldl -lrt - @echo "raylib shared library generated (libraylib.so)!" + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lm -lpthread -ldl -lrt + @echo "raylib shared library generated (libraylib.$(VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so endif ifeq ($(PLATFORM_OS),OSX) - $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.dylib $(OBJS) -L/usr/local/Cellar/glfw/3.2.1/lib -framework OpenGL -framework OpenAL -framework Cocoa - install_name_tool -id "libraylib.dylib" $(RAYLIB_RELEASE_PATH)/libraylib.dylib - @echo "raylib shared library generated (libraylib.dylib)!" + $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib $(OBJS) -compatibility_version $(API_VERSION) -current_version $(VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa + install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib + @echo "raylib shared library generated (libraylib.$(VERSION).dylib)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.$(API_VERSION).dylib + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.dylib endif ifeq ($(PLATFORM_OS),FREEBSD) # WARNING: you should type "gmake clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) -lGL -lpthread - @echo "raylib shared library generated (libraylib.so)!" + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lpthread + @echo "raylib shared library generated (libraylib.$(VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so endif ifeq ($(PLATFORM),PLATFORM_ANDROID) - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so $(OBJS) $(LDFLAGS) $(LDLIBS) - @echo "raylib shared library generated (libraylib.so)!" + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS) + @echo "raylib shared library generated (libraylib.$(VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so endif else # Compile raylib static library @@ -386,7 +397,7 @@ core.o : core.c raylib.h rlgl.h utils.h raymath.h gestures.h # Compile rglfw module rglfw.o : rglfw.c - $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) $(GLFW_CFLAGS) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) # Compile rlgl module rlgl.o : rlgl.c rlgl.h raymath.h @@ -434,6 +445,8 @@ ifeq ($(ROOT),root) # /usr/local/include/) are for libraries that are installed # manually (without a package manager). ifeq ($(RAYLIB_LIBTYPE),SHARED) + cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so /usr/local/lib/libraylib.$(VERSION).so + cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so /usr/local/lib/libraylib.$(API_VERSION).so cp --update $(RAYLIB_RELEASE_PATH)/libraylib.so /usr/local/lib/libraylib.so else cp --update raylib.h /usr/local/include/raylib.h @@ -455,6 +468,8 @@ ifeq ($(ROOT),root) rm --force /usr/local/include/raylib.h ifeq ($(RAYLIB_LIBTYPE),SHARED) rm --force /usr/local/lib/libraylib.so + rm --force /usr/local/lib/libraylib.$(API_VERSION).so + rm --force /usr/local/lib/libraylib.$(VERSION).so else rm --force /usr/local/lib/libraylib.a endif @@ -471,7 +486,7 @@ clean: ifeq ($(PLATFORM_OS),WINDOWS) del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o else - rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o + rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so external/stb_vorbis.o endif ifeq ($(PLATFORM),PLATFORM_ANDROID) rm -rf $(ANDROID_TOOLCHAIN) -- cgit v1.2.3 From b155333178247d917e99e806cdcb27e9ab2d5c3c Mon Sep 17 00:00:00 2001 From: Ray San Date: Fri, 15 Dec 2017 17:02:29 +0100 Subject: Support audio module skip on compiling Some programs like tools could not require audio support --- src/Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index b9c21929..00f5fa2f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,6 +47,10 @@ API_VERSION = 1 PLATFORM ?= PLATFORM_DESKTOP RAYLIB_PATH = .. +# Included raylib audio module on compilation +# NOTE: Some programs like tools could not require audio support +INCLUDE_AUDIO_MODULE ?= YES + # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC @@ -317,15 +321,18 @@ OBJS = core.o \ textures.o \ text.o \ models.o \ - audio.o \ - mini_al.o \ - stb_vorbis.o \ utils.o ifeq ($(PLATFORM),PLATFORM_DESKTOP) OBJS += rglfw.o endif +ifeq ($(INCLUDE_AUDIO_MODULE),YES) + OBJS += audio.o + OBJS += mini_al.o + OBJS += stb_vorbis.o +endif + # Default target entry all: raylib -- cgit v1.2.3 From 61afd07bd7b3a96c6f0f460b668f52cf1a8bd90f Mon Sep 17 00:00:00 2001 From: Ray San Date: Wed, 20 Dec 2017 12:34:18 +0100 Subject: Force OpenAL backend on some platforms OpenAL audio backend is being forced on HTML5 and OSX --- src/Makefile | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 00f5fa2f..1d1aa75c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,12 +47,20 @@ API_VERSION = 1 PLATFORM ?= PLATFORM_DESKTOP RAYLIB_PATH = .. +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) +RAYLIB_LIBTYPE ?= STATIC + # Included raylib audio module on compilation # NOTE: Some programs like tools could not require audio support INCLUDE_AUDIO_MODULE ?= YES -# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +# Force OpenAL Soft backend for audio +FORCE_OPENAL_BACKEND ?= FALSE + +# OpenAL Soft audio backend forced on HTML5 and OSX (see below) +ifeq ($(PLATFORM),PLATFORM_WEB) + FORCE_OPENAL_BACKEND = TRUE +endif # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) @@ -95,6 +103,13 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif endif +# Force OpenAL Soft audio backend for OSX platform +# NOTE 1: mini_al library does not support CoreAudio yet +# NOTE 2: Required OpenAL libraries should be available on OSX +ifeq ($(PLATFORM_OS),OSX) + FORCE_OPENAL_BACKEND = TRUE +endif + ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables EMSDK_PATH = C:/emsdk @@ -269,6 +284,10 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED endif +ifeq ($(FORCE_OPENAL_BACKEND),TRUE) + CFLAGS += -DFORCE_OPENAL_BACKEND +endif + # Define include paths for required headers # NOTE: Several external required libraries (stb and others) INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include @@ -329,8 +348,10 @@ endif ifeq ($(INCLUDE_AUDIO_MODULE),YES) OBJS += audio.o - OBJS += mini_al.o OBJS += stb_vorbis.o +ifeq ($(FORCE_OPENAL_BACKEND),FALSE) + OBJS += mini_al.o +endif endif # Default target entry -- cgit v1.2.3 From c93bca8c272af83ae752afb46db2b54d85dca454 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 28 Dec 2017 17:58:09 +0100 Subject: Review Makefile config flags Support external GLFW usage Renamed some flags for consistency --- src/Makefile | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 1d1aa75c..de9a639e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -52,21 +52,24 @@ RAYLIB_LIBTYPE ?= STATIC # Included raylib audio module on compilation # NOTE: Some programs like tools could not require audio support -INCLUDE_AUDIO_MODULE ?= YES +INCLUDE_AUDIO_MODULE ?= TRUE # Force OpenAL Soft backend for audio -FORCE_OPENAL_BACKEND ?= FALSE +USE_OPENAL_BACKEND ?= FALSE + +# Use external GLFW library instead of rglfw module +USE_EXTERNAL_GLFW ?= FALSE # OpenAL Soft audio backend forced on HTML5 and OSX (see below) ifeq ($(PLATFORM),PLATFORM_WEB) - FORCE_OPENAL_BACKEND = TRUE + USE_OPENAL_BACKEND = TRUE endif # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) - RPI_CROSS_COMPILE ?= NO + USE_RPI_CROSS_COMPILER ?= FALSE - ifeq ($(RPI_CROSS_COMPILE),YES) + ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot endif @@ -107,7 +110,7 @@ endif # NOTE 1: mini_al library does not support CoreAudio yet # NOTE 2: Required OpenAL libraries should be available on OSX ifeq ($(PLATFORM_OS),OSX) - FORCE_OPENAL_BACKEND = TRUE + USE_OPENAL_BACKEND = TRUE endif ifeq ($(PLATFORM),PLATFORM_WEB) @@ -201,7 +204,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_RPI) - ifeq ($(RPI_CROSS_COMPILE),YES) + ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) # Define RPI cross-compiler #CC = armv6j-hardfloat-linux-gnueabi-gcc CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc @@ -226,7 +229,7 @@ endif AR = ar ifeq ($(PLATFORM),PLATFORM_RPI) - ifeq ($(RPI_CROSS_COMPILE),YES) + ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) # Define RPI cross-archiver #CC = armv6j-hardfloat-linux-gnueabi-gcc AR = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-ar @@ -284,8 +287,8 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED endif -ifeq ($(FORCE_OPENAL_BACKEND),TRUE) - CFLAGS += -DFORCE_OPENAL_BACKEND +ifeq ($(USE_OPENAL_BACKEND),TRUE) + CFLAGS += -DUSE_OPENAL_BACKEND endif # Define include paths for required headers @@ -297,6 +300,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) INCLUDE_PATHS += -I/usr/local/include LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) endif + ifeq ($(USE_EXTERNAL_GLFW),TRUE) + LDFLAGS += -lglfw + endif endif # Define additional directories containing required header files @@ -343,15 +349,17 @@ OBJS = core.o \ utils.o ifeq ($(PLATFORM),PLATFORM_DESKTOP) - OBJS += rglfw.o + ifeq ($(USE_EXTERNAL_GLFW),FALSE) + OBJS += rglfw.o + endif endif -ifeq ($(INCLUDE_AUDIO_MODULE),YES) +ifeq ($(INCLUDE_AUDIO_MODULE),TRUE) OBJS += audio.o OBJS += stb_vorbis.o -ifeq ($(FORCE_OPENAL_BACKEND),FALSE) - OBJS += mini_al.o -endif + ifeq ($(USE_OPENAL_BACKEND),FALSE) + OBJS += mini_al.o + endif endif # Default target entry -- cgit v1.2.3 From 7965f983baa91afa7ac8019574a14e4814c91cf2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 28 Dec 2017 18:14:39 +0100 Subject: Support Wayland display on Linux desktop --- src/Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index de9a639e..2ee9f909 100644 --- a/src/Makefile +++ b/src/Makefile @@ -54,12 +54,16 @@ RAYLIB_LIBTYPE ?= STATIC # NOTE: Some programs like tools could not require audio support INCLUDE_AUDIO_MODULE ?= TRUE -# Force OpenAL Soft backend for audio +# Use OpenAL Soft backend for audio USE_OPENAL_BACKEND ?= FALSE # Use external GLFW library instead of rglfw module USE_EXTERNAL_GLFW ?= FALSE +# Use Wayland display server protocol on Linux desktop +# by default it uses X11 windowing system +USE_WAYLAND_DISPLAY ?= FALSE + # OpenAL Soft audio backend forced on HTML5 and OSX (see below) ifeq ($(PLATFORM),PLATFORM_WEB) USE_OPENAL_BACKEND = TRUE @@ -287,10 +291,20 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED endif +# Use OpenAL Soft backend instead of mini_al ifeq ($(USE_OPENAL_BACKEND),TRUE) CFLAGS += -DUSE_OPENAL_BACKEND endif +# Use Wayland display on Linux desktop +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS), LINUX) + ifeq ($(USE_WAYLAND_DISPLAY),TRUE) + CFLAGS += -D_GLFW_WAYLAND + endif + endif +endif + # Define include paths for required headers # NOTE: Several external required libraries (stb and others) INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include -- cgit v1.2.3 From f2a675ae53321b5909e9324d3bb81250e704e4f2 Mon Sep 17 00:00:00 2001 From: - <-> Date: Mon, 15 Jan 2018 13:54:06 +0100 Subject: Reviewed Makefiles... - Renamed VERSION to RAYLIB_VERSION - Renamed API_VERSION to RAYLIB_API_VERSION - Renamed RAYLIB_RELEASE to RAYLIB_RELEASE_PATH - Support Web Assembly compilation on PLATFORM_WEB --- src/Makefile | 67 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 34 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 2ee9f909..fbab6725 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,19 +36,18 @@ # #****************************************************************************** -# Please read the wiki to know how to compile raylib, because there are -# different methods. +# Please read the wiki to know how to compile raylib, because there are different methods. +# https://github.com/raysan5/raylib/wiki .PHONY: all clean install uninstall # Define required raylib variables -VERSION = 1.9.2 -API_VERSION = 1 -PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH = .. - +PLATFORM ?= PLATFORM_DESKTOP +RAYLIB_PATH = .. +RAYLIB_VERSION = 1.9.2 +RAYLIB_API_VERSION = 1 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC # Included raylib audio module on compilation # NOTE: Some programs like tools could not require audio support @@ -120,8 +119,8 @@ endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables EMSDK_PATH = C:/emsdk - EMSCRIPTEN_VERSION = 1.37.21 - CLANG_VERSION=e1.37.21_64bit + EMSCRIPTEN_VERSION = 1.37.28 + CLANG_VERSION=e1.37.28_64bit PYTHON_VERSION=2.7.5.3_64bit NODE_VERSION=4.1.1_64bit export PATH=$(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) @@ -192,7 +191,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) GRAPHICS = GRAPHICS_API_OPENGL_ES2 endif -# Default C compiler: gcc +# Define default C compiler: gcc # NOTE: define g++ compiler if using C++ CC = gcc @@ -259,7 +258,7 @@ endif # -std=gnu99 defines C language mode (GNU C from 1999 revision) # -fgnu89-inline declaring inline functions support (GCC optimized) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) -# -D_DEFAULT_SOURCE use with -std=c99 +# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces # Additional flags for compiler (if desired) @@ -406,30 +405,30 @@ else ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lm -lpthread -ldl -lrt - @echo "raylib shared library generated (libraylib.$(VERSION).so)!" - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lm -lpthread -ldl -lrt + @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif ifeq ($(PLATFORM_OS),OSX) - $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib $(OBJS) -compatibility_version $(API_VERSION) -current_version $(VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa - install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib - @echo "raylib shared library generated (libraylib.$(VERSION).dylib)!" - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.$(API_VERSION).dylib - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.dylib + $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib $(OBJS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa + install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib + @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).dylib)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib endif ifeq ($(PLATFORM_OS),FREEBSD) # WARNING: you should type "gmake clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lpthread - @echo "raylib shared library generated (libraylib.$(VERSION).so)!" - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread + @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif ifeq ($(PLATFORM),PLATFORM_ANDROID) - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS) - @echo "raylib shared library generated (libraylib.$(VERSION).so)!" - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS) + @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so + cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif else # Compile raylib static library @@ -495,8 +494,8 @@ ifeq ($(ROOT),root) # /usr/local/include/) are for libraries that are installed # manually (without a package manager). ifeq ($(RAYLIB_LIBTYPE),SHARED) - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so /usr/local/lib/libraylib.$(VERSION).so - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so /usr/local/lib/libraylib.$(API_VERSION).so + cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_VERSION).so + cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so cp --update $(RAYLIB_RELEASE_PATH)/libraylib.so /usr/local/lib/libraylib.so else cp --update raylib.h /usr/local/include/raylib.h @@ -518,8 +517,8 @@ ifeq ($(ROOT),root) rm --force /usr/local/include/raylib.h ifeq ($(RAYLIB_LIBTYPE),SHARED) rm --force /usr/local/lib/libraylib.so - rm --force /usr/local/lib/libraylib.$(API_VERSION).so - rm --force /usr/local/lib/libraylib.$(VERSION).so + rm --force /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so + rm --force /usr/local/lib/libraylib.$(RAYLIB_VERSION).so else rm --force /usr/local/lib/libraylib.a endif @@ -536,7 +535,7 @@ clean: ifeq ($(PLATFORM_OS),WINDOWS) del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o else - rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so external/stb_vorbis.o + rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so external/stb_vorbis.o endif ifeq ($(PLATFORM),PLATFORM_ANDROID) rm -rf $(ANDROID_TOOLCHAIN) -- cgit v1.2.3 From 30ef3f3122dc05e8a950d21c4b098208d73e456b Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 18 Jan 2018 13:22:41 +0100 Subject: GCC/Clang: Treat void pointer arithmetic as error As an extension, GNU C treats sizeof(void) as 1. MSVC doesn't. Make it an error on GCC/Clang to avoid accidental MSVC breakage. --- src/Makefile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index fbab6725..f27ec575 100644 --- a/src/Makefile +++ b/src/Makefile @@ -250,16 +250,17 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) endif # Define compiler flags: -# -O1 defines optimization level -# -g enable debugging -# -s strip unnecessary data from build -# -Wall turns on most, but not all, compiler warnings -# -std=c99 defines C language mode (standard C from 1999 revision) -# -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -fgnu89-inline declaring inline functions support (GCC optimized) -# -Wno-missing-braces ignore invalid warning (GCC bug 53119) -# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces +# -O1 defines optimization level +# -g enable debugging +# -s strip unnecessary data from build +# -Wall turns on most, but not all, compiler warnings +# -std=c99 defines C language mode (standard C from 1999 revision) +# -std=gnu99 defines C language mode (GNU C from 1999 revision) +# -fgnu89-inline declaring inline functions support (GCC optimized) +# -Wno-missing-braces ignore invalid warning (GCC bug 53119) +# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec +# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith # Additional flags for compiler (if desired) #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes -- cgit v1.2.3 From c2ec88f93015f688905a0a35b64cc7c29daef223 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 25 Jan 2018 10:07:51 +0100 Subject: Support DEBUG library building --- src/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index f27ec575..c88aa6dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -48,6 +48,8 @@ RAYLIB_VERSION = 1.9.2 RAYLIB_API_VERSION = 1 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC +# Build mode for library: DEBUG or RELEASE +RAYLIB_BUILD_MODE ?= RELEASE # Included raylib audio module on compilation # NOTE: Some programs like tools could not require audio support @@ -262,6 +264,10 @@ endif # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith +ifeq ($(RAYLIB_BUILD_MODE), DEBUG) + CFLAGS += -g +endif + # Additional flags for compiler (if desired) #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes ifeq ($(PLATFORM),PLATFORM_WEB) -- cgit v1.2.3 From 8be93762d9a94a56bf430e0e177bdefb5b1fa0dd Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 25 Jan 2018 22:34:29 +0100 Subject: Make function calls without prior declaration an error which is the default behavior on C99 and up. --- src/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index c88aa6dd..fc85ea0a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -262,7 +262,8 @@ endif # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith +# -Werror=implicit-function-declaration catch function calls without prior declaration +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith -Werror=implicit-function-declaration ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g -- cgit v1.2.3 From 19f280f4b793963eeadad9c2b2cab38d07715992 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 4 Feb 2018 13:23:08 +0100 Subject: Bump version to 1.9.4 --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index fc85ea0a..e41a88a3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,7 @@ # Define required raylib variables PLATFORM ?= PLATFORM_DESKTOP RAYLIB_PATH = .. -RAYLIB_VERSION = 1.9.2 +RAYLIB_VERSION = 1.9.4 RAYLIB_API_VERSION = 1 # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC -- cgit v1.2.3 From d90a33b850d825c3047fd570478fc8a66f22414f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 11 Feb 2018 01:48:53 +0100 Subject: Some reviews for Android compilation --- src/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index e41a88a3..6752d9e7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -262,15 +262,20 @@ endif # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers -# -Werror=implicit-function-declaration catch function calls without prior declaration -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith -Werror=implicit-function-declaration +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g endif # Additional flags for compiler (if desired) -#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes +# -Wextra enables some extra warning flags that are not enabled by -Wall +# -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration +# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types +# -Werror=implicit-function-declaration catch function calls without prior declaration +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + CFLAGS += -Werror=implicit-function-declaration +endif ifeq ($(PLATFORM),PLATFORM_WEB) # -O2 # if used, also set --memory-init-file 0 # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) @@ -285,7 +290,8 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) # Compilation functions attributes options CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC # Compiler options for the linker - CFLAGS += -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes + # -Werror=format-security + CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes # Preprocessor macro definitions CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=16 endif -- cgit v1.2.3 From e86b4d4e03a91bfe37cb525b155af48724664e97 Mon Sep 17 00:00:00 2001 From: RDR8 Date: Sun, 11 Feb 2018 22:58:15 +0000 Subject: Update Makefiles for Linux installation. --- src/Makefile | 136 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 87 insertions(+), 49 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 6752d9e7..b44ff462 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ # # raylib makefile # -# Platforms supported: +# Platforms supported: # PLATFORM_DESKTOP: Windows (Win32, Win64) # PLATFORM_DESKTOP: Linux (32 and 64 bit) # PLATFORM_DESKTOP: OSX/macOS @@ -42,38 +42,52 @@ .PHONY: all clean install uninstall # Define required raylib variables -PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH = .. RAYLIB_VERSION = 1.9.4 RAYLIB_API_VERSION = 1 +RAYLIB_PATH = .. + +# Define default options + +# RAYLIB_RELEASE_PATH points to provided binaries and your immediate build of raylib. +# It is further modified below by PLATFORM below. +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs + +# See install target for *_INSTALL_PATH locations. + +# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC + # Build mode for library: DEBUG or RELEASE -RAYLIB_BUILD_MODE ?= RELEASE +RAYLIB_BUILD_MODE ?= RELEASE # Included raylib audio module on compilation # NOTE: Some programs like tools could not require audio support INCLUDE_AUDIO_MODULE ?= TRUE # Use OpenAL Soft backend for audio -USE_OPENAL_BACKEND ?= FALSE +USE_OPENAL_BACKEND ?= FALSE + +# OpenAL Soft audio backend forced on HTML5 and OSX (see below) +ifeq ($(PLATFORM),PLATFORM_WEB) + USE_OPENAL_BACKEND = TRUE +endif # Use external GLFW library instead of rglfw module -USE_EXTERNAL_GLFW ?= FALSE +USE_EXTERNAL_GLFW ?= FALSE # Use Wayland display server protocol on Linux desktop # by default it uses X11 windowing system -USE_WAYLAND_DISPLAY ?= FALSE +USE_WAYLAND_DISPLAY ?= FALSE -# OpenAL Soft audio backend forced on HTML5 and OSX (see below) -ifeq ($(PLATFORM),PLATFORM_WEB) - USE_OPENAL_BACKEND = TRUE -endif +# See below for more GRAPHICS options. # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) USE_RPI_CROSS_COMPILER ?= FALSE - + ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot @@ -138,8 +152,6 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ANDROID_ARCH ?= ARM endif -RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs - # Define output directory for compiled library ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) @@ -299,7 +311,7 @@ endif # Define required compilation flags for raylib SHARED lib ifeq ($(RAYLIB_LIBTYPE),SHARED) # make sure code is compiled as position independent - # BE CAREFUL: It seems that for gcc -fpic si not the same as -fPIC + # BE CAREFUL: It seems that for gcc -fpic is not the same as -fPIC # MinGW32 just doesn't need -fPIC, it shows warnings CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED endif @@ -350,8 +362,8 @@ endif # Define linker options ifeq ($(PLATFORM),PLATFORM_ANDROID) - LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a - LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings + LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a + LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings # Force linking of library module to define symbol LDFLAGS += -u ANativeActivity_onCreate # Library paths containing required libs @@ -374,7 +386,7 @@ OBJS = core.o \ text.o \ models.o \ utils.o - + ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(USE_EXTERNAL_GLFW),FALSE) OBJS += rglfw.o @@ -419,10 +431,10 @@ else ifeq ($(PLATFORM_OS),LINUX) # Compile raylib to shared library version for GNU/Linux. # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lm -lpthread -ldl -lrt - @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so - cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so + $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(OBJS) -shared -Wl,-soname,libraylib.so.$(RAYLIB_API_VERSION) -lGL -lc -lm -lpthread -ldl -lrt + @echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION))!" + cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) + cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so endif ifeq ($(PLATFORM_OS),OSX) $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib $(OBJS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa @@ -457,7 +469,7 @@ endif # Compile core module core.o : core.c raylib.h rlgl.h utils.h raymath.h gestures.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) - + # Compile rglfw module rglfw.o : rglfw.c $(CC) $(GLFW_CFLAGS) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) @@ -485,10 +497,10 @@ models.o : models.c raylib.h rlgl.h raymath.h # Compile audio module audio.o : audio.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) - + # Compile mini_al audio library mini_al.o : external/mini_al.c external/mini_al.h - $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) # Compile stb_vorbis library stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h @@ -499,49 +511,75 @@ utils.o : utils.c utils.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) # Install generated and needed files to required directories -# TODO: add other platforms. +# TODO: Add other platforms. Remove sudo requirement, i.e. add USER mode. +# On GNU/Linux and BSDs, there are some standard directories that contain extra +# libraries and header files. These directories (often /usr/local/lib and +# /usr/local/include) are for libraries that are installed manually +# (without a package manager). We'll use /usr/local/lib/raysan5 and /usr/local/include/raysan5 +# for our -L and -I specification to simplify management of the raylib source package. +# Customize these locations if you like but don't forget to pass them to make +# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig,. +# Hint: add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles. +# See below and ../examples/Makefile for more information. + +# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. +RAYLIB_INSTALL_PATH ?= /usr/local/lib/raysan5 +# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. +RAYLIB_H_INSTALL_PATH ?= /usr/local/include/raysan5 + install : ifeq ($(ROOT),root) + # Attention! You are root. Consult this Makefile for more information." ifeq ($(PLATFORM_OS),LINUX) - # On GNU/Linux there are some standard directories that contain - # libraries and header files. These directory (/usr/local/lib and - # /usr/local/include/) are for libraries that are installed - # manually (without a package manager). - ifeq ($(RAYLIB_LIBTYPE),SHARED) - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_VERSION).so - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.so /usr/local/lib/libraylib.so - else - cp --update raylib.h /usr/local/include/raylib.h - cp --update $(RAYLIB_RELEASE_PATH)/libraylib.a /usr/local/lib/libraylib.a - endif + # Prepare the environment as needed. + mkdir --parents --verbose $(RAYLIB_INSTALL_PATH) + mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH) + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Installing the shared library. + cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) + cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) + cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so + # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH. + # Not necessary if later embedding RPATH in your executable. See examples/Makefile. + ldconfig $(RAYLIB_INSTALL_PATH) + else + # Installing the static library. + cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_INSTALL_PATH)/libraylib.a + endif + # Let's have all the source. + cp --update --recursive $(RAYLIB_PATH)/src/*.h $(RAYLIB_H_INSTALL_PATH)/ + cp --update --recursive $(RAYLIB_PATH)/src/*.c $(RAYLIB_H_INSTALL_PATH)/ + cp --update --recursive $(RAYLIB_PATH)/src/external $(RAYLIB_H_INSTALL_PATH)/ + cp --update --recursive $(RAYLIB_PATH)/release/include/AL $(RAYLIB_H_INSTALL_PATH)/external @echo "raylib dev files installed/updated!" else - @echo "This function works only on GNU/Linux systems" + @echo "This function currently works on GNU/Linux systems. Add yours today (^;" endif else - @echo "Error: no root permissions" + @echo "Error: Root permissions needed for installation. Try sudo make install" endif # Remove raylib dev files installed on the system # TODO: see 'install' target. uninstall : ifeq ($(ROOT),root) + # Warning! You are root. Please confirm that there is nothing here to keep. + # Proceeding will remove everything under the specified locations! ifeq ($(PLATFORM_OS),LINUX) - rm --force /usr/local/include/raylib.h ifeq ($(RAYLIB_LIBTYPE),SHARED) - rm --force /usr/local/lib/libraylib.so - rm --force /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so - rm --force /usr/local/lib/libraylib.$(RAYLIB_VERSION).so + rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so* + # Uncomment to clean up the runtime linker cache. See install target. + ldconfig else - rm --force /usr/local/lib/libraylib.a + rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a endif - @echo "raylib development files removed!" + rm --force --interactive=once --recursive $(RAYLIB_H_INSTALL_PATH)/* + @echo "raylib development files removed!" else @echo "This function works only on GNU/Linux systems" endif else - @echo "Error: no root permissions" + @echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall" endif # Clean everything @@ -549,7 +587,7 @@ clean: ifeq ($(PLATFORM_OS),WINDOWS) del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o else - rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so external/stb_vorbis.o + rm -fv *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so* external/stb_vorbis.o endif ifeq ($(PLATFORM),PLATFORM_ANDROID) rm -rf $(ANDROID_TOOLCHAIN) -- cgit v1.2.3 From 4c4b5643925f442ff7d5bcbd8e6670b993d00b10 Mon Sep 17 00:00:00 2001 From: RDR8 Date: Sun, 11 Feb 2018 23:42:22 +0000 Subject: Update Makefiles for Linux installation. See prior commit. These changes are intended to provide context and control over the Linux make install process. make install RAYLIB_LIBTYPE=SHARED now works as expected. libraylib.so is properly installed with attendant runtime links. The examples will be running against the newly installed libraylib.so unless otherwise specified with RAYLIB_RUNTIME_PATH. See raylib/src/Makefile and raylib/examples/Makefile for usage of RAYLIB_INSTALL_PATH, RAYLIB_H_INSTALL_PATH, and RAYLIB_RUNTIME_PATH variables. RAYLIB_RUNTIME_PATH in particular is interesting for portability since sudo isn't needed. The default configuration and workflow is essentially unchanged and unaffected. --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index b44ff462..79bdf97f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -518,7 +518,7 @@ utils.o : utils.c utils.h # (without a package manager). We'll use /usr/local/lib/raysan5 and /usr/local/include/raysan5 # for our -L and -I specification to simplify management of the raylib source package. # Customize these locations if you like but don't forget to pass them to make -# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig,. +# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig. # Hint: add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles. # See below and ../examples/Makefile for more information. @@ -568,6 +568,8 @@ ifeq ($(ROOT),root) ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_LIBTYPE),SHARED) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so* + rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION) + rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) # Uncomment to clean up the runtime linker cache. See install target. ldconfig else -- cgit v1.2.3 From 5616314069829877301312add7c3b55ba4042eac Mon Sep 17 00:00:00 2001 From: RDR8 Date: Mon, 12 Feb 2018 00:15:58 +0000 Subject: Update Makefile --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 79bdf97f..61206a3d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -567,7 +567,7 @@ ifeq ($(ROOT),root) # Proceeding will remove everything under the specified locations! ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_LIBTYPE),SHARED) - rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so* + rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) # Uncomment to clean up the runtime linker cache. See install target. -- cgit v1.2.3 From f742f1289d9e00c8d09a5a6dc4c36efaa0e10d67 Mon Sep 17 00:00:00 2001 From: RDR8 Date: Mon, 12 Feb 2018 05:17:02 +0000 Subject: Update Makefile --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 61206a3d..f8f9635b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -529,7 +529,7 @@ RAYLIB_H_INSTALL_PATH ?= /usr/local/include/raysan5 install : ifeq ($(ROOT),root) - # Attention! You are root. Consult this Makefile for more information." + # Attention! You are root. Consult this Makefile for more information. ifeq ($(PLATFORM_OS),LINUX) # Prepare the environment as needed. mkdir --parents --verbose $(RAYLIB_INSTALL_PATH) -- cgit v1.2.3 From 97bf2706c497f90ea4e3ead4e69819bc7a1f6083 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 21 Feb 2018 23:28:34 +0100 Subject: Removed flag -fgnu89-inline --- src/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index f8f9635b..f7494912 100644 --- a/src/Makefile +++ b/src/Makefile @@ -270,11 +270,10 @@ endif # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) # -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -fgnu89-inline declaring inline functions support (GCC optimized) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -Werror=pointer-arith +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g -- cgit v1.2.3 From 2b5fc120360baae6903c4d4c8b411b726927cbce Mon Sep 17 00:00:00 2001 From: RDR8 Date: Wed, 21 Feb 2018 19:34:08 -0600 Subject: Update Makefiles. Enable example usage of staged libraylib.so. --- src/Makefile | 108 +++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 40 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index f7494912..e001b4ef 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,16 +44,12 @@ # Define required raylib variables RAYLIB_VERSION = 1.9.4 RAYLIB_API_VERSION = 1 + +# See below for alternatives. RAYLIB_PATH = .. # Define default options -# RAYLIB_RELEASE_PATH points to provided binaries and your immediate build of raylib. -# It is further modified below by PLATFORM below. -RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs - -# See install target for *_INSTALL_PATH locations. - # One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP @@ -76,6 +72,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Use external GLFW library instead of rglfw module +# TODO: Review usage of examples on Linux. USE_EXTERNAL_GLFW ?= FALSE # Use Wayland display server protocol on Linux desktop @@ -84,10 +81,13 @@ USE_WAYLAND_DISPLAY ?= FALSE # See below for more GRAPHICS options. +# See below for RAYLIB_RELEASE_PATH. + +# See install target for *_INSTALL_PATH locations. + # Use cross-compiler for PLATFORM_RPI ifeq ($(PLATFORM),PLATFORM_RPI) USE_RPI_CROSS_COMPILER ?= FALSE - ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot @@ -125,6 +125,23 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif endif +# RAYLIB_PATH adjustment for different platforms. +# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? +# Required for ldconfig or other tools that do not perform path expansion. +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),LINUX) + RAYLIB_PREFIX ?= .. + RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) + endif +endif +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. +# WARNING: The following is copied from examples/Makefile and is here only for reference. +# Consequences of enabling this are UNKNOWN. Please test and report. +#ifeq ($(PLATFORM),PLATFORM_RPI) +# RAYLIB_PATH ?= /home/pi/raylib +#endif + # Force OpenAL Soft audio backend for OSX platform # NOTE 1: mini_al library does not support CoreAudio yet # NOTE 2: Required OpenAL libraries should be available on OSX @@ -152,6 +169,10 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ANDROID_ARCH ?= ARM endif +# RAYLIB_RELEASE_PATH points to provided binaries or your immediate build of raylib. +# It is further modified below by PLATFORM below. +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs + # Define output directory for compiled library ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) @@ -189,17 +210,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) #GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1 #GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1 endif - ifeq ($(PLATFORM),PLATFORM_RPI) # On RPI OpenGL ES 2.0 must be used GRAPHICS = GRAPHICS_API_OPENGL_ES2 endif - ifeq ($(PLATFORM),PLATFORM_WEB) # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0 GRAPHICS = GRAPHICS_API_OPENGL_ES2 endif - ifeq ($(PLATFORM),PLATFORM_ANDROID) # By default use OpenGL ES 2.0 on Android GRAPHICS = GRAPHICS_API_OPENGL_ES2 @@ -277,6 +295,7 @@ CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=point ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g + #CC = clang endif # Additional flags for compiler (if desired) @@ -339,13 +358,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) endif ifeq ($(USE_EXTERNAL_GLFW),TRUE) + # Check the version name. If GLFW3 was built manually, it may have produced + # a static library known as libglfw3.a. In that case, the name should be -lglfw3 LDFLAGS += -lglfw endif endif # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - # RPI requried libraries + # RPI required libraries INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads @@ -428,10 +449,10 @@ else @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" endif ifeq ($(PLATFORM_OS),LINUX) - # Compile raylib to shared library version for GNU/Linux. - # WARNING: you should type "make clean" before doing this target + # Compile raylib shared library version $(RAYLIB_VERSION). + # WARNING: you should type "make clean" before doing this target $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(OBJS) -shared -Wl,-soname,libraylib.so.$(RAYLIB_API_VERSION) -lGL -lc -lm -lpthread -ldl -lrt - @echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION))!" + @echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!" cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so endif @@ -443,7 +464,7 @@ else cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib endif ifeq ($(PLATFORM_OS),FREEBSD) - # WARNING: you should type "gmake clean" before doing this target + # WARNING: you should type "gmake clean" before doing this target $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so @@ -456,10 +477,10 @@ else cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif else - # Compile raylib static library - @echo raylib library release path is $(RAYLIB_RELEASE_PATH) + # Compile raylib static library version $(RAYLIB_VERSION) + # WARNING: You should type "make clean" before doing this target. $(AR) rcs $(RAYLIB_RELEASE_PATH)/libraylib.a $(OBJS) - @echo "raylib static library generated (libraylib.a)!" + @echo "raylib static library generated (libraylib.a) in $(RAYLIB_RELEASE_PATH)!" endif endif @@ -509,8 +530,7 @@ stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h utils.o : utils.c utils.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -# Install generated and needed files to required directories -# TODO: Add other platforms. Remove sudo requirement, i.e. add USER mode. +# Install generated and needed files to desired directories. # On GNU/Linux and BSDs, there are some standard directories that contain extra # libraries and header files. These directories (often /usr/local/lib and # /usr/local/include) are for libraries that are installed manually @@ -520,37 +540,41 @@ utils.o : utils.c utils.h # for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig. # Hint: add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles. # See below and ../examples/Makefile for more information. +# TODO: Add other platforms. Remove sudo requirement, i.e. add USER mode. # RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. -RAYLIB_INSTALL_PATH ?= /usr/local/lib/raysan5 +DESTDIR ?= /usr/local +RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib # RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. -RAYLIB_H_INSTALL_PATH ?= /usr/local/include/raysan5 +RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include install : ifeq ($(ROOT),root) - # Attention! You are root. Consult this Makefile for more information. ifeq ($(PLATFORM_OS),LINUX) + # Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH) + # and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information. # Prepare the environment as needed. mkdir --parents --verbose $(RAYLIB_INSTALL_PATH) mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH) ifeq ($(RAYLIB_LIBTYPE),SHARED) - # Installing the shared library. + # Installing raylib to $(RAYLIB_INSTALL_PATH). cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so - # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH. - # Not necessary if later embedding RPATH in your executable. See examples/Makefile. + # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH. + # Not necessary if later embedding RPATH in your executable. See examples/Makefile. ldconfig $(RAYLIB_INSTALL_PATH) else - # Installing the static library. + # Installing raylib to $(RAYLIB_INSTALL_PATH). cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_INSTALL_PATH)/libraylib.a endif - # Let's have all the source. - cp --update --recursive $(RAYLIB_PATH)/src/*.h $(RAYLIB_H_INSTALL_PATH)/ - cp --update --recursive $(RAYLIB_PATH)/src/*.c $(RAYLIB_H_INSTALL_PATH)/ - cp --update --recursive $(RAYLIB_PATH)/src/external $(RAYLIB_H_INSTALL_PATH)/ - cp --update --recursive $(RAYLIB_PATH)/release/include/AL $(RAYLIB_H_INSTALL_PATH)/external - @echo "raylib dev files installed/updated!" + # Copying raylib development files to $(RAYLIB_H_INSTALL_PATH). + cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h + cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h + cp --update rlgl.h $(RAYLIB_H_INSTALL_PATH)/rlgl.h + cp --update rlgl.c $(RAYLIB_H_INSTALL_PATH)/rlgl.c + cp --update physac.h $(RAYLIB_H_INSTALL_PATH)/physac.h + @echo "raylib development files installed/updated!" else @echo "This function currently works on GNU/Linux systems. Add yours today (^;" endif @@ -562,22 +586,26 @@ endif # TODO: see 'install' target. uninstall : ifeq ($(ROOT),root) - # Warning! You are root. Please confirm that there is nothing here to keep. - # Proceeding will remove everything under the specified locations! + # WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH). + # and $(RAYLIB_H_INSTALL_PATH). Please confirm each item. ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_LIBTYPE),SHARED) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) - # Uncomment to clean up the runtime linker cache. See install target. + # Uncomment to clean up the runtime linker cache. See install target. ldconfig else rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a endif - rm --force --interactive=once --recursive $(RAYLIB_H_INSTALL_PATH)/* - @echo "raylib development files removed!" - else - @echo "This function works only on GNU/Linux systems" + rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raylib.h + rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raymath.h + rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/rlgl.h + rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/rlgl.c + rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/physac.h + @echo "raylib development files removed!" + else + @echo "This function currently works on GNU/Linux systems. Add yours today (^;" endif else @echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall" -- cgit v1.2.3 From 1430d0190684c6f78e1bce759eae240c94fba61c Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 24 Feb 2018 23:46:27 +0100 Subject: jar_xm: Workaround for unaligned pointer accesses jar_xm.h does some shady pointer casts leading to unaligned accesses and breaking strict aliasing. x86 has special circuitry for doing unaligned accesses, but on other architectures, it may trap and require kernel fix-up or crash outright. With this patch, one obstacle in porting raylib to the GameBoy Advance has been removed. Go for it ;-) To avoid having to rewrite that `mempool' code, insert padding before structs and instruct the compiler (GCC, most importantly), to be gentle when optimizing. This fixes #490 (Unless we got ourselves 256-bit pointers, if so, hello future!) --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index e001b4ef..53551174 100644 --- a/src/Makefile +++ b/src/Makefile @@ -291,7 +291,9 @@ endif # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith +# -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing) +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith +-fno-strict-aliasing ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g -- cgit v1.2.3 From 18f61948ce5154b01f2b3f1532fec0451184f485 Mon Sep 17 00:00:00 2001 From: RDR8 Date: Sun, 25 Feb 2018 15:21:54 -0600 Subject: Update Makefile $ make clean Makefile:296: *** missing separator. Stop. --- src/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 53551174..7837b614 100644 --- a/src/Makefile +++ b/src/Makefile @@ -292,8 +292,7 @@ endif # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec # -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers # -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing) -CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith --fno-strict-aliasing +CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing ifeq ($(RAYLIB_BUILD_MODE), DEBUG) CFLAGS += -g -- cgit v1.2.3 From deffad1701d3aa7066cd6dbfb89c50792ad14627 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 19 Mar 2018 23:49:14 +0100 Subject: Review tabs issue when compiling... ...PLATFORM_ANDROID on Windows, using MinGW-w64 (x86) provided Make (GCC 7.2) --- src/Makefile | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 7837b614..e6c3b7d8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -450,8 +450,8 @@ else @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" endif ifeq ($(PLATFORM_OS),LINUX) - # Compile raylib shared library version $(RAYLIB_VERSION). - # WARNING: you should type "make clean" before doing this target + # Compile raylib shared library version $(RAYLIB_VERSION). + # WARNING: you should type "make clean" before doing this target $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(OBJS) -shared -Wl,-soname,libraylib.so.$(RAYLIB_API_VERSION) -lGL -lc -lm -lpthread -ldl -lrt @echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!" cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) @@ -465,7 +465,7 @@ else cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib endif ifeq ($(PLATFORM_OS),FREEBSD) - # WARNING: you should type "gmake clean" before doing this target + # WARNING: you should type "gmake clean" before doing this target $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so @@ -478,8 +478,8 @@ else cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif else - # Compile raylib static library version $(RAYLIB_VERSION) - # WARNING: You should type "make clean" before doing this target. + # Compile raylib static library version $(RAYLIB_VERSION) + # WARNING: You should type "make clean" before doing this target. $(AR) rcs $(RAYLIB_RELEASE_PATH)/libraylib.a $(OBJS) @echo "raylib static library generated (libraylib.a) in $(RAYLIB_RELEASE_PATH)!" endif @@ -552,24 +552,24 @@ RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include install : ifeq ($(ROOT),root) ifeq ($(PLATFORM_OS),LINUX) - # Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH) - # and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information. - # Prepare the environment as needed. + # Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH) + # and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information. + # Prepare the environment as needed. mkdir --parents --verbose $(RAYLIB_INSTALL_PATH) mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH) - ifeq ($(RAYLIB_LIBTYPE),SHARED) - # Installing raylib to $(RAYLIB_INSTALL_PATH). + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Installing raylib to $(RAYLIB_INSTALL_PATH). cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION) cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so - # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH. - # Not necessary if later embedding RPATH in your executable. See examples/Makefile. + # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH. + # Not necessary if later embedding RPATH in your executable. See examples/Makefile. ldconfig $(RAYLIB_INSTALL_PATH) - else - # Installing raylib to $(RAYLIB_INSTALL_PATH). + else + # Installing raylib to $(RAYLIB_INSTALL_PATH). cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_INSTALL_PATH)/libraylib.a - endif - # Copying raylib development files to $(RAYLIB_H_INSTALL_PATH). + endif + # Copying raylib development files to $(RAYLIB_H_INSTALL_PATH). cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h cp --update rlgl.h $(RAYLIB_H_INSTALL_PATH)/rlgl.h @@ -587,14 +587,14 @@ endif # TODO: see 'install' target. uninstall : ifeq ($(ROOT),root) - # WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH). - # and $(RAYLIB_H_INSTALL_PATH). Please confirm each item. + # WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH). + # and $(RAYLIB_H_INSTALL_PATH). Please confirm each item. ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_LIBTYPE),SHARED) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION) rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION) - # Uncomment to clean up the runtime linker cache. See install target. + # Uncomment to clean up the runtime linker cache. See install target. ldconfig else rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a -- cgit v1.2.3 From cc3b8645df23ed9aeb9d6efc806ab91170a29a89 Mon Sep 17 00:00:00 2001 From: Ray San Date: Tue, 10 Apr 2018 10:37:48 +0200 Subject: Updated release version --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index e6c3b7d8..8444ed57 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,7 @@ .PHONY: all clean install uninstall # Define required raylib variables -RAYLIB_VERSION = 1.9.4 +RAYLIB_VERSION = 1.9.7 RAYLIB_API_VERSION = 1 # See below for alternatives. -- cgit v1.2.3