Debian Codegraph @

src/Makefile.w32

raw
1 # OpenWatcom makefile to build SDL2 for Win32
2 #
3 !ifndef %WATCOM
4 !error Environment variable WATCOM is not specified!
5 !endif
6
7 DLLNAME = SDL2
8
9 # change SDL2INC to point to the SDL2 headers
10 SDL2INC = include
11 INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h"
12 LIBNAME = $(DLLNAME)
13
14 DLLFILE = $(LIBNAME).dll
15 LIBFILE = $(LIBNAME).lib
16 LNKFILE = $(LIBNAME).lnk
17
18 CFLAGS =-bt=nt -d0 -zq -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
19 # max warnings:
20 CFLAGS+= -wx
21 # avoid bogus W200 from cpuid code
22 CFLAGS+= -wcd=200
23 # newer OpenWatcom versions enable W303 by default
24 CFLAGS+= -wcd=303
25 # the include paths :
26 CFLAGS+= $(INCPATH)
27 # misc
28 CFLAGS+= -DNDEBUG -DSDL_INCLUDE_STDBOOL_H
29
30 CFLAGS_DLL = $(CFLAGS)
31 # building dll:
32 CFLAGS_DLL+= -bd
33 # the include paths :
34 CFLAGS_DLL+= -I"$(SDL2INC)"
35 # we override the SDL_DECLSPEC define in begin_code.h, because we are using
36 # an exports file to remove the _cdecl '_' prefix from the symbol names
37 CFLAGS_DLL+= -DSDL_DECLSPEC=
38
39 object_files= sdl2_compat.obj SDL_dynapi.obj
40 resource_obj= version.res
41
42 .extensions:
43 .extensions: .lib .dll .obj .c .asm .res .rc
44
45 .c: ./dynapi
46 .c.obj:
47 wcc386 $(CFLAGS_DLL) -fo=$^@ $<
48 .rc.res:
49 wrc -q -r -bt=nt -I"$(%WATCOM)/h/nt" -fo=$^@ $<
50
51 all: $(DLLFILE) $(LIBFILE) .symbolic
52
53 $(DLLFILE): compiling_info $(object_files) $(resource_obj) $(LNKFILE)
54 @echo * Linking: $@
55 @wlink @$(LNKFILE)
56
57 $(LIBFILE): $(DLLFILE)
58 @echo * Creating LIB file: $@
59 wlib -q -b -n -c -pa -s -t -zld -ii -io $* @SDL2.lbc
60
61 compiling_info : .symbolic
62 @echo * Compiling...
63
64 $(LNKFILE):
65 @echo * Creating linker file: $@
66 @%create $@
67 @%append $@ SYSTEM nt_dll INITINSTANCE TERMINSTANCE
68 @%append $@ NAME $(DLLFILE)
69 @for %i in ($(object_files)) do @%append $@ FILE %i
70 @%append $@ EXPORT=SDL2.exports
71 @%append $@ OPTION IMPF=SDL2.lbc
72 @%append $@ OPTION RESOURCE=$(resource_obj)
73 @%append $@ OPTION QUIET
74 @%append $@ OPTION MAP=$^&.map
75 @%append $@ OPTION ELIMINATE
76 @%append $@ OPTION SHOWDEAD
77
78 clean: .SYMBOLIC
79 @echo * Clean: $(LIBNAME)
80 @if exist *.obj rm *.obj
81 @if exist *.res rm *.res
82 @if exist *.lbc rm *.lbc
83 @if exist *.map rm *.map
84 @if exist $(LNKFILE) rm $(LNKFILE)
85
86 distclean: clean .SYMBOLIC
87 @if exist *.err rm *.err
88 @if exist $(DLLFILE) rm $(DLLFILE)
89 @if exist $(LIBFILE) rm $(LIBFILE)