kbuild-0.1.5.ebuild: 0.1.4 -> 0.1.5.
[kbuild-mirror.git] / kBuild / sdks / LIBSDL.kmk
blobfaad204355fb8a9670cc9d30044fb4af6f9c5a15
1 # $Id$
2 ## @file
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*)
42 endif
43 ifneq ($(PATH_SDK_LIBSDL),)
44 PATH_SDK_LIBSDL := $(lastword $(sort $(PATH_SDK_LIBSDL)))
45 else
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 \
52 ) )
53 ifneq ($(PATH_SDK_LIBSDL),)
54 PATH_SDK_LIBSDL := $(patsubst %/,%,$(dir $(PATH_SDK_LIBSDL)))
55 _SDK_LIBSDK_IS_FRAMEWORK := yes
56 endif
57 endif
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 \
63 /lib64/libSDL.* \
64 /lib/libSDL.* \
65 /usr/lib64/libSDL.* \
66 /usr/lib/libSDL.* \
67 /usr/local/lib64/libSDL.* \
68 /usr/local/lib/libSDL.* \
69 /opt/lib64/libSDL.* \
70 /opt/lib/libSDL.* \
71 /opt/local/lib64/libSDL.* \
72 /opt/local/lib/libSDL.* \
73 /sw/lib64/libSDL.* \
74 /sw/lib/libSDL.* \
75 ) )
76 else
77 PATH_SDK_LIBSDL := $(firstword $(wildcard \
78 /lib32/libSDL.* \
79 /lib/libSDL.* \
80 /usr/lib32/libSDL.* \
81 /usr/lib/libSDL.* \
82 /usr/local/lib32/libSDL.* \
83 /usr/local/lib/libSDL.* \
84 /opt/lib32/libSDL.* \
85 /opt/lib/libSDL.* \
86 /opt/local/lib32/libSDL.* \
87 /opt/local/lib/libSDL.* \
88 /sw/lib32/libSDL.* \
89 /sw/lib/libSDL.* \
90 ) )
91 endif
92 ifneq ($(PATH_SDK_LIBSDL),)
93 PATH_SDK_LIBSDL := $(patsubst %/,%,$(dir $(patsubst %/,%,$(dir $(PATH_SDK_LIBSDL)))))
94 else
95 $(warning kBuild: PATH_SDK_LIBSDL couldn't be determined!)
96 PATH_SDK_LIBSDL := $(PATH_DEVTOOLS_TRG)/libsdl/not/found
97 endif
98 endif
99 endif
100 else
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)
105 endif
106 endif
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
124 SDK_LIBSDL_INCS ?= \
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
131 SDK_LIBSDL_LIBS ?= \
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
153 SDK_LIBSDL_INCS ?= \
154 $(PATH_SDK_LIBSDL)/include/SDL \
155 $(PATH_SDK_LIBSDL)/include
156 SDK_LIBSDL_LIBS ?= \
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)
162 # darwin + framework
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
188 else
189 SDK_LIBSDL_INCS := $(PATH_SDK_LIBSDL)/include
190 endif
191 endif
192 SDK_LIBSDL_LIBS ?= \
193 $(LIB_SDK_LIBSDL_SDL)
194 SDK_LIBSDL_LIBPATH ?= \
195 $(PATH_SDK_LIBSDL)/lib
196 endif