view makefile.vc @ 839:ccfa5173659f

Initial implementation of scrollboxes on Windows. Windows does not have a scrolledview/area widget like on other platforms, so I have created one. Implemented the layout system like I did on MacOS and discovered what likely is the issue on the Mac. There seems to be a bug in the layout system which is avoided by packing into a single expandable box. When used and padding are exactly the same, the layout engine drops out to prevent a divide by zero. Will look into fixing this in the layout engine, but for now using the container box workaround. The scrolled view widget is not finished, will need to implement the scrollbars but internally.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 29 Mar 2011 17:21:50 +0000
parents b28ec71cfc88
children 3e393a9375c4
line wrap: on
line source

#
# Visual C Makefile for Dynamic Windows
#
VER = 11
VERDOT = 1.1

#
# Setup the source and destination directories
#
!if "$(DWINDOWS_SRCDIR)" == ""
SRCDIR=.
!else
SRCDIR=$(DWINDOWS_SRCDIR)
!endif

!if "$(DWLIBDIR)" == ""
DWLIBDIR=.\lib
!endif

!if "$(DWDLLDIR)" == ""
DWDLLDIR=.\dll
!endif

#
# Configure settings for the target platform
#	Default to x86 if not specified
#
!if "$(TARGET_CPU)" == ""
TARGET_CPU=x86
!endif

!if "$(TARGET_CPU)" == "x86"
PLATFORM_DEF = -DWIN32
!else
PLATFORM_DEF = -DWIN64
!endif

#
# Settings for either debug or release
#
!if "$(DEBUG)" == "Y"
CFLAGS_DEBUG = -DDEBUG -Z7 -Od -MTd # was -Zi
LINK_DEBUG = -debug
!else
CFLAGS_DEBUG = -Ox -MT
LINK_DEBUG = -release
!endif

CC = cl
CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DBUILD_DLL -I$(SRCDIR)\platform -I$(SRCDIR)
LIBS = wsock32.lib kernel32.lib user32.lib comctl32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib ole32.lib oleaut32.lib
RES =
LINKFLAGS = -machine:$(TARGET_CPU) -manifest $(LINK_DEBUG)
DLLLINKFLAGS = -dll
LINK = link
DEFFILE = $(SRCDIR)\dww.def
DEFFILE2 = $(SRCDIR)\dwcompatw.def

OBJS = dw.obj browser.obj XBrowseForFolder.obj

OBJS2 = compat.obj dirent.obj

all: dw dwcompat dwtest

clean:
	-erase *.dll
        -erase *.exe
        -erase *.opt
        -erase *.lib
        -erase *.obj
        -erase *.map
        -erase *.pdb
        -erase *.ilk
        -erase *.exp
        -erase *~

dw: dw.dll

dw.dll: $(OBJS) $(DEFFILE)
	-mkdir $(DWLIBDIR)
	-mkdir $(DWDLLDIR)
	$(LINK) @<<
-out:$(@) -def:$(DEFFILE)
$(LINKFLAGS) $(DLLLINKFLAGS)
$(OBJS) $(RES)
$(LIBS)
<<
	lib /def:$(DEFFILE) /out:dw.lib
	mt.exe /manifest dw.dll.manifest win\dw.dll.$(TARGET_CPU).manifest /outputresource:dw.dll;2
        copy dw.lib $(DWLIBDIR)\dw.lib
        copy dw.dll $(DWDLLDIR)\dw.dll

dwcompat: dwcompat.dll

dwcompat.dll: $(OBJS2) $(DEFFILE2)
	$(LINK) @<<
-out:$(@) -def:$(DEFFILE2)
$(LINKFLAGS) $(DLLLINKFLAGS)
$(OBJS2) $(RES)
$(LIBS)
<<
	lib /def:$(DEFFILE2) /out:dwcompat.lib
	mt.exe /manifest dwcompat.dll.manifest /outputresource:dwcompat.dll;2
        copy dwcompat.lib $(DWLIBDIR)\dwcompat.lib
        copy dwcompat.dll $(DWDLLDIR)\dwcompat.dll

dw.obj: $(SRCDIR)\win\dw.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dw.c

browser.obj: $(SRCDIR)\win\browser.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\browser.c

XBrowseForFolder.obj: $(SRCDIR)\win\XBrowseForFolder.cpp
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\XBrowseForFolder.cpp

dirent.obj: $(SRCDIR)\win\dirent.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dirent.c

compat.obj: $(SRCDIR)\compat.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\compat.c

dwtest.obj: $(SRCDIR)\dwtest.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwtest.c

dwtest: dwtest.exe

dwtest.exe: dwtest.obj winmain.obj
	$(LINK) $(LINKFLAGS) /out:dwtest.exe dwtest.obj winmain.obj /subsystem:windows $(DWLIBDIR)\dwcompat.lib $(DWLIBDIR)\dw.lib $(LIBS)
	mt.exe /manifest dwtest.exe.manifest win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtest.exe;1

zip: dw.dll
	copy win\readme-win.txt .
	zip dwindows-win32-$(VERDOT).zip readme-win.txt dw.dll dwcompat.dll dw.lib dwcompat.lib dw.h