!include makewat.env
-# the name of the file containing the objects to be put in the library
-LNK = tmp.lbc
+all: $(OUTPUTDIR) $(LIBTARGET)
-all: $(LIBTARGET)
+$(OUTPUTDIR):
+ @if not exist $^@ mkdir $^@
+# the name of the file containing the objects to be put in the library
+LBCFILE=$(OUTPUTDIR)$(LIBTARGET).lbc
$(LIBTARGET) : $(OBJECTS)
- %create $(LNK)
- @for %i in ( $(OBJECTS) ) do @%append $(LNK) +%i
- wlib /b /c /n /p=512 $^@ @$(LNK)
+ %create $(LBCFILE)
+ @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
+ $(LIB) /b /c /n /p=512 $^@ @$(LBCFILE)
clean: .SYMBOLIC
- -erase *.obj
- -erase *.bak
- -erase *.err
- -erase *.pch
- -erase *.lib
- -erase *.lbc
- -erase *.res
- -erase *.exe
- -erase *.lbc
+ -erase $(OUTPUTDIR)*.obj
+ -erase $(OUTPUTDIR)*.bak
+ -erase $(OUTPUTDIR)*.err
+ -erase $(OUTPUTDIR)*.pch
+ -erase $(OUTPUTDIR)*.lib
+ -erase $(OUTPUTDIR)*.lbc
+ -erase $(OUTPUTDIR)*.res
+ -erase $(OUTPUTDIR)*.exe
+ -erase $(OUTPUTDIR)*.lbc
-erase $(LIBTARGET)
ARCHINCDIR=$(WXDIR)\lib\$(TOOLKIT)$(DEBUGSUFFIX)
+# set the things which depend on debug/release
+#
+# note that the values for LIBPAGESIZE are minimal possible, the library
+# doesn't link (Error! Library too large) with values smaller than given
!ifeq FINAL 1
CONFIGURATION=Release
+LIBPAGESIZE=/p=1024
!else
CONFIGURATION=Debug
+LIBPAGESIZE=/p=2048
!endif
# set OUTPUTDIR to the directory to be used for the .obj files created during
LEVEL = 386
CXX = wpp$(LEVEL)
CC = wcc$(LEVEL)
+LIB = wlib /q
RC = wrc
WINVERFLAGS = /dWINVER=0x400
BINDCOMMAND = wrc
$(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
copy $(WXDIR)\include\wx\msw\setup.h $@
-LBCFILE=wx$(TOOLKIT).lbc
+LBCFILE=$(OUTPUTDIR)wx$(TOOLKIT).lbc
$(LIBTARGET) : $(OBJECTS)
%create $(LBCFILE)
@for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
- wlib /b /c /n /p=512 $^@ @$(LBCFILE)
+ $(LIB) /b /c /n $(LIBPAGESIZE) $^@ @$(LBCFILE)
clean: .SYMBOLIC $(EXTRATARGETSCLEAN)