X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7be1f0d91a912a73b110157170124830446e15e1..4c200e8d87728306b219822d9c07e28526cd8649:/src/makeprog.wat?ds=inline diff --git a/src/makeprog.wat b/src/makeprog.wat index 0a1784aa5d..81b497a128 100644 --- a/src/makeprog.wat +++ b/src/makeprog.wat @@ -3,30 +3,49 @@ WXDIR = $(%WXWIN) !include $(WXDIR)\src\makewat.env WXLIB = $(WXDIR)\lib -LNK = $(PROGRAM).lnk +LNK = $(OUTPUTDIR)$(PROGRAM).lnk -all: $(PROGRAM).exe +all: $(OUTPUTDIR) $(OUTPUTDIR)$(PROGRAM).exe $(EXTRATARGETS) .SYMBOLIC -$(PROGRAM).exe : $(OBJECTS) $(PROGRAM).res $(LNK) $(WXLIB)\wx.lib +$(OUTPUTDIR): + @if not exist $^@ mkdir $^@ + +!ifeq wxUSE_GUI 0 +RESFILE= +!else +RESFILE=$(OUTPUTDIR)$(PROGRAM).res +!endif + +$(OUTPUTDIR)$(PROGRAM).exe : $(OBJECTS) $(RESFILE) $(LNK) $(WXLIB)\$(LIBNAME).lib wlink @$(LNK) - $(BINDCOMMAND) $(PROGRAM).res +!ifneq wxUSE_GUI 0 + $(BINDCOMMAND) $(RESFILE) +!endif -$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc - $(RC) $(RESFLAGS1) $(PROGRAM).rc +!ifneq wxUSE_GUI 0 +$(RESFILE): $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc + $(RC) $(RESFLAGS) /fo=$(RESFILE) $(PROGRAM).rc +!endif $(LNK) : makefile.wat %create $(LNK) - @%append $(LNK) debug all + @%append $(LNK) $(DEBUGINFO) @%append $(LNK) system $(LINKOPTION) @%append $(LNK) $(STACK) - @%append $(LNK) name $(PROGRAM).exe - @%append $(LNK) file $(WXLIB)\wx.lib + @%append $(LNK) name $(OUTPUTDIR)$(PROGRAM).exe @for %i in ($(OBJECTS)) do @%append $(LNK) file %i - -# @for %i in ($(EXTRALIBS)) do @%append $(LNK) file %i -# @%append $(LNK) $(MINDATA) -# @%append $(LNK) $(MAXDATA) + @for %i in ($(LIBS)) do @%append $(LNK) lib %i + @for %i in ($(EXTRALIBS)) do @%append $(LNK) lib %i clean: .SYMBOLIC - -erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe + -erase $(OUTPUTDIR)*.obj + -erase $(OUTPUTDIR)*.bak + -erase $(OUTPUTDIR)*.err + -erase $(OUTPUTDIR)*.pch + -erase $(OUTPUTDIR)*.lib + -erase $(LNK) + -erase $(OUTPUTDIR)*.res + -erase $(OUTPUTDIR)*.exe + -erase $(OUTPUTDIR)*.lbc + -rmdir $(OUTPUTDIR)