forked from libsdl-org/SDL_mixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.os2
192 lines (164 loc) · 4.58 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
# 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
VERSION = 2.0.4
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
# flac music support
USE_FLAC=yes
# opus music support
USE_OPUS=yes
# mp3 music support (using libmad - Note: GPL license!)
USE_LIBMAD=no
# mp3 music support (using mpg123)
USE_MPG123=yes
# midi music support (using timidity)
USE_TIMIDITY=yes
# midi music support (using fluidsynth)
USE_FLUIDSYNTH=no
# tracker music support (using libmikmod)
USE_MIKMOD=no
# tracker music support (using libxmp)
USE_XMP=yes
# tracker music support (using libmodplug)
USE_MODPLUG=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 &
mp3utils.c music_mad.c music_mpg123.c &
music_ogg.c music_opus.c music_flac.c &
music_xmp.c music_mikmod.c music_modplug.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 -oteanbmier -ei -j
# warnings:
CFLAGS_BASE+= -wx
# 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_TREMOR yes
CFLAGS+= -DOGG_USE_TREMOR
!endif
LIBS+= $(VORBIS_LIBS)
LIBS+= ogg.lib
!endif
!ifeq USE_FLAC yes
CFLAGS+= -DMUSIC_FLAC
LIBS+= FLAC.lib
!endif
!ifeq USE_OPUS yes
CFLAGS+= -DMUSIC_OPUS
LIBS+= opusfile.lib opus.lib
!ifneq USE_OGG yes
LIBS+= ogg.lib
!endif
!endif
!ifeq USE_LIBMAD yes
CFLAGS+= -DMUSIC_MP3_MAD
LIBS+= mad.lib
!endif
!ifeq USE_MPG123 yes
CFLAGS+= -DMUSIC_MP3_MPG123
LIBS+= mpg123.lib
!endif
!ifeq USE_XMP yes
CFLAGS+= -DMUSIC_MOD_XMP
LIBS+= libxmp.lib
!endif
!ifeq USE_MIKMOD yes
CFLAGS+= -DMUSIC_MOD_MIKMOD
LIBS+= mikmod.lib
!endif
!ifeq USE_MODPLUG yes
CFLAGS+= -DMUSIC_MOD_MODPLUG
LIBS+= modplug.lib
!endif
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=$^@ $<
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