115 lines
3.3 KiB
Text
115 lines
3.3 KiB
Text
# Open Watcom makefile to build SDL2img.dll for OS/2
|
|
# wmake -f Makefile.os2
|
|
#
|
|
# Remember to edit DEPS_INC and DEPS_LIB below to meet
|
|
# your own environment!.
|
|
|
|
LIBNAME = SDL2img
|
|
MAJOR_VERSION = 2
|
|
MINOR_VERSION = 7
|
|
MICRO_VERSION = 0
|
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
|
|
|
TITLENAME = $(LIBNAME) $(VERSION)
|
|
|
|
LIBFILE = $(LIBNAME).lib
|
|
DLLFILE = $(LIBNAME).dll
|
|
LNKFILE = $(LIBNAME).lnk
|
|
# 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
|
|
|
|
SRCS = IMG.c IMG_bmp.c IMG_gif.c IMG_jpg.c IMG_lbm.c IMG_pcx.c IMG_png.c &
|
|
IMG_pnm.c IMG_svg.c IMG_tga.c IMG_tif.c IMG_xcf.c IMG_xpm.c IMG_xv.c &
|
|
IMG_webp.c IMG_qoi.c IMG_avif.c IMG_jxl.c IMG_stb.c
|
|
|
|
LIBS = libpng.lib libtiff.lib zlib.lib jpeg.lib webpdec.lib webpdemux.lib SDL2.lib
|
|
|
|
CFLAGS_BASE = -bt=os2 -ei -d0 -q -5s -fp5 -fpi87 -sg -oeatxh
|
|
# warnings:
|
|
CFLAGS_BASE+= -wx -wcd=202
|
|
# newer OpenWatcom versions enable W303 by default
|
|
CFLAGS_BASE+= -wcd=303
|
|
# include paths:
|
|
CFLAGS_BASE+= -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
|
|
CFLAGS_BASE+= -Iinclude $(DEPS_INC)
|
|
CFLAGS =$(CFLAGS_BASE)
|
|
# to build a dll:
|
|
CFLAGS+= -bd
|
|
# for DECLSPEC:
|
|
CFLAGS+= -DBUILD_SDL
|
|
|
|
# wanted formats:
|
|
CFLAGS+= -DLOAD_JPG -DLOAD_PNG -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM &
|
|
-DLOAD_PCX -DLOAD_PNM -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM &
|
|
-DLOAD_XV -DLOAD_SVG -DLOAD_TIF -DLOAD_WEBP -DLOAD_QOI
|
|
|
|
#CFLAGS+= -DLOAD_AVIF
|
|
#CFLAGS+= -DLOAD_JXL
|
|
#CFLAGS+= -DUSE_STBIMAGE -DSTBI_NO_SIMD
|
|
|
|
CFLAGS+= -DSDL_IMAGE_SAVE_JPG=1
|
|
CFLAGS+= -DSDL_IMAGE_SAVE_PNG=1
|
|
|
|
CFLAGS+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
|
|
CFLAGS+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
|
|
CFLAGS+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
|
|
|
|
.extensions:
|
|
.extensions: .lib .dll .obj .c
|
|
|
|
OBJS = $(SRCS:.c=.obj)
|
|
|
|
all: $(LIBFILE) showimage.exe showanim.exe
|
|
|
|
$(LIBFILE): $(DLLFILE)
|
|
@echo * Create library: $@...
|
|
wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(DLLFILE)
|
|
|
|
$(DLLFILE): $(OBJS) $(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 Image 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
|
|
.c.obj:
|
|
wcc386 $(CFLAGS) -fo=$^@ $<
|
|
|
|
showimage.obj: examples/showimage.c
|
|
wcc386 $(CFLAGS_BASE) -fo=$^@ $<
|
|
|
|
showanim.obj: examples/showanim.c
|
|
wcc386 $(CFLAGS_BASE) -fo=$^@ $<
|
|
|
|
showimage.exe: $(LIBFILE) showimage.obj
|
|
wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {showimage.obj} N showimage.exe
|
|
|
|
showanim.exe: $(LIBFILE) showanim.obj
|
|
wlink SYS os2v2 OP q LIBPATH $(DEPS_LIB) LIBR {$(LIBFILE) SDL2.lib} F {showanim.obj} N showanim.exe
|
|
|
|
clean: .SYMBOLIC
|
|
@echo * Clean: $(TITLENAME)
|
|
@if exist *.obj rm *.obj
|
|
@if exist *.err rm *.err
|
|
@if exist $(LNKFILE) rm $(LNKFILE)
|
|
|
|
distclean: .SYMBOLIC clean
|
|
@if exist $(DLLFILE) rm $(DLLFILE)
|
|
@if exist $(LIBFILE) rm $(LIBFILE)
|
|
@if exist *.exe rm *.exe
|
|
@if exist *.map rm *.map
|