sdl includes depend on iconv includes
[aros:aros.git] / contrib / SDL / SDL_main / mmakefile.src
1 # Copyright © 2009-2013, The AROS Development Team. All rights reserved.
2 # $Id$
3
4 include $(TOP)/config/make.cfg
5
6 #MM- contrib-sdl : SDL-aros
7 #MM- SDL-aros-lib : contrib-sdl-sdl-main-fetch SDL-aros-sharedlib
8 ##MM- SDL-aros-lib : contrib-sdl-sdl-main-fetch SDL-aros-staticlib
9 #MM- SDL-aros : SDL-aros-lib SDL-aros-tests
10 ##MM- SDL-aros-tests : SDL-aros-standardtests SDL-aros-gltests
11
12 #MM SDL-aros-sharedlib : SDL-aros-includes workbench-devs-AHI workbench-libs-mesa \
13 #MM  development-libiconv SDL-aros-config
14
15 REPOSITORIES := http://www.libsdl.org/release/
16 ARCHVER      := 1.2.15
17 ARCHBASE     := SDL-$(ARCHVER)
18
19 %fetch mmake=contrib-sdl-sdl-main-fetch archive=$(ARCHBASE) suffixes="tar.gz" \
20     location=$(PORTSSOURCEDIR) destination=$(PORTSDIR)/SDL \
21     archive_origins=". $(REPOSITORIES)" \
22     patches_specs=$(ARCHBASE)-aros.diff:$(ARCHBASE):-p1
23
24 ARCHSRCDIR := $(PORTSDIR)/SDL/$(ARCHBASE)
25
26 %create_patch mmake=sdl_main-patch archive=$(ARCHBASE) suffixes="tar.gz" destination=$(PORTSDIR)/SDL
27
28 TESTEXEDIR := $(AROS_TESTS)/SDL
29
30 FILES := \
31     $(ARCHSRCDIR)/src/SDL \
32     $(ARCHSRCDIR)/src/SDL_error \
33     $(ARCHSRCDIR)/src/SDL_fatal \
34     $(ARCHSRCDIR)/src/audio/SDL_audio \
35     $(ARCHSRCDIR)/src/audio/SDL_audiocvt \
36     $(ARCHSRCDIR)/src/audio/SDL_audiodev \
37     $(ARCHSRCDIR)/src/audio/SDL_mixer \
38     $(ARCHSRCDIR)/src/audio/SDL_mixer_MMX \
39     $(ARCHSRCDIR)/src/audio/SDL_mixer_MMX_VC \
40     $(ARCHSRCDIR)/src/audio/SDL_mixer_m68k \
41     $(ARCHSRCDIR)/src/audio/SDL_wave \
42     $(ARCHSRCDIR)/src/audio/dummy/SDL_dummyaudio \
43     $(ARCHSRCDIR)/src/audio/ahi/SDL_ahiaudio \
44     $(ARCHSRCDIR)/src/audio/disk/SDL_diskaudio \
45     $(ARCHSRCDIR)/src/cdrom/SDL_cdrom \
46     $(ARCHSRCDIR)/src/cdrom/aros/SDL_syscdrom \
47     $(ARCHSRCDIR)/src/cpuinfo/SDL_cpuinfo \
48     $(ARCHSRCDIR)/src/events/SDL_active \
49     $(ARCHSRCDIR)/src/events/SDL_events \
50     $(ARCHSRCDIR)/src/events/SDL_expose \
51     $(ARCHSRCDIR)/src/events/SDL_keyboard \
52     $(ARCHSRCDIR)/src/events/SDL_mouse \
53     $(ARCHSRCDIR)/src/events/SDL_quit \
54     $(ARCHSRCDIR)/src/events/SDL_resize \
55     $(ARCHSRCDIR)/src/file/SDL_rwops \
56     $(ARCHSRCDIR)/src/joystick/SDL_joystick \
57     $(ARCHSRCDIR)/src/joystick/aros/SDL_sysjoystick \
58     $(ARCHSRCDIR)/src/loadso/dummy/SDL_sysloadso \
59     $(ARCHSRCDIR)/src/stdlib/SDL_getenv \
60     $(ARCHSRCDIR)/src/stdlib/SDL_iconv \
61     $(ARCHSRCDIR)/src/stdlib/SDL_malloc \
62     $(ARCHSRCDIR)/src/stdlib/SDL_qsort \
63     $(ARCHSRCDIR)/src/stdlib/SDL_stdlib \
64     $(ARCHSRCDIR)/src/stdlib/SDL_string \
65     $(ARCHSRCDIR)/src/thread/aros/SDL_syscond \
66     $(ARCHSRCDIR)/src/thread/aros/SDL_sysmutex \
67     $(ARCHSRCDIR)/src/thread/aros/SDL_syssem \
68     $(ARCHSRCDIR)/src/thread/aros/SDL_systhread \
69     $(ARCHSRCDIR)/src/thread/aros/SDL_thread \
70     $(ARCHSRCDIR)/src/timer/SDL_timer \
71     $(ARCHSRCDIR)/src/timer/aros/SDL_systimer \
72     $(ARCHSRCDIR)/src/video/SDL_RLEaccel \
73     $(ARCHSRCDIR)/src/video/SDL_blit \
74     $(ARCHSRCDIR)/src/video/SDL_blit_0 \
75     $(ARCHSRCDIR)/src/video/SDL_blit_1 \
76     $(ARCHSRCDIR)/src/video/SDL_blit_A \
77     $(ARCHSRCDIR)/src/video/SDL_blit_N \
78     $(ARCHSRCDIR)/src/video/SDL_bmp \
79     $(ARCHSRCDIR)/src/video/SDL_cursor \
80     $(ARCHSRCDIR)/src/video/SDL_gamma \
81     $(ARCHSRCDIR)/src/video/SDL_pixels \
82     $(ARCHSRCDIR)/src/video/SDL_stretch \
83     $(ARCHSRCDIR)/src/video/SDL_surface \
84     $(ARCHSRCDIR)/src/video/SDL_video \
85     $(ARCHSRCDIR)/src/video/SDL_yuv \
86     $(ARCHSRCDIR)/src/video/SDL_yuv_mmx \
87     $(ARCHSRCDIR)/src/video/SDL_yuv_sw \
88     $(ARCHSRCDIR)/src/video/dummy/SDL_nullevents \
89     $(ARCHSRCDIR)/src/video/dummy/SDL_nullmouse \
90     $(ARCHSRCDIR)/src/video/dummy/SDL_nullvideo \
91     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxevents \
92     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxmouse \
93     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxaccel \
94     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_LoadLibrary \
95     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_Quit \
96     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_CreateContext \
97     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_DestroyContext \
98     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_UpdateContext \
99     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_MakeCurrent \
100     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_SwapBuffers \
101     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_GetProcAddress \
102     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxgl_GetAttribute \
103     $(ARCHSRCDIR)/src/video/cgx/SDL_cgximage \
104     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxmodes \
105     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxvideo \
106     $(ARCHSRCDIR)/src/video/cgx/SDL_cgxwm
107
108 SDLINCDIR := $(AROS_DEVELOPMENT)/include/SDL
109
110 USER_INCLUDES := -I$(SDLINCDIR) -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/src -DSDL_AROS_SHARED
111
112 %build_module mmake=SDL-aros-sharedlib \
113     modname=SDL modtype=library \
114     files="$(ARCHSRCDIR)/aros_init $(FILES)" conffile=$(ARCHSRCDIR)/SDL.conf \
115     uselibs="GL iconv"
116
117 #MM SDL-aros-staticlib : SDL-aros-includes
118
119 USER_INCLUDES := -I$(SDLINCDIR) -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/src
120
121 %build_linklib mmake=SDL-aros-staticlib libname=SDL_static \
122     files="$(FILES)"
123
124 #MM SDL-aros-standardtests : includes linklibs SDL-aros-lib SDL-aros-tests-copyfiles
125 #MM SDL-aros-gltests : includes linklibs SDL-aros-lib SDL-aros-tests-copyfiles
126
127 TESTFILES := \
128     $(ARCHSRCDIR)/test/checkkeys \
129     $(ARCHSRCDIR)/test/graywin \
130     $(ARCHSRCDIR)/test/loopwave \
131     $(ARCHSRCDIR)/test/testalpha \
132     $(ARCHSRCDIR)/test/testbitmap \
133     $(ARCHSRCDIR)/test/testblitspeed \
134     $(ARCHSRCDIR)/test/testcdrom \
135     $(ARCHSRCDIR)/test/testcursor \
136     $(ARCHSRCDIR)/test/testerror \
137     $(ARCHSRCDIR)/test/testfile \
138     $(ARCHSRCDIR)/test/testgamma \
139     $(ARCHSRCDIR)/test/testiconv \
140     $(ARCHSRCDIR)/test/testjoystick \
141     $(ARCHSRCDIR)/test/testkeys \
142     $(ARCHSRCDIR)/test/testlock \
143     $(ARCHSRCDIR)/test/testoverlay2 \
144     $(ARCHSRCDIR)/test/testoverlay \
145     $(ARCHSRCDIR)/test/testpalette \
146     $(ARCHSRCDIR)/test/testplatform \
147     $(ARCHSRCDIR)/test/testsem \
148     $(ARCHSRCDIR)/test/testsprite \
149     $(ARCHSRCDIR)/test/testhread \
150     $(ARCHSRCDIR)/test/testtimer \
151     $(ARCHSRCDIR)/test/testver \
152     $(ARCHSRCDIR)/test/testvidinfo \
153     $(ARCHSRCDIR)/test/testwin \
154     $(ARCHSRCDIR)/test/testwm \
155     $(ARCHSRCDIR)/test/threadwin \
156     $(ARCHSRCDIR)/test/torturethread
157
158 TESTGLFILES := \
159     $(ARCHSRCDIR)/test/testdyngl \
160     $(ARCHSRCDIR)/test/testgl
161
162 DISABLEDTESTFILES := \
163     $(ARCHSRCDIR)/test/testloadso
164
165 USER_INCLUDES := -I$(SDLINCDIR) -I$(ARCHSRCDIR)/test
166
167 %build_progs mmake=SDL-aros-standardtests \
168     files=$(TESTFILES) targetdir=$(TESTEXEDIR) \
169     uselibs="SDL"
170
171 %build_progs mmake=SDL-aros-gltests \
172     files=$(TESTGLFILES) targetdir=$(TESTEXEDIR) \
173     uselibs="SDL GL"
174
175 INCLUDEFILES := \
176     SDL.h  \
177     begin_code.h  \
178     close_code.h  \
179     SDL_active.h  \
180     SDL_audio.h  \
181     SDL_byteorder.h  \
182     SDL_cdrom.h  \
183     SDL_config.h  \
184     SDL_config_aros.h  \
185     SDL_copying.h  \
186     SDL_cpuinfo.h  \
187     SDL_endian.h  \
188     SDL_error.h  \
189     SDL_events.h  \
190     SDL_getenv.h  \
191     SDL_joystick.h  \
192     SDL_keyboard.h  \
193     SDL_keysym.h  \
194     SDL_loadso.h  \
195     SDL_main.h  \
196     SDL_mouse.h  \
197     SDL_mutex.h  \
198     SDL_name.h  \
199     SDL_opengl.h  \
200     SDL_platform.h  \
201     SDL_quit.h  \
202     SDL_rwops.h  \
203     SDL_stdinc.h  \
204     SDL_syswm.h  \
205     SDL_thread.h  \
206     SDL_timer.h  \
207     SDL_types.h  \
208     SDL_version.h  \
209     SDL_video.h
210
211 #MM- SDL-aros-includes : contrib-sdl-sdl-main-fetch SDL_main-aros-includes
212 #MM SDL_main-aros-includes : libiconv-includes
213
214 STAMPFILE := $(GENDIR)/$(CURDIR)/.copy_stamp
215
216 #MM
217 SDL_main-aros-includes : setup-gendir $(STAMPFILE)
218
219 %rule_makedirs dirs=$(GENDIR)/$(CURDIR) setuptarget=setup-gendir
220
221 %rule_copy_diff_multi files=$(INCLUDEFILES) srcdir=$(ARCHSRCDIR)/include targetdir=$(SDLINCDIR) stampfile=$(STAMPFILE)
222
223 #MM
224 SDL-aros-config : \
225     $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-sdl-config \
226     $(AROS_DEVELOPMENT)/bin/sdl-config
227
228 $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-sdl-config: $(ARCHSRCDIR)/aros/sdl-config
229         @$(SED) 's,prefix=/Development,prefix=$(AROS_DEVELOPMENT),g' $< > $@
230         @$(CHMOD) a+x $@
231         ln -sf $@ $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)/sdl-config
232
233 $(AROS_DEVELOPMENT)/bin/sdl-config: $(ARCHSRCDIR)/aros/sdl-config
234         %mkdir_q dir=$(AROS_DEVELOPMENT)/bin
235         @$(CP) $< $@
236         @$(CHMOD) a+x $@
237
238 DATAFILES := \
239     icon.bmp \
240     moose.dat \
241     picture.xbm \
242     sail.bmp \
243     sample.bmp \
244     sample.wav \
245     utf8.txt
246
247 %copy_files_q mmake=SDL-aros-tests-copyfiles files="$(DATAFILES)" src=$(ARCHSRCDIR)/test dst=$(TESTEXEDIR)
248
249 %common