/
Makefile.os2
138 lines (113 loc) · 4.24 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
# Open Watcom makefile to build SDL_sound for OS/2
# wmake -f Makefile.os2
#
# Remember to edit DEPS_INC and DEPS_LIB below to meet
# your own environment!.
# change DEPS_INC in order to point to the dependency headers.
DEPS_INC=-IC:\SDL2DEV\h\SDL2
# change DEPS_LIB in order to point to the dependency libraries.
DEPS_LIB=C:\SDL2DEV\lib
LIBNAME = SDL2snd
VERSION = 2.0.1
LIBFILE = $(LIBNAME).lib
DLLFILE = $(LIBNAME).dll
LNKFILE = $(LIBNAME).lnk
MODPLIB = modplug.lib
TIMILIB = timidity.lib
TITLENAME = $(LIBNAME) $(VERSION)
SRCS = SDL_sound_aiff.c SDL_sound_au.c SDL_sound_raw.c SDL_sound_shn.c &
SDL_sound_voc.c SDL_sound_wav.c SDL_sound_flac.c SDL_sound_mp3.c &
SDL_sound_vorbis.c SDL_sound_midi.c SDL_sound_modplug.c SDL_sound.c
MODPSRCS = modplug.c sndfile.c fastmix.c snd_dsp.c snd_flt.c snd_fx.c sndmix.c &
load_669.c load_amf.c load_ams.c load_dbm.c load_dmf.c load_dsm.c &
load_far.c load_it.c load_mdl.c load_med.c load_mod.c load_mt2.c &
load_mtm.c load_okt.c load_psm.c load_ptm.c load_s3m.c load_stm.c &
load_gdm.c load_ult.c load_umx.c load_xm.c mmcmp.c
TIMISRCS = common.c instrum.c mix.c output.c playmidi.c readmidi.c resample.c &
tables.c timidity.c
OBJS = $(SRCS:.c=.obj)
MODPOBJS = $(MODPSRCS:.c=.obj)
TIMIOBJS = $(TIMISRCS:.c=.obj)
CFLAGS_BASE = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxh -ei -j
CFLAGS_BASE+= -DNDEBUG
# warnings:
CFLAGS_BASE+= -wx
# newer OpenWatcom versions enable W303 by default
CFLAGS_BASE+= -wcd=303
# include paths:
CFLAGS_BASE+= -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
CFLAGS_BASE+= -I. $(DEPS_INC)
CFLAGS = $(CFLAGS_BASE)
# to build a dll:
CFLAGS+= -bd
# for DECLSPEC:
CFLAGS+= -DBUILD_SDL -DSDL_SOUND_DLL_EXPORTS
CFLAGS+= -DSOUND_SUPPORTS_MP3 &
-DSOUND_SUPPORTS_MODPLUG &
-DSOUND_SUPPORTS_MIDI &
-DSOUND_SUPPORTS_WAV &
-DSOUND_SUPPORTS_AIFF &
-DSOUND_SUPPORTS_AU &
-DSOUND_SUPPORTS_VORBIS &
-DSOUND_SUPPORTS_VOC &
-DSOUND_SUPPORTS_SHN &
-DSOUND_SUPPORTS_RAW &
-DSOUND_SUPPORTS_FLAC
LIBSDL = SDL2.lib
LIBS = $(LIBSDL) $(MODPLIB) $(TIMILIB)
.extensions:
.extensions: .lib .dll .obj .c
all: $(DLLFILE) playsound.exe playsound_simple.exe
.c: decoders
.c: examples
$(LIBFILE): $(DLLFILE)
@echo * Create library: $@...
wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(DLLFILE)
$(DLLFILE): $(OBJS) $(MODPLIB) $(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 '@$#icculus org:$(VERSION)$#@Simple DirectMedia Layer, abstract soundfile decoder'
@%append $@ LIBPATH $(DEPS_LIB)
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION MAP=$^&.map
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION STACK=0x40000
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD
.c.obj:
wcc386 $(CFLAGS) -fo=$^@ $<
playsound.obj: "../examples/playsound.c"
wcc386 $(CFLAGS_BASE) -DHAVE_SIGNAL_H=1 -DHAVE_SETBUF=1 -DHAVE_ASSERT_H=1 -fo=$^@ $<
playsound_simple.obj: "../examples/playsound_simple.c"
wcc386 $(CFLAGS_BASE) -fo=$^@ $<
playsound.exe: $(LIBFILE) playsound.obj
@echo * Link: $@
wlink SYS os2v2 LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) $(LIBSDL)} op q op el op stack=0x40000 F {playsound.obj} N playsound.exe
playsound_simple.exe: $(LIBFILE) playsound_simple.obj
@echo * Link: $@
wlink SYS os2v2 LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) $(LIBSDL)} op q op el op stack=0x40000 F {playsound_simple.obj} N playsound_simple.exe
.c: libmodplug;
modplug.lib: $(MODPOBJS)
wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(MODPOBJS)
.c: 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 $(MODPLIB) rm $(MODPLIB)
@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