3 # kBuild SDK - Simple DirectMedia Layer, targeting $(KBUILD_TARGET).
7 # Copyright (c) 2006-2008 knut st. osmundsen <bird-kBuild-spam@anduin.net>
9 # This file is part of kBuild.
11 # kBuild is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # kBuild is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with kBuild; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 # As a special exception you are granted permission to include this file, via
27 # the kmk include directive, as you wish without this in itself causing the
28 # resulting makefile, program or whatever to be covered by the GPL license.
29 # This exception does not however invalidate any other reasons why the makefile,
30 # program, whatever should not be covered the GPL.
34 SDK_LIBSDL
:= Simple DirectMedia Layer
, targeting
$(KBUILD_TARGET
).
36 # SDK Specific Properties
37 _SDK_LIBSDK_IS_FRAMEWORK
:= no
38 ifndef PATH_SDK_LIBSDL
39 PATH_SDK_LIBSDL
:= $(wildcard $(PATH_DEVTOOLS_TRG
)/libsdl
/v
*)
40 ifeq ($(PATH_SDK_LIBSDL
),)
41 PATH_SDK_LIBSDL
:= $(wildcard $(PATH_DEVTOOLS_BLD
)/libsdl
/v
*)
43 ifneq ($(PATH_SDK_LIBSDL
),)
44 PATH_SDK_LIBSDL
:= $(lastword
$(sort $(PATH_SDK_LIBSDL
)))
47 # Darwin might have a framework for it.
48 ifeq ($(KBUILD_TARGET
),darwin
)
49 PATH_SDK_LIBSDL
:= $(firstword $(wildcard \
50 /System
/Library
/Frameworks
/SDL.framework
/SDL \
51 /Library
/Frameworks
/SDL.framework
/SDL \
53 ifneq ($(PATH_SDK_LIBSDL
),)
54 PATH_SDK_LIBSDL
:= $(patsubst %/,%,$(dir $(PATH_SDK_LIBSDL
)))
55 _SDK_LIBSDK_IS_FRAMEWORK
:= yes
59 ifeq ($(PATH_SDK_LIBSDL
),)
60 # Search in the typical unix places.
61 ifeq ($(filter-out %64,$(KBUILD_TARGET_ARCH
)),)
62 PATH_SDK_LIBSDL
:= $(firstword $(wildcard \
67 /usr
/local
/lib64
/libSDL.
* \
68 /usr
/local
/lib
/libSDL.
* \
71 /opt
/local
/lib64
/libSDL.
* \
72 /opt
/local
/lib
/libSDL.
* \
77 PATH_SDK_LIBSDL
:= $(firstword $(wildcard \
82 /usr
/local
/lib32
/libSDL.
* \
83 /usr
/local
/lib
/libSDL.
* \
86 /opt
/local
/lib32
/libSDL.
* \
87 /opt
/local
/lib
/libSDL.
* \
92 ifneq ($(PATH_SDK_LIBSDL
),)
93 PATH_SDK_LIBSDL
:= $(patsubst %/,%,$(dir $(patsubst %/,%,$(dir $(PATH_SDK_LIBSDL
)))))
95 $(warning kBuild
: PATH_SDK_LIBSDL couldn
't be determined!)
96 PATH_SDK_LIBSDL := $(PATH_DEVTOOLS_TRG)/libsdl/not/found
101 PATH_SDK_LIBSDL := $(PATH_SDK_LIBSDL)
102 ifeq ($(KBUILD_TARGET),darwin)
103 # Check if it's the framework or not.
104 _SDK_LIBSDK_IS_FRAMEWORK
:= $(if
$(wildcard $(PATH_SDK_LIBSDL
)/Headers
/SDL.h
),yes
)
109 # The way libsdl is distributed on the different platforms
110 # varies quite a bit, thus this kludge.
112 ifeq ($(KBUILD_TARGET
),os2
)
113 LIB_SDK_LIBSDL_SDLMAIN ?
=
114 DLL_SDK_LIBSDL_SDL ?
= $(PATH_SDK_LIBSDL
)/SDL
/SDL12.dll
115 DLL_SDK_LIBSDL_FSLIB ?
= $(PATH_SDK_LIBSDL
)/SDL
/FSLib.dll
116 LIB_SDK_LIBSDL_SDL ?
= $(PATH_SDK_LIBSDL
)/SDL
/SDL12.lib
117 LIB_SDK_LIBSDL_SDLGFX ?
= $(PATH_SDK_LIBSDL
)/SDLGfx
/SDLGFX.lib
118 LIB_SDK_LIBSDL_SDLIMAGE ?
= $(PATH_SDK_LIBSDL
)/SDLImage
/SDLIMAGE.lib
119 LIB_SDK_LIBSDL_SDLMIXER ?
= $(PATH_SDK_LIBSDL
)/SDLMixer
/SDLMIXER.lib
120 LIB_SDK_LIBSDL_SDLNET ?
= $(PATH_SDK_LIBSDL
)/SDLNet
/SDLNET.lib
121 LIB_SDK_LIBSDL_SDLTTF ?
= $(PATH_SDK_LIBSDL
)/SDLTTF
/SDLTTF.lib
123 # General Properties used by kBuild
125 $(PATH_SDK_LIBSDL
)/SDL
/include \
126 $(PATH_SDK_LIBSDL
)/SDLGfx \
127 $(PATH_SDK_LIBSDL
)/SDLImage \
128 $(PATH_SDK_LIBSDL
)/SDLMixer \
129 $(PATH_SDK_LIBSDL
)/SDLNet \
130 $(PATH_SDK_LIBSDL
)/SDLTTF
132 $(LIB_SDK_LIBSDL_SDL
)
133 SDK_LIBSDL_LIBPATH ?
= \
134 $(PATH_SDK_LIBSDL
)/SDL \
135 $(PATH_SDK_LIBSDL
)/SDLGfx \
136 $(PATH_SDK_LIBSDL
)/SDLImage \
137 $(PATH_SDK_LIBSDL
)/SDLMixer \
138 $(PATH_SDK_LIBSDL
)/SDLNet \
139 $(PATH_SDK_LIBSDL
)/SDLTTF
141 else ifeq ($(KBUILD_TARGET
),win
) # ASSUMES VC++ on windows, sorry.
142 LIB_SDK_LIBSDL_SDLMAIN ?
= $(PATH_SDK_LIBSDL
)/lib
/SDLmain.lib
143 LIB_SDK_LIBSDL_SDL ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL.lib
144 DLL_SDK_LIBSDL_SDL ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL.dll
145 LIB_SDK_LIBSDL_SDLGFX ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_gfx.lib
146 LIB_SDK_LIBSDL_SDLIMAGE ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_image.lib
147 LIB_SDK_LIBSDL_SDLMIXER ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_mixer.lib
148 LIB_SDK_LIBSDL_SDLNET ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_net.lib
149 LIB_SDK_LIBSDL_SDLTTF ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_ttf.lib
150 DLL_SDK_LIBSDL_SDLTTF ?
= $(PATH_SDK_LIBSDL
)/lib
/SDL_ttf.dll
152 # General Properties used by kBuild
154 $(PATH_SDK_LIBSDL
)/include/SDL \
155 $(PATH_SDK_LIBSDL
)/include
157 $(LIB_SDK_LIBSDL_SDL
)
158 SDK_LIBSDL_LIBPATH ?
= \
159 $(PATH_SDK_LIBSDL
)/lib
161 else ifeq ($(KBUILD_TARGET
).
$(_SDK_LIBSDK_IS_FRAMEWORK
),darwin.yes
)
163 LIB_SDK_LIBSDL_SDLMAIN ?
= $(NO_SUCH_VARIABLE
)
164 LIB_SDK_LIBSDL_SDL ?
= $(NO_SUCH_VARIABLE
)
165 LIB_SDK_LIBSDL_SDLGFX ?
= $(NO_SUCH_VARIABLE
)
166 LIB_SDK_LIBSDL_SDLIMAGE ?
= $(NO_SUCH_VARIABLE
)
167 LIB_SDK_LIBSDL_SDLMIXER ?
= $(NO_SUCH_VARIABLE
)
168 LIB_SDK_LIBSDL_SDLNET ?
= $(NO_SUCH_VARIABLE
)
169 LIB_SDK_LIBSDL_SDLTTF ?
= $(NO_SUCH_VARIABLE
)
171 # General Properties used by kBuild
172 SDK_LIBSDL_INCS ?
= $(PATH_SDK_LIBSDL
)/Headers
173 SDK_LIBSDL_LDFLAGS ?
= -framework SDL
175 else # ASSUMES Unix like system
176 LIB_SDK_LIBSDL_SDLMAIN ?
= SDLmain
177 LIB_SDK_LIBSDL_SDL ?
= SDL
178 LIB_SDK_LIBSDL_SDLGFX ?
= SDL_gfx
179 LIB_SDK_LIBSDL_SDLIMAGE ?
= SDL_image
180 LIB_SDK_LIBSDL_SDLMIXER ?
= SDL_mixer
181 LIB_SDK_LIBSDL_SDLNET ?
= SDL_net
182 LIB_SDK_LIBSDL_SDLTTF ?
= SDL_ttf
184 # General Properties used by kBuild
185 ifndef SDK_LIBSDL_INCS
186 ifneq ($(wildcard $(PATH_SDK_LIBSDL
)/include/SDL
/),)
187 SDK_LIBSDL_INCS
:= $(PATH_SDK_LIBSDL
)/include/SDL
189 SDK_LIBSDL_INCS
:= $(PATH_SDK_LIBSDL
)/include
193 $(LIB_SDK_LIBSDL_SDL
)
194 SDK_LIBSDL_LIBPATH ?
= \
195 $(PATH_SDK_LIBSDL
)/lib