# 16 october 2015 # TODO silence compiler non-diagnostics (/nologo is not enough) OBJDIR = .obj OUTDIR = out NAME = libui SUFFIX = .dll HFILES += \ ui.h \ ui_windows.h CFILES += \ common/areaevents.c \ common/control.c \ common/matrix.c \ common/menu.c \ common/ptrarray.c \ common/shouldquit.c \ common/types.c HFILES += \ common/uipriv.h CFILES += \ windows/alloc.c \ windows/area.c \ windows/box.c \ windows/button.c \ windows/checkbox.c \ windows/child.c \ windows/combobox.c \ windows/container.c \ windows/control.c \ windows/datetimepicker.c \ windows/debug.c \ windows/dialoghelper.c \ windows/draw.c \ windows/entry.c \ windows/events.c \ windows/group.c \ windows/init.c \ windows/label.c \ windows/main.c \ windows/menu.c \ windows/parent.c \ windows/progressbar.c \ windows/radiobuttons.c \ windows/resize.c \ windows/separator.c \ windows/slider.c \ windows/spinbox.c \ windows/stddialogs.c \ windows/tab.c \ windows/tabpage.c \ windows/text.c \ windows/util.c \ windows/utilwin.c \ windows/window.c HFILES += \ windows/compilerver.h \ windows/resources.h \ windows/uipriv_windows.h \ windows/winapi.h RCFILES += \ windows/resources.rc OFILES = \ $(subst /,_,$(CFILES)) \ $(subst /,_,$(RCFILES)) OFILES := $(OFILES:%=$(OBJDIR)/%.o) # TODO /Wall does too much # TODO -Wno-switch equivalent # TODO /sdl turns C4996 into an ERROR # TODO loads of warnings in the system header files CFLAGS += \ /Zi \ /W4 \ /wd4100 \ /TC \ /analyze /bigobj /nologo \ /RTC1 /RTCc /RTCs /RTCu \ /D "_UI_EXTERN=__declspec(dllexport) extern" # TODO warnings on undefined symbols LDFLAGS += \ /dll \ /debug \ /largeaddressaware /nologo \ user32.lib kernel32.lib gdi32.lib comctl32.lib uxtheme.lib msimg32.lib comdlg32.lib d2d1.lib ole32.lib oleaut32.lib oleacc.lib uuid.lib OUT = $(OUTDIR)/$(NAME)$(SUFFIX) $(OUT): $(OFILES) | $(OUTDIR) @link /out:$(OUT) $(OFILES) $(LDFLAGS) @echo ====== Linked $(OUT) .SECONDEXPANSION: $(OBJDIR)/%.c.o: $$(subst _,/,%).c $(HFILES) | $(OBJDIR) @cl /Fo:$@ /c $< $(CFLAGS) /Fd$@.pdb @echo ====== Compiled $< # unfortunately rc.exe does not support / as a pathname specifier $(OBJDIR)/%.rc.o: $$(subst _,/,%).rc $(HFILES) | $(OBJDIR) @rc /nologo /v /fo $@.res $< @cvtres /nologo /out:$@ $@.res @echo ====== Compiled $< $(OBJDIR) $(OUTDIR): @mkdir $@