-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.os2
232 lines (198 loc) · 5.5 KB
/
Makefile.os2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# Open Watcom makefile to build SDL2mix.dll for OS/2
# wmake -f Makefile.os2
#
# Remember to edit DEPS_INC and DEPS_LIB below to meet
# your own environment!.
LIBNAME = SDL2mix
MAJOR_VERSION = 2
MINOR_VERSION = 8
MICRO_VERSION = 0
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
TITLENAME = $(LIBNAME) $(VERSION)
# change DEPS_INC in order to point to the dependency headers.
DEPS_INC=-IC:\SDL2DEV\h\SDL2 -IC:\SDL2DEV\h
# change DEPS_LIB in order to point to the dependency libraries.
DEPS_LIB=C:\SDL2DEV\lib
# wav music support
USE_WAV=yes
# ogg/vorbis music support
USE_OGG=yes
# use integer-only Tremor (libvorbisidec) instead of libvorbis?
USE_TREMOR=no
# use stb_vorbis instead of libvorbis?
USE_STBVORBIS=no
# flac music support (using libflac)
USE_FLAC=yes
# flac music support (using dr_flac)
USE_DRFLAC=no
# opus music support
USE_OPUS=yes
# mp3 music support (using mpg123)
USE_MPG123=yes
# mp3 music support (using minimp3)
USE_MINIMP3=no
# wavpack music support
USE_WAVPACK=yes
# wavpack DSD music support
USE_WAVPACK_DSD= no
# midi music support (using timidity)
USE_TIMIDITY=yes
# midi music support (using fluidsynth)
USE_FLUIDSYNTH=no
# tracker music support (using libxmp)
USE_XMP=yes
# tracker music support (using libmodplug)
USE_MODPLUG=no
# game-music-emu support (using libgme)
USE_GME=no
LIBFILE = $(LIBNAME).lib
DLLFILE = $(LIBNAME).dll
LNKFILE = $(LIBNAME).lnk
TIMILIB = timidity.lib
SRCS = utils.c effect_position.c effects_internal.c effect_stereoreverse.c mixer.c music.c
# codec sources:
SRCS+= load_aiff.c load_voc.c music_wav.c &
music_ogg.c music_ogg_stb.c music_opus.c &
music_flac.c music_drflac.c music_wavpack.c &
mp3utils.c music_mpg123.c music_minimp3.c &
music_xmp.c music_modplug.c music_gme.c &
music_fluidsynth.c music_timidity.c
# timidity sources:
TIMISRCS = common.c instrum.c mix.c output.c playmidi.c readmidi.c resample.c tables.c timidity.c
OBJS = $(SRCS:.c=.obj)
TIMIOBJS = $(TIMISRCS:.c=.obj)
LIBS = SDL2.lib
CFLAGS_BASE = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxh -ei -j
# warnings:
CFLAGS_BASE+= -wx
# newer OpenWatcom versions enable W303 by default
CFLAGS_BASE+= -wcd=303
# include paths:
CFLAGS_BASE+= -Iinclude -Isrc -I"src/codecs" -I"src/codecs/timidity" $(DEPS_INC)
CFLAGS_BASE+= -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
CFLAGS = $(CFLAGS_BASE)
# to build a dll:
CFLAGS+= -bd
# for DECLSPEC:
CFLAGS+= -DBUILD_SDL
!ifeq USE_TIMIDITY yes
CFLAGS+= -DMUSIC_MID_TIMIDITY
LIBS+= $(TIMILIB)
!endif
!ifeq USE_FLUIDSYNTH yes
CFLAGS+= -DMUSIC_MID_FLUIDSYNTH
LIBS+= fluidsyn.lib
!endif
!ifeq USE_WAV yes
CFLAGS+= -DMUSIC_WAV
!endif
!ifeq USE_TREMOR yes
VORBIS_LIBS=vorbisidec.lib
!else
VORBIS_LIBS=vorbisfile.lib vorbis.lib
!endif
!ifeq USE_OGG yes
CFLAGS+= -DMUSIC_OGG
!ifeq USE_STBVORBIS yes
CFLAGS+= -DOGG_USE_STB
!else
!ifeq USE_TREMOR yes
CFLAGS+= -DOGG_USE_TREMOR
!endif
LIBS+= $(VORBIS_LIBS)
NEED_LIBOGG=yes
!endif
!endif
!ifeq USE_FLAC yes
CFLAGS+= -DMUSIC_FLAC_LIBFLAC
LIBS+= FLAC.lib
!endif
!ifeq USE_DRFLAC yes
CFLAGS+= -DMUSIC_FLAC_DRFLAC
!endif
!ifeq USE_WAVPACK yes
CFLAGS+= -DMUSIC_WAVPACK
!ifeq USE_WAVPACK_DSD yes
CFLAGS+= -DMUSIC_WAVPACK_DSD
!endif
LIBS+= wavpack.lib
!endif
!ifeq USE_OPUS yes
CFLAGS+= -DMUSIC_OPUS
LIBS+= opusfile.lib opus.lib
NEED_LIBOGG=yes
!endif
!ifeq USE_MPG123 yes
CFLAGS+= -DMUSIC_MP3_MPG123
LIBS+= mpg123.lib
!endif
!ifeq USE_MINIMP3 yes
CFLAGS+= -DMUSIC_MP3_MINIMP3
!endif
!ifeq USE_XMP yes
CFLAGS+= -DMUSIC_MOD_XMP
LIBS+= libxmp.lib
!endif
!ifeq USE_MODPLUG yes
CFLAGS+= -DMUSIC_MOD_MODPLUG
LIBS+= modplug.lib
!endif
!ifeq USE_GME yes
CFLAGS+= -DMUSIC_GME
LIBS+= gme.lib
!endif
!ifeq NEED_LIBOGG yes
LIBS+= ogg.lib
!endif
# For the static assertions in mixer.c
CFLAGS+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
CFLAGS+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
CFLAGS+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
all: $(DLLFILE) playwave.exe playmus.exe
$(LIBFILE): $(DLLFILE)
@echo * Create library: $@...
wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(DLLFILE)
$(DLLFILE): $(OBJS) $(TIMILIB) $(LNKFILE)
@echo * Link: $@
wlink @$(LNKFILE)
$(LNKFILE):
@%create $@
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(LIBNAME)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@%append $@ OPTION QUIET
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@Simple DirectMedia Layer Mixer Library'
@%append $@ LIBPATH $(DEPS_LIB)
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION MAP=$*
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD
.c: ./src;./src/codecs;
.c.obj:
wcc386 $(CFLAGS) -fo=$^@ $<
music_minimp3.obj: music_minimp3.c
wcc386 $(CFLAGS) -za99 -fo=$^@ $<
playmus.obj: playmus.c
wcc386 $(CFLAGS_BASE) -fo=$^@ $<
playwave.obj: playwave.c
wcc386 $(CFLAGS_BASE) -fo=$^@ $<
playmus.exe: $(LIBFILE) playmus.obj
wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {playmus.obj} N playmus.exe
playwave.exe: $(LIBFILE) playwave.obj
wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {playwave.obj} N playwave.exe
.c: ./src/codecs/timidity;
timidity.lib: $(TIMIOBJS)
wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(TIMIOBJS)
clean: .SYMBOLIC
@echo * Clean: $(TITLENAME)
@if exist *.obj rm *.obj
@if exist *.err rm *.err
@if exist $(TIMILIB) rm $(TIMILIB)
@if exist $(LNKFILE) rm $(LNKFILE)
distclean: .SYMBOLIC clean
@if exist $(DLLFILE) rm $(DLLFILE)
@if exist $(LIBFILE) rm $(LIBFILE)
@if exist *.map rm *.map
@if exist *.exe rm *.exe