浏览代码

Reorganized external folders by platform

Improved makefiles!
pull/15/head
raysan5 10 年前
父节点
当前提交
d739895e4a
共有 12 个文件被更改,包括 50 次插入20 次删除
  1. +34
    -11
      examples/makefile
  2. +0
    -0
      external/glew/lib/win32/libglew32.a
  3. +0
    -0
      external/glew/lib/win32/libglew32dll.a
  4. +0
    -1
      external/glfw3/lib/libglfw.3.dylib
  5. +0
    -1
      external/glfw3/lib/libglfw.dylib
  6. +0
    -0
      external/glfw3/lib/osx/libglfw.3.0.dylib
  7. +1
    -0
      external/glfw3/lib/osx/libglfw.3.dylib
  8. +1
    -0
      external/glfw3/lib/osx/libglfw.dylib
  9. +0
    -0
      external/glfw3/lib/win32/libglfw3.a
  10. +0
    -0
      external/glfw3/lib/win32/libglfw3dll.a
  11. +0
    -0
      external/openal_soft/lib/win32/libopenal32.a
  12. +14
    -7
      src/makefile

+ 34
- 11
examples/makefile 查看文件

@ -26,18 +26,21 @@
# WARNING: To compile examples to HTML5, they must be redesigned to use emscripten.h and emscripten_set_main_loop() # WARNING: To compile examples to HTML5, they must be redesigned to use emscripten.h and emscripten_set_main_loop()
PLATFORM ?= PLATFORM_DESKTOP PLATFORM ?= PLATFORM_DESKTOP
# determine SUBPLATFORM in case PLATFORM_DESKTOP selected # determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
SUBPLATFORM=WINDOWS PLATFORM_OS=WINDOWS
LIBPATH=win32
else else
UNAMEOS:=$(shell uname) UNAMEOS:=$(shell uname)
ifeq ($(UNAMEOS),Linux) ifeq ($(UNAMEOS),Linux)
SUBPLATFORM=LINUX PLATFORM_OS=LINUX
LIBPATH=linux
else else
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
SUBPLATFORM=OSX PLATFORM_OS=OSX
LIBPATH=osx
endif endif
endif endif
endif endif
@ -47,10 +50,15 @@ endif
ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM),PLATFORM_WEB)
# define emscripten compiler # define emscripten compiler
CC = emcc CC = emcc
else
ifeq ($(PLATFORM_OS),OSX)
# define llvm compiler for mac
CC = clang
else else
# define default gcc compiler # define default gcc compiler
CC = gcc CC = gcc
endif endif
endif
# define compiler flags: # define compiler flags:
# -O2 defines optimization level # -O2 defines optimization level
@ -74,25 +82,39 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDES = -I. -I../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads INCLUDES = -I. -I../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
else else
INCLUDES = -I. -I../src INCLUDES = -I. -I../src
# external libraries headers
# GLFW3
INCLUDES += -I../external/glfw3/include
# GLEW
INCLUDES += -I../external/glew/include
# OpenAL Soft
INCLUDES += -I../external/openal_soft/include
endif endif
# define library paths containing required libs # define library paths containing required libs
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
LFLAGS = -L. -L../src -L/opt/vc/lib LFLAGS = -L. -L../src -L/opt/vc/lib
else else
LFLAGS = -L. -L../src -L../external/glfw3/lib/ -I../external/openal_soft/lib/ LFLAGS = -L. -L../src
# external libraries to link with
# GLFW3
LFLAGS += -L../external/glfw3/lib/$(LIBPATH)
# GLEW
LFLAGS += -L../external/openal_soft/lib/$(LIBPATH)
# OpenAL Soft
LFLAGS += -L../external/glew/lib/$(LIBPATH)
endif endif
# define any libraries to link into executable # define any libraries to link into executable
# if you want to link libraries (libname.so or libname.a), use the -lname # if you want to link libraries (libname.so or libname.a), use the -lname
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(SUBPLATFORM),LINUX) ifeq ($(PLATFORM_OS),LINUX)
# libraries for Debian GNU/Linux desktop compiling # libraries for Debian GNU/Linux desktop compiling
# requires the following packages: # requires the following packages:
# libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev
LIBS = -lraylib -lglfw -lGLEW -lGL -lopenal LIBS = -lraylib -lglfw -lGLEW -lGL -lopenal
endif endif
ifeq ($(SUBPLATFORM),OSX) ifeq ($(PLATFORM_OS),OSX)
# libraries for OS X 10.9 desktop compiling # libraries for OS X 10.9 desktop compiling
# requires the following packages: # requires the following packages:
# libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev
@ -101,7 +123,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
else else
# libraries for Windows desktop compiling # libraries for Windows desktop compiling
# NOTE: GLFW3 and OpenAL Soft libraries should be installed # NOTE: GLFW3 and OpenAL Soft libraries should be installed
LIBS = -lraylib -lglfw3 -lglew32 -lopengl32 -lopenal32 -lgdi32 LIBS = -lraylib -lglfw3 -lglew32 -lopengl32 -lopenal32 -lgdi32
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -114,7 +136,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
endif endif
# define additional parameters and flags for windows # define additional parameters and flags for windows
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
WINFLAGS = ../src/resources -Wl,--subsystem,windows WINFLAGS = ../src/resources -Wl,--subsystem,windows
@ -290,10 +312,11 @@ audio_music_stream: audio_music_stream.c
# clean everything # clean everything
clean: clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(SUBPLATFORM),OSX) ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -delete
rm -f *.o rm -f *.o
else else
ifeq ($(SUBPLATFORM),LINUX) ifeq ($(PLATFORM_OS),LINUX)
find . -type f -executable -delete find . -type f -executable -delete
rm -f *.o rm -f *.o
else else

external/glew/lib/libglew32.a → external/glew/lib/win32/libglew32.a 查看文件


external/glew/lib/libglew32dll.a → external/glew/lib/win32/libglew32dll.a 查看文件


+ 0
- 1
external/glfw3/lib/libglfw.3.dylib 查看文件

@ -1 +0,0 @@
libglfw.3.0.dylib

+ 0
- 1
external/glfw3/lib/libglfw.dylib 查看文件

@ -1 +0,0 @@
libglfw.3.dylib

external/glfw3/lib/libglfw.3.0.dylib → external/glfw3/lib/osx/libglfw.3.0.dylib 查看文件


+ 1
- 0
external/glfw3/lib/osx/libglfw.3.dylib 查看文件

@ -0,0 +1 @@
libglfw.3.0.dylib

+ 1
- 0
external/glfw3/lib/osx/libglfw.dylib 查看文件

@ -0,0 +1 @@
libglfw.3.dylib

external/glfw3/lib/libglfw3.a → external/glfw3/lib/win32/libglfw3.a 查看文件


external/glfw3/lib/libglfw3dll.a → external/glfw3/lib/win32/libglfw3dll.a 查看文件


external/openal_soft/lib/libopenal32.a → external/openal_soft/lib/win32/libopenal32.a 查看文件


+ 14
- 7
src/makefile 查看文件

@ -25,18 +25,18 @@
# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP PLATFORM ?= PLATFORM_DESKTOP
# determine SUBPLATFORM in case PLATFORM_DESKTOP selected # determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
SUBPLATFORM=WINDOWS PLATFORM_OS=WINDOWS
else else
UNAMEOS:=$(shell uname) UNAMEOS:=$(shell uname)
ifeq ($(UNAMEOS),Linux) ifeq ($(UNAMEOS),Linux)
SUBPLATFORM=LINUX PLATFORM_OS=LINUX
else else
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
SUBPLATFORM=OSX PLATFORM_OS=OSX
endif endif
endif endif
endif endif
@ -82,7 +82,14 @@ endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
else else
INCLUDES = -I. -I../external/glfw3/include/ -I../external/openal_soft/include/ INCLUDES = -I. -I../src
# external libraries headers
# GLFW3
INCLUDES += -I../external/glfw3/include
# GLEW
INCLUDES += -I../external/glew/include
# OpenAL Soft
INCLUDES += -I../external/openal_soft/include
endif endif
# define all object files required # define all object files required
@ -144,10 +151,10 @@ stb_vorbis.o: stb_vorbis.c
# clean everything # clean everything
clean: clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(SUBPLATFORM),OSX) ifeq ($(PLATFORM_OS),OSX)
rm -f *.o libraylib.a rm -f *.o libraylib.a
else else
ifeq ($(SUBPLATFORM),LINUX) ifeq ($(PLATFORM_OS),LINUX)
find . -type f -executable -delete find . -type f -executable -delete
rm -f *.o libraylib.a rm -f *.o libraylib.a
else else

||||||
x
 
000:0
正在加载...
取消
保存