CC = cl /TC /c /nologo
LD = link /nologo

MW_CFLAGS =  /Iinclude /Iexternal\libz\include /D_MILSKO /D_MILSKO_BUILD /DUSE_GDI /DUSE_STB_TRUETYPE /DUSE_STB_IMAGE /DSTBI_NO_SIMD
MW_LDFLAGS = /DLL
EXE_CFLAGS = /Iinclude
EXE_LDFLAGS = 
.SUFFIXES: .obj .c
all: src\Mw.dll examples\basic\box.exe examples\basic\calculator.exe examples\basic\checkbox.exe examples\basic\clipboard.exe examples\basic\colorpicker.exe examples\basic\combobox.exe examples\basic\example.exe examples\basic\filechooser.exe examples\basic\image.exe examples\basic\listbox.exe examples\basic\messagebox.exe examples\basic\periodic.exe examples\basic\progressbar.exe examples\basic\radiobox.exe examples\basic\rotate.exe examples\basic\scrollbar.exe examples\basic\sevensegment.exe examples\basic\subwindow.exe examples\basic\tab.exe examples\basic\treeview.exe examples\basic\viewport.exe examples\gldemos\boing.exe examples\gldemos\clock.exe examples\gldemos\cube.exe examples\gldemos\gears.exe examples\gldemos\triangle.exe examples\gldemos\tripaint.exe
lib: src\Mw.dll
examples: examples\basic\box.exe examples\basic\calculator.exe examples\basic\checkbox.exe examples\basic\clipboard.exe examples\basic\colorpicker.exe examples\basic\combobox.exe examples\basic\example.exe examples\basic\filechooser.exe examples\basic\image.exe examples\basic\listbox.exe examples\basic\messagebox.exe examples\basic\periodic.exe examples\basic\progressbar.exe examples\basic\radiobox.exe examples\basic\rotate.exe examples\basic\scrollbar.exe examples\basic\sevensegment.exe examples\basic\subwindow.exe examples\basic\tab.exe examples\basic\treeview.exe examples\basic\viewport.exe examples\gldemos\boing.exe examples\gldemos\clock.exe examples\gldemos\cube.exe examples\gldemos\gears.exe examples\gldemos\triangle.exe examples\gldemos\tripaint.exe
clean: 
	del /f /q external\libz\src\adler32.obj
	del /f /q external\libz\src\compress.obj
	del /f /q external\libz\src\crc32.obj
	del /f /q external\libz\src\deflate.obj
	del /f /q external\libz\src\gzclose.obj
	del /f /q external\libz\src\gzlib.obj
	del /f /q external\libz\src\gzread.obj
	del /f /q external\libz\src\gzwrite.obj
	del /f /q external\libz\src\infback.obj
	del /f /q external\libz\src\inffast.obj
	del /f /q external\libz\src\inflate.obj
	del /f /q external\libz\src\inftrees.obj
	del /f /q external\libz\src\trees.obj
	del /f /q external\libz\src\uncompr.obj
	del /f /q external\libz\src\zutil.obj
	del /f /q external\stb_ds.obj
	del /f /q external\stb_image.obj
	del /f /q external\stb_truetype.obj
	del /f /q src\abstract\charset.obj
	del /f /q src\abstract\directory.obj
	del /f /q src\abstract\dynamic.obj
	del /f /q src\abstract\time.obj
	del /f /q src\backend\gdi.obj
	del /f /q src\color.obj
	del /f /q src\core.obj
	del /f /q src\cursor\arrow.obj
	del /f /q src\cursor\cross.obj
	del /f /q src\cursor\default.obj
	del /f /q src\cursor\hidden.obj
	del /f /q src\cursor\text.obj
	del /f /q src\default.obj
	del /f /q src\dialog\colorpicker.obj
	del /f /q src\dialog\directorychooser.obj
	del /f /q src\dialog\filechooser.obj
	del /f /q src\dialog\messagebox.obj
	del /f /q src\draw.obj
	del /f /q src\icon\back.obj
	del /f /q src\icon\clock.obj
	del /f /q src\icon\computer.obj
	del /f /q src\icon\directory.obj
	del /f /q src\icon\down.obj
	del /f /q src\icon\error.obj
	del /f /q src\icon\file.obj
	del /f /q src\icon\forward.obj
	del /f /q src\icon\info.obj
	del /f /q src\icon\left.obj
	del /f /q src\icon\news.obj
	del /f /q src\icon\note.obj
	del /f /q src\icon\right.obj
	del /f /q src\icon\search.obj
	del /f /q src\icon\up.obj
	del /f /q src\icon\warning.obj
	del /f /q src\lowlevel.obj
	del /f /q src\string.obj
	del /f /q src\text\font\boldfont.obj
	del /f /q src\text\font\boldmonottf.obj
	del /f /q src\text\font\boldttf.obj
	del /f /q src\text\font\font.obj
	del /f /q src\text\font\monottf.obj
	del /f /q src\text\font\ttf.obj
	del /f /q src\text\ft2.obj
	del /f /q src\text\gdi.obj
	del /f /q src\text\stbtt.obj
	del /f /q src\text\text.obj
	del /f /q src\truetype.obj
	del /f /q src\unicode.obj
	del /f /q src\widget\box.obj
	del /f /q src\widget\button.obj
	del /f /q src\widget\calendar.obj
	del /f /q src\widget\checkbox.obj
	del /f /q src\widget\combobox.obj
	del /f /q src\widget\entry.obj
	del /f /q src\widget\frame.obj
	del /f /q src\widget\image.obj
	del /f /q src\widget\label.obj
	del /f /q src\widget\listbox.obj
	del /f /q src\widget\menu.obj
	del /f /q src\widget\numberentry.obj
	del /f /q src\widget\opengl.obj
	del /f /q src\widget\progressbar.obj
	del /f /q src\widget\radiobox.obj
	del /f /q src\widget\scrollbar.obj
	del /f /q src\widget\separator.obj
	del /f /q src\widget\submenu.obj
	del /f /q src\widget\subwindow.obj
	del /f /q src\widget\tab.obj
	del /f /q src\widget\table.obj
	del /f /q src\widget\treeview.obj
	del /f /q src\widget\viewport.obj
	del /f /q src\widget\window.obj
	del /f /q src\Mw.dll
	del /f /q src\Mw.lib
	del /f /q examples\basic\box.obj
	del /f /q examples\basic\calculator.obj
	del /f /q examples\basic\checkbox.obj
	del /f /q examples\basic\clipboard.obj
	del /f /q examples\basic\colorpicker.obj
	del /f /q examples\basic\combobox.obj
	del /f /q examples\basic\example.obj
	del /f /q examples\basic\filechooser.obj
	del /f /q examples\basic\image.obj
	del /f /q examples\basic\listbox.obj
	del /f /q examples\basic\messagebox.obj
	del /f /q examples\basic\periodic.obj
	del /f /q examples\basic\progressbar.obj
	del /f /q examples\basic\radiobox.obj
	del /f /q examples\basic\rotate.obj
	del /f /q examples\basic\scrollbar.obj
	del /f /q examples\basic\sevensegment.obj
	del /f /q examples\basic\subwindow.obj
	del /f /q examples\basic\tab.obj
	del /f /q examples\basic\treeview.obj
	del /f /q examples\basic\viewport.obj
	del /f /q examples\gldemos\boing.obj
	del /f /q examples\gldemos\clock.obj
	del /f /q examples\gldemos\cube.obj
	del /f /q examples\gldemos\gears.obj
	del /f /q examples\gldemos\triangle.obj
	del /f /q examples\gldemos\tripaint.obj
	del /f /q examples\basic\box.exe
	del /f /q examples\basic\calculator.exe
	del /f /q examples\basic\checkbox.exe
	del /f /q examples\basic\clipboard.exe
	del /f /q examples\basic\colorpicker.exe
	del /f /q examples\basic\combobox.exe
	del /f /q examples\basic\example.exe
	del /f /q examples\basic\filechooser.exe
	del /f /q examples\basic\image.exe
	del /f /q examples\basic\listbox.exe
	del /f /q examples\basic\messagebox.exe
	del /f /q examples\basic\periodic.exe
	del /f /q examples\basic\progressbar.exe
	del /f /q examples\basic\radiobox.exe
	del /f /q examples\basic\rotate.exe
	del /f /q examples\basic\scrollbar.exe
	del /f /q examples\basic\sevensegment.exe
	del /f /q examples\basic\subwindow.exe
	del /f /q examples\basic\tab.exe
	del /f /q examples\basic\treeview.exe
	del /f /q examples\basic\viewport.exe
	del /f /q examples\gldemos\boing.exe
	del /f /q examples\gldemos\clock.exe
	del /f /q examples\gldemos\cube.exe
	del /f /q examples\gldemos\gears.exe
	del /f /q examples\gldemos\triangle.exe
	del /f /q examples\gldemos\tripaint.exe

examples\basic\box.exe: examples\basic\box.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\box.obj  src\Mw.lib

examples\basic\box.obj: examples/basic/box.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/box.c

examples\basic\calculator.exe: examples\basic\calculator.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\calculator.obj  src\Mw.lib

examples\basic\calculator.obj: examples/basic/calculator.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/calculator.c

examples\basic\checkbox.exe: examples\basic\checkbox.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\checkbox.obj  src\Mw.lib

examples\basic\checkbox.obj: examples/basic/checkbox.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/checkbox.c

examples\basic\clipboard.exe: examples\basic\clipboard.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\clipboard.obj  src\Mw.lib

examples\basic\clipboard.obj: examples/basic/clipboard.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/clipboard.c

examples\basic\colorpicker.exe: examples\basic\colorpicker.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\colorpicker.obj  src\Mw.lib

examples\basic\colorpicker.obj: examples/basic/colorpicker.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/colorpicker.c

examples\basic\combobox.exe: examples\basic\combobox.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\combobox.obj  src\Mw.lib

examples\basic\combobox.obj: examples/basic/combobox.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/combobox.c

examples\basic\example.exe: examples\basic\example.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\example.obj  src\Mw.lib

examples\basic\example.obj: examples/basic/example.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/example.c

examples\basic\filechooser.exe: examples\basic\filechooser.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\filechooser.obj  src\Mw.lib

examples\basic\filechooser.obj: examples/basic/filechooser.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/filechooser.c

examples\basic\image.exe: examples\basic\image.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\image.obj  src\Mw.lib

examples\basic\image.obj: examples/basic/image.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/image.c

examples\basic\listbox.exe: examples\basic\listbox.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\listbox.obj  src\Mw.lib

examples\basic\listbox.obj: examples/basic/listbox.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/listbox.c

examples\basic\messagebox.exe: examples\basic\messagebox.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\messagebox.obj  src\Mw.lib

examples\basic\messagebox.obj: examples/basic/messagebox.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/messagebox.c

examples\basic\periodic.exe: examples\basic\periodic.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\periodic.obj  src\Mw.lib

examples\basic\periodic.obj: examples/basic/periodic.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/periodic.c

examples\basic\progressbar.exe: examples\basic\progressbar.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\progressbar.obj  src\Mw.lib

examples\basic\progressbar.obj: examples/basic/progressbar.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/progressbar.c

examples\basic\radiobox.exe: examples\basic\radiobox.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\radiobox.obj  src\Mw.lib

examples\basic\radiobox.obj: examples/basic/radiobox.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/radiobox.c

examples\basic\rotate.exe: examples\basic\rotate.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\rotate.obj  src\Mw.lib

examples\basic\rotate.obj: examples/basic/rotate.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/rotate.c

examples\basic\scrollbar.exe: examples\basic\scrollbar.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\scrollbar.obj  src\Mw.lib

examples\basic\scrollbar.obj: examples/basic/scrollbar.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/scrollbar.c

examples\basic\sevensegment.exe: examples\basic\sevensegment.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\sevensegment.obj  src\Mw.lib

examples\basic\sevensegment.obj: examples/basic/sevensegment.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/sevensegment.c

examples\basic\subwindow.exe: examples\basic\subwindow.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\subwindow.obj  src\Mw.lib

examples\basic\subwindow.obj: examples/basic/subwindow.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/subwindow.c

examples\basic\tab.exe: examples\basic\tab.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\tab.obj  src\Mw.lib

examples\basic\tab.obj: examples/basic/tab.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/tab.c

examples\basic\treeview.exe: examples\basic\treeview.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\treeview.obj  src\Mw.lib

examples\basic\treeview.obj: examples/basic/treeview.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/treeview.c

examples\basic\viewport.exe: examples\basic\viewport.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\basic\viewport.obj  src\Mw.lib

examples\basic\viewport.obj: examples/basic/viewport.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/basic/viewport.c

examples\gldemos\boing.exe: examples\gldemos\boing.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\boing.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\boing.obj: examples/gldemos/boing.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/boing.c

examples\gldemos\clock.exe: examples\gldemos\clock.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\clock.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\clock.obj: examples/gldemos/clock.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/clock.c

examples\gldemos\cube.exe: examples\gldemos\cube.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\cube.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\cube.obj: examples/gldemos/cube.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/cube.c

examples\gldemos\gears.exe: examples\gldemos\gears.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\gears.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\gears.obj: examples/gldemos/gears.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/gears.c

examples\gldemos\triangle.exe: examples\gldemos\triangle.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\triangle.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\triangle.obj: examples/gldemos/triangle.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/triangle.c

examples\gldemos\tripaint.exe: examples\gldemos\tripaint.obj src\Mw.dll
	$(LD) $(EXE_LDFLAGS) /OUT:$@ examples\gldemos\tripaint.obj  src\Mw.lib opengl32.lib glu32.lib

examples\gldemos\tripaint.obj: examples/gldemos/tripaint.c
	$(CC) $(EXE_CFLAGS) /Fo$@ examples/gldemos/tripaint.c


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\gdi.obj src\text\stbtt.obj src\text\text.obj src\truetype.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\calendar.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\subwindow.obj src\widget\tab.obj src\widget\table.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj
	$(LD) $(MW_LDFLAGS)  /OUT:$@  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\gdi.obj src\text\stbtt.obj src\text\text.obj src\truetype.obj src\unicode.obj src\widget\box.obj src\widget\button.obj src\widget\calendar.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\subwindow.obj src\widget\tab.obj src\widget\table.obj src\widget\treeview.obj src\widget\viewport.obj src\widget\window.obj  opengl32.lib gdi32.lib winmm.lib user32.lib advapi32.lib
	

.c.obj:
	$(CC) $(MW_CFLAGS) /Fo$@ $<
