more windows (msvc) build fixes

This commit is contained in:
Dan Mills 2008-05-14 17:15:55 -07:00
parent 779a934ce3
commit 9535362dc5

View File

@ -59,7 +59,6 @@ else
compiler = msvc
cxx = cl
so = dll
# cppflags += -LD
else
$(error Sorry, your os is unknown/unsupported: $(sys))
endif
@ -132,9 +131,18 @@ libs := xpcomglue_s xpcom nspr4 \
ifeq ($(compiler),msvc)
libdirs := $(patsubst %,-LIBPATH:%,$(libdirs))
libs := $(patsubst %,$(sdkdir)/lib/%.lib,$(libs))
cppflags += -c -nologo -O1 -GR- -TP -nologo -Zc:wchar_t- -W3 -Gy $(headers)
ldflags += -DLL -NOLOGO -SUBSYSTEM:WINDOWS $(libdirs) $(libs) kernel32.lib \
user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib
cppflags += -c -nologo -O1 -GR- -TP -MT -Zc:wchar_t- -W3 -Gy $(headers) \
-DNDEBUG -DTRIMMED -D_CRT_SECURE_NO_DEPRECATE=1 \
-D_CRT_NONSTDC_NO_DEPRECATE=1 -DWINVER=0x500 -D_WIN32_WINNT=0x500 \
-D_WIN32_IE=0x0500 -DX_DISPLAY_MISSING=1 -DMOZILLA_VERSION=\"1.9pre\" \
-DMOZILLA_VERSION_U=1.9pre -DHAVE_SNPRINTF=1 -D_WINDOWS=1 -D_WIN32=1 \
-DWIN32=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -DSTDC_HEADERS=1 \
-DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -DHAVE_MMINTRIN_H=1 \
-DHAVE_OLEACC_IDL=1 -DHAVE_ATLBASE_H=1 -DHAVE_WPCAPI_H=1 -D_X86_=1 \
-DD_INO=d_ino
ldflags += -DLL -NOLOGO -SUBSYSTEM:WINDOWS -NXCOMPAT -SAFESEH -IMPLIB:fake.lib \
$(libdirs) $(libs) \
kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib
rcflags := -r $(headers)
else
libdirs := $(patsubst %,-L%,$(libdirs))
@ -177,7 +185,7 @@ test-install: install
rm -f $(sdkdir)/bin/components/xpti.dat
clean:
rm -f $(so_target) $(cpp_objects) $(idl_typelib) $(idl_headers)
rm -f $(so_target) $(cpp_objects) $(idl_typelib) $(idl_headers) $(target:=.res) fake.lib fake.exp
# rules to build the c headers and .xpt from idl
@ -203,7 +211,7 @@ endif
$(so_target): $(idl_headers) $(cpp_objects) $(target:=.res)
ifeq ($(compiler),msvc)
link -out:$@ $(ldflags) $(cpp_objects)
link -OUT:$@ -PDB:$(@:.dll=.pdb) $(cpp_objects) $(target:=.res) $(ldflags)
else
$(cxx) -o $@ $(ldflags) $(cpp_objects)
endif