CC = wcc386 -bt=nt -q -bd
LD = wlink option quiet

CFLAGS = -i=include -i=external/libz/include -d_MILSKO -dUSE_GDI -dUSE_STB_TRUETYPE -dUSE_STB_IMAGE -dSTBI_NO_SIMD
LDFLAGS = system nt_dll
all: src/Mw.dll
clean: .SYMBOLIC
	%erase external/libz/src/adler32.obj
	%erase external/libz/src/compress.obj
	%erase external/libz/src/crc32.obj
	%erase external/libz/src/deflate.obj
	%erase external/libz/src/gzclose.obj
	%erase external/libz/src/gzlib.obj
	%erase external/libz/src/gzread.obj
	%erase external/libz/src/gzwrite.obj
	%erase external/libz/src/infback.obj
	%erase external/libz/src/inffast.obj
	%erase external/libz/src/inflate.obj
	%erase external/libz/src/inftrees.obj
	%erase external/libz/src/trees.obj
	%erase external/libz/src/uncompr.obj
	%erase external/libz/src/zutil.obj
	%erase external/stb_ds.obj
	%erase external/stb_image.obj
	%erase external/stb_truetype.obj
	%erase src/abstract/charset.obj
	%erase src/abstract/directory.obj
	%erase src/abstract/dynamic.obj
	%erase src/abstract/time.obj
	%erase src/backend/gdi.obj
	%erase src/color.obj
	%erase src/core.obj
	%erase src/cursor/arrow.obj
	%erase src/cursor/cross.obj
	%erase src/cursor/default.obj
	%erase src/cursor/hidden.obj
	%erase src/cursor/text.obj
	%erase src/default.obj
	%erase src/dialog/colorpicker.obj
	%erase src/dialog/directorychooser.obj
	%erase src/dialog/filechooser.obj
	%erase src/dialog/messagebox.obj
	%erase src/draw.obj
	%erase src/icon/back.obj
	%erase src/icon/clock.obj
	%erase src/icon/computer.obj
	%erase src/icon/directory.obj
	%erase src/icon/down.obj
	%erase src/icon/error.obj
	%erase src/icon/file.obj
	%erase src/icon/forward.obj
	%erase src/icon/info.obj
	%erase src/icon/left.obj
	%erase src/icon/news.obj
	%erase src/icon/note.obj
	%erase src/icon/right.obj
	%erase src/icon/search.obj
	%erase src/icon/up.obj
	%erase src/icon/warning.obj
	%erase src/lowlevel.obj
	%erase src/string.obj
	%erase src/text/font/boldfont.obj
	%erase src/text/font/boldmonottf.obj
	%erase src/text/font/boldttf.obj
	%erase src/text/font/font.obj
	%erase src/text/font/monottf.obj
	%erase src/text/font/ttf.obj
	%erase src/text/ft2.obj
	%erase src/text/stbtt.obj
	%erase src/text/text.obj
	%erase src/unicode.obj
	%erase src/widget/box.obj
	%erase src/widget/button.obj
	%erase src/widget/checkbox.obj
	%erase src/widget/combobox.obj
	%erase src/widget/entry.obj
	%erase src/widget/frame.obj
	%erase src/widget/image.obj
	%erase src/widget/label.obj
	%erase src/widget/listbox.obj
	%erase src/widget/menu.obj
	%erase src/widget/numberentry.obj
	%erase src/widget/opengl.obj
	%erase src/widget/progressbar.obj
	%erase src/widget/radiobox.obj
	%erase src/widget/scrollbar.obj
	%erase src/widget/separator.obj
	%erase src/widget/submenu.obj
	%erase src/widget/treeview.obj
	%erase src/widget/viewport.obj
	%erase src/widget/window.obj
	%erase src/Mw.dll
	%erase src/Mw.lib

src/Mw.dll:  external/libz/src/adler32.obj external/libz/src/compress.obj external/libz/src/crc32.obj external/libz/src/deflate.obj external/libz/src/gzclose.obj external/libz/src/gzlib.obj external/libz/src/gzread.obj external/libz/src/gzwrite.obj external/libz/src/infback.obj external/libz/src/inffast.obj external/libz/src/inflate.obj external/libz/src/inftrees.obj external/libz/src/trees.obj external/libz/src/uncompr.obj external/libz/src/zutil.obj external/stb_ds.obj external/stb_image.obj external/stb_truetype.obj src/abstract/charset.obj src/abstract/directory.obj src/abstract/dynamic.obj src/abstract/time.obj src/backend/gdi.obj src/color.obj src/core.obj src/cursor/arrow.obj src/cursor/cross.obj src/cursor/default.obj src/cursor/hidden.obj src/cursor/text.obj src/default.obj src/dialog/colorpicker.obj src/dialog/directorychooser.obj src/dialog/filechooser.obj src/dialog/messagebox.obj src/draw.obj src/icon/back.obj src/icon/clock.obj src/icon/computer.obj src/icon/directory.obj src/icon/down.obj src/icon/error.obj src/icon/file.obj src/icon/forward.obj src/icon/info.obj src/icon/left.obj src/icon/news.obj src/icon/note.obj src/icon/right.obj src/icon/search.obj src/icon/up.obj src/icon/warning.obj src/lowlevel.obj src/string.obj src/text/font/boldfont.obj src/text/font/boldmonottf.obj src/text/font/boldttf.obj src/text/font/font.obj src/text/font/monottf.obj src/text/font/ttf.obj src/text/ft2.obj src/text/stbtt.obj src/text/text.obj src/unicode.obj src/widget/box.obj src/widget/button.obj src/widget/checkbox.obj src/widget/combobox.obj src/widget/entry.obj src/widget/frame.obj src/widget/image.obj src/widget/label.obj src/widget/listbox.obj src/widget/menu.obj src/widget/numberentry.obj src/widget/opengl.obj src/widget/progressbar.obj src/widget/radiobox.obj src/widget/scrollbar.obj src/widget/separator.obj src/widget/submenu.obj src/widget/treeview.obj src/widget/viewport.obj src/widget/window.obj
	$(LD) $(LDFLAGS) option implib=src/Mw.lib name $@  file external/libz/src/adler32.obj file external/libz/src/compress.obj file external/libz/src/crc32.obj file external/libz/src/deflate.obj file external/libz/src/gzclose.obj file external/libz/src/gzlib.obj file external/libz/src/gzread.obj file external/libz/src/gzwrite.obj file external/libz/src/infback.obj file external/libz/src/inffast.obj file external/libz/src/inflate.obj file external/libz/src/inftrees.obj file external/libz/src/trees.obj file external/libz/src/uncompr.obj file external/libz/src/zutil.obj file external/stb_ds.obj file external/stb_image.obj file external/stb_truetype.obj file src/abstract/charset.obj file src/abstract/directory.obj file src/abstract/dynamic.obj file src/abstract/time.obj file src/backend/gdi.obj file src/color.obj file src/core.obj file src/cursor/arrow.obj file src/cursor/cross.obj file src/cursor/default.obj file src/cursor/hidden.obj file src/cursor/text.obj file src/default.obj file src/dialog/colorpicker.obj file src/dialog/directorychooser.obj file src/dialog/filechooser.obj file src/dialog/messagebox.obj file src/draw.obj file src/icon/back.obj file src/icon/clock.obj file src/icon/computer.obj file src/icon/directory.obj file src/icon/down.obj file src/icon/error.obj file src/icon/file.obj file src/icon/forward.obj file src/icon/info.obj file src/icon/left.obj file src/icon/news.obj file src/icon/note.obj file src/icon/right.obj file src/icon/search.obj file src/icon/up.obj file src/icon/warning.obj file src/lowlevel.obj file src/string.obj file src/text/font/boldfont.obj file src/text/font/boldmonottf.obj file src/text/font/boldttf.obj file src/text/font/font.obj file src/text/font/monottf.obj file src/text/font/ttf.obj file src/text/ft2.obj file src/text/stbtt.obj file src/text/text.obj file src/unicode.obj file src/widget/box.obj file src/widget/button.obj file src/widget/checkbox.obj file src/widget/combobox.obj file src/widget/entry.obj file src/widget/frame.obj file src/widget/image.obj file src/widget/label.obj file src/widget/listbox.obj file src/widget/menu.obj file src/widget/numberentry.obj file src/widget/opengl.obj file src/widget/progressbar.obj file src/widget/radiobox.obj file src/widget/scrollbar.obj file src/widget/separator.obj file src/widget/submenu.obj file src/widget/treeview.obj file src/widget/viewport.obj file src/widget/window.obj library clib3r.lib library opengl32.lib library gdi32.lib library user32.lib library advapi32.lib
	


external/libz/src/adler32.obj: external/libz/src/adler32.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/compress.obj: external/libz/src/compress.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/crc32.obj: external/libz/src/crc32.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/deflate.obj: external/libz/src/deflate.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/gzclose.obj: external/libz/src/gzclose.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/gzlib.obj: external/libz/src/gzlib.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/gzread.obj: external/libz/src/gzread.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/gzwrite.obj: external/libz/src/gzwrite.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/infback.obj: external/libz/src/infback.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/inffast.obj: external/libz/src/inffast.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/inflate.obj: external/libz/src/inflate.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/inftrees.obj: external/libz/src/inftrees.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/trees.obj: external/libz/src/trees.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/uncompr.obj: external/libz/src/uncompr.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/libz/src/zutil.obj: external/libz/src/zutil.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/stb_ds.obj: external/stb_ds.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/stb_image.obj: external/stb_image.c
	$(CC) $(CFLAGS) -fo=$@ $<
external/stb_truetype.obj: external/stb_truetype.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/abstract/charset.obj: src/abstract/charset.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/abstract/directory.obj: src/abstract/directory.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/abstract/dynamic.obj: src/abstract/dynamic.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/abstract/time.obj: src/abstract/time.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/backend/gdi.obj: src/backend/gdi.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/color.obj: src/color.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/core.obj: src/core.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/cursor/arrow.obj: src/cursor/arrow.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/cursor/cross.obj: src/cursor/cross.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/cursor/default.obj: src/cursor/default.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/cursor/hidden.obj: src/cursor/hidden.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/cursor/text.obj: src/cursor/text.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/default.obj: src/default.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/dialog/colorpicker.obj: src/dialog/colorpicker.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/dialog/directorychooser.obj: src/dialog/directorychooser.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/dialog/filechooser.obj: src/dialog/filechooser.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/dialog/messagebox.obj: src/dialog/messagebox.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/draw.obj: src/draw.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/back.obj: src/icon/back.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/clock.obj: src/icon/clock.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/computer.obj: src/icon/computer.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/directory.obj: src/icon/directory.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/down.obj: src/icon/down.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/error.obj: src/icon/error.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/file.obj: src/icon/file.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/forward.obj: src/icon/forward.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/info.obj: src/icon/info.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/left.obj: src/icon/left.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/news.obj: src/icon/news.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/note.obj: src/icon/note.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/right.obj: src/icon/right.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/search.obj: src/icon/search.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/up.obj: src/icon/up.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/icon/warning.obj: src/icon/warning.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/lowlevel.obj: src/lowlevel.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/string.obj: src/string.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/boldfont.obj: src/text/font/boldfont.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/boldmonottf.obj: src/text/font/boldmonottf.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/boldttf.obj: src/text/font/boldttf.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/font.obj: src/text/font/font.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/monottf.obj: src/text/font/monottf.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/font/ttf.obj: src/text/font/ttf.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/ft2.obj: src/text/ft2.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/stbtt.obj: src/text/stbtt.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/text/text.obj: src/text/text.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/unicode.obj: src/unicode.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/box.obj: src/widget/box.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/button.obj: src/widget/button.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/checkbox.obj: src/widget/checkbox.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/combobox.obj: src/widget/combobox.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/entry.obj: src/widget/entry.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/frame.obj: src/widget/frame.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/image.obj: src/widget/image.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/label.obj: src/widget/label.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/listbox.obj: src/widget/listbox.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/menu.obj: src/widget/menu.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/numberentry.obj: src/widget/numberentry.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/opengl.obj: src/widget/opengl.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/progressbar.obj: src/widget/progressbar.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/radiobox.obj: src/widget/radiobox.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/scrollbar.obj: src/widget/scrollbar.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/separator.obj: src/widget/separator.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/submenu.obj: src/widget/submenu.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/treeview.obj: src/widget/treeview.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/viewport.obj: src/widget/viewport.c
	$(CC) $(CFLAGS) -fo=$@ $<
src/widget/window.obj: src/widget/window.c
	$(CC) $(CFLAGS) -fo=$@ $<
