updates to os/2 build

This commit is contained in:
Ozkan Sezer 2022-01-08 22:35:02 +03:00
parent c1e6079836
commit 836a4ec7b1
3 changed files with 130 additions and 56 deletions

View File

@ -21,26 +21,29 @@ INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
INCPATH+= -Iinclude INCPATH+= -Iinclude
LIBM = SDL2libm.lib LIBM = SDL2libm.lib
TLIB = SDL2test.lib
LIBS = mmpm2.lib $(LIBM) LIBS = mmpm2.lib $(LIBM)
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
# max warnings: # max warnings:
CFLAGS+= -wx CFLAGS+= -wx
# newer OpenWatcom versions enable W303 by default # newer OpenWatcom versions enable W303 by default
CFLAGS+= -wcd=303 CFLAGS+= -wcd=303
# the include paths :
CFLAGS+= $(INCPATH)
CFLAGS_STATIC=$(CFLAGS)
# building dll: # building dll:
CFLAGS+= -bd CFLAGS_DLL =$(CFLAGS)
CFLAGS_DLL+= -bd
# iconv: # iconv:
LIBICONV_LIB=iconv2.lib LIBICONV_LIB=iconv2.lib
!ifeq LIBICONV 1 !ifeq LIBICONV 1
CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
LIBS+= $(ICONVLIB) LIBS+= $(ICONVLIB)
!else !else
LIBS+= libuls.lib libconv.lib LIBS+= libuls.lib libconv.lib
!endif !endif
# the include paths :
CFLAGS+= $(INCPATH)
# building SDL itself (for DECLSPEC): # building SDL itself (for DECLSPEC):
CFLAGS+= -DBUILD_SDL CFLAGS_DLL+= -DBUILD_SDL
# Debug options: # Debug options:
# - debug messages from OS/2 related code to stdout: # - debug messages from OS/2 related code to stdout:
@ -48,10 +51,6 @@ CFLAGS+= -DBUILD_SDL
# - debug messages from OS/2 code via SDL_LogDebug(): # - debug messages from OS/2 code via SDL_LogDebug():
#CFLAGS+= -DOS2DEBUG=2 #CFLAGS+= -DOS2DEBUG=2
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
@ -92,7 +91,6 @@ SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
SRCS+= SDL_dynapi.c SRCS+= SDL_dynapi.c
OBJS = $(SRCS:.c=.obj) OBJS = $(SRCS:.c=.obj)
MOBJS= $(MSRCS:.c=.obj)
.extensions: .extensions:
.extensions: .lib .dll .obj .c .asm .extensions: .lib .dll .obj .c .asm
@ -103,9 +101,12 @@ MOBJS= $(MSRCS:.c=.obj)
.c: ./src/core/os2/geniconv; .c: ./src/core/os2/geniconv;
.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi .c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
all: $(DLLFILE) $(LIBFILE) .symbolic all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
$(DLLFILE): $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE) build_dll: .symbolic
@echo * Compiling dll objects
$(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
@echo * Linking: $@ @echo * Linking: $@
wlink @$(LNKFILE) wlink @$(LNKFILE)
@ -114,40 +115,132 @@ $(LIBFILE): $(DLLFILE)
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE) wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
.c.obj: .c.obj:
wcc386 $(CFLAGS) -fo=$^@ $< wcc386 $(CFLAGS_DLL) -fo=$^@ $<
SDL_syscond.obj: "src/thread/generic/SDL_syscond.c" SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
wcc386 $(CFLAGS) -fo=$^@ $< wcc386 $(CFLAGS_DLL) -fo=$^@ $<
SDL_cpuinfo.obj: SDL_cpuinfo.c SDL_cpuinfo.obj: SDL_cpuinfo.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_wave.obj: SDL_wave.c SDL_wave.obj: SDL_wave.c
wcc386 $(CFLAGS) -wcd=124 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
SDL_blendfillrect.obj: SDL_blendfillrect.c SDL_blendfillrect.obj: SDL_blendfillrect.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendline.obj: SDL_blendline.c SDL_blendline.obj: SDL_blendline.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendpoint.obj: SDL_blendpoint.c SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
# c99 mode needed because of structs with flexible array members in libusb.h # c99 mode needed because of structs with flexible array members in libusb.h
SDL_hidapi.obj: SDL_hidapi.c SDL_hidapi.obj: SDL_hidapi.c
wcc386 $(CFLAGS) -za99 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $<
.c: ./src/libm;
$(LIBM): $(MOBJS)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
$(LIBICONV_LIB): "src/core/os2/iconv2.lbc" $(LIBICONV_LIB): "src/core/os2/iconv2.lbc"
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$< wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
# SDL2libm
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
MOBJS= $(MSRCS:.c=.obj)
.c: ./src/libm;
e_atan2.obj: e_atan2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_exp.obj: e_exp.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_fmod.obj: e_fmod.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log10.obj: e_log10.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log.obj: e_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_pow.obj: e_pow.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_rem_pio2.obj: e_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_sqrt.obj: e_sqrt.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_cos.obj: k_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_rem_pio2.obj: k_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_sin.obj: k_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_tan.obj: k_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_atan.obj: s_atan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_copysign.obj: s_copysign.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_cos.obj: s_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_fabs.obj: s_fabs.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_floor.obj: s_floor.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_scalbn.obj: s_scalbn.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_sin.obj: s_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_tan.obj: s_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_libm: .symbolic
@echo * Compiling libm objects
$(LIBM): build_libm $(MOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
# SDL2test
TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
TOBJS= $(TSRCS:.c=.obj)
.c: ./src/test;
SDL_test_assert.obj: SDL_test_assert.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_common.obj: SDL_test_common.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_compare.obj: SDL_test_compare.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_crc32.obj: SDL_test_crc32.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_font.obj: SDL_test_font.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_fuzzer.obj: SDL_test_fuzzer.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_harness.obj: SDL_test_harness.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlit.obj: SDL_test_imageBlit.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageFace.obj: SDL_test_imageFace.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_log.obj: SDL_test_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_md5.obj: SDL_test_md5.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_random.obj: SDL_test_random.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_memory.obj: SDL_test_memory.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_tlib: .symbolic
@echo * Compiling testlib objects
$(TLIB): build_tlib $(TOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
$(LNKFILE): $(LNKFILE):
@echo * Creating linker file: $@ @echo * Creating linker file: $@
@%create $@ @%create $@
@ -177,3 +270,4 @@ distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
@if exist $(LIBFILE) rm $(LIBFILE) @if exist $(LIBFILE) rm $(LIBFILE)
@if exist $(DLLFILE) rm $(DLLFILE) @if exist $(DLLFILE) rm $(DLLFILE)
@if exist $(TLIB) rm $(TLIB)

View File

@ -12,7 +12,6 @@ if [ -z "$WATCOM" ]; then
echo "This is often something like '/usr/local/share/watcom'" 1>&2 echo "This is often something like '/usr/local/share/watcom'" 1>&2
exit 1 exit 1
fi fi
export PATH="$WATCOM/binl:$PATH" export PATH="$WATCOM/binl:$PATH"
ZIPFILE="$1" ZIPFILE="$1"
@ -31,8 +30,8 @@ rm -f $ZIPFILE
wmake -f Makefile.os2 wmake -f Makefile.os2
rm -rf $ZIPDIR rm -rf $ZIPDIR
mkdir -p $ZIPDIR mkdir -p $ZIPDIR
chmod a+r SDL2.lib SDL2.dll chmod 644 SDL2.dll SDL2.lib SDL2test.lib
mv SDL2.lib SDL2.dll $ZIPDIR/ mv SDL2.dll SDL2.lib SDL2test.lib $ZIPDIR/
cp -R include $ZIPDIR/ cp -R include $ZIPDIR/
zip -9r "buildbot/$ZIPFILE" $ZIPDIR zip -9r "buildbot/$ZIPFILE" $ZIPDIR

View File

@ -7,7 +7,7 @@ CFLAGS = $(INCPATH) -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
CFLAGS+= -wx -wcd=303 CFLAGS+= -wx -wcd=303
LIBPATH = .. LIBPATH = ..
LIBS = SDL2.lib $(TESTLIB) LIBS = SDL2.lib SDL2test.lib
#CFLAGS+= -DHAVE_SDL_TTF #CFLAGS+= -DHAVE_SDL_TTF
#TTFLIBS = SDL2ttf.lib #TTFLIBS = SDL2ttf.lib
@ -29,14 +29,6 @@ TARGETS = testatomic.exe testdisplayinfo.exe testbounds.exe testdraw2.exe &
testsurround.exe testyuv.exe testgl2.exe testvulkan.exe testnative.exe & testsurround.exe testyuv.exe testgl2.exe testvulkan.exe testnative.exe &
testautomation.exe testautomation.exe
# SDL2test.lib sources (../src/test)
CSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
TESTLIB = SDL2test.lib
# testautomation sources # testautomation sources
TASRCS = testautomation.c testautomation_audio.c testautomation_clipboard.c & TASRCS = testautomation.c testautomation_audio.c testautomation_clipboard.c &
testautomation_events.c testautomation_hints.c & testautomation_events.c testautomation_hints.c &
@ -56,11 +48,7 @@ all: $(TARGETS)
.c: ../src/test .c: ../src/test
$(TESTLIB): $(COBJS)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(COBJS)
.obj.exe: .obj.exe:
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@
.c.obj: .c.obj:
@ -68,29 +56,22 @@ $(TESTLIB): $(COBJS)
# specials # specials
testautomation.exe: $(TAOBJS) testautomation.exe: $(TAOBJS)
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@
testnative.exe: testnative.obj testnativeos2.obj testnative.exe: testnative.obj testnativeos2.obj
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@
testoverlay2.exe: testoverlay2.obj testyuv_cvt.obj testoverlay2.exe: testoverlay2.obj testyuv_cvt.obj
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@
testyuv.exe: testyuv.obj testyuv_cvt.obj testyuv.exe: testyuv.obj testyuv_cvt.obj
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@
testime.exe: testime.obj testime.exe: testime.obj
@%make $(TESTLIB)
wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS) $(TTFLIBS)} op q op el file {$<} name $@ wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS) $(TTFLIBS)} op q op el file {$<} name $@
clean: .SYMBOLIC clean: .SYMBOLIC
@if exist *.obj rm *.obj @if exist *.obj rm *.obj
@if exist *.err rm *.err @if exist *.err rm *.err
distclean: .SYMBOLIC clean distclean: .SYMBOLIC clean
@if exist *.exe rm *.exe @if exist *.exe rm *.exe
@if exist $(TESTLIB) rm $(TESTLIB)