aboutsummaryrefslogtreecommitdiff
path: root/pthreads
diff options
context:
space:
mode:
Diffstat (limited to 'pthreads')
-rw-r--r--pthreads/.gitignore3
-rwxr-xr-x[-rw-r--r--]pthreads/Makefile25
-rwxr-xr-xpthreads/common.mk13
3 files changed, 31 insertions, 10 deletions
diff --git a/pthreads/.gitignore b/pthreads/.gitignore
new file mode 100644
index 000000000..e258bf9d0
--- /dev/null
+++ b/pthreads/.gitignore
@@ -0,0 +1,3 @@
+pthreadVC2.inlined_static_stamp
+pthreadVC2d.inlined_static_stamp
+
diff --git a/pthreads/Makefile b/pthreads/Makefile
index e13341751..bd8e82662 100644..100755
--- a/pthreads/Makefile
+++ b/pthreads/Makefile
@@ -26,9 +26,10 @@ SMALL_STATIC_STAMPS = pthreadVCE$(DLL_VER).small_static_stamp pthreadVSE$(DLL_V
CC = cl
CPPFLAGS = /I. /DHAVE_CONFIG_H
-XCFLAGS = /W3 /MD /nologo
-CFLAGS = /O2 /Ob2 $(XCFLAGS)
-CFLAGSD = /Z7 $(XCFLAGS)
+XCFLAGS = /W3 /Zi /Gy /GF /nologo
+CFLAGS = /O2 /Ob2 /Oi /Ox /Oy /Ot /MD /GL $(XCFLAGS)
+CFLAGSD = /MDd $(XCFLAGS)
+
# Uncomment this if config.h defines RETAIN_WSALASTERROR
#XLIBS = wsock32.lib
@@ -50,7 +51,7 @@ VCFLAGSD = $(CPPFLAGS) $(CFLAGSD)
OBJEXT = obj
RESEXT = res
-
+
include common.mk
DLL_OBJS = $(DLL_OBJS) $(RESOURCE_OBJS)
@@ -176,7 +177,7 @@ VC-static:
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGS) /DPTW32_STATIC_LIB /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VER).inlined_static_stamp
VC-static-debug:
- @ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGSD) /DPTW32_STATIC_LIB /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VERD).inlined_static_stamp
+ @ $(MAKE) /E /nologo DEBUG=1 EHFLAGS="$(VCFLAGSD) /DPTW32_STATIC_LIB /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VERD).inlined_static_stamp
realclean: clean
@@ -219,19 +220,25 @@ install:
$(DLLS): $(DLL_OBJS)
$(CC) /LDd /Zi /nologo $(DLL_OBJS) /link /implib:$*.lib $(XLIBS) /out:$@
-$(INLINED_STATIC_STAMPS): $(DLL_OBJS)
+$(INLINED_STATIC_STAMPS): $(OUTDIR) $(DLL_OBJS)
if exist $*.lib del $*.lib
- lib $(DLL_OBJS) /out:$*.lib
+ lib /LTCG $(DLL_OBJS) /out:$*$(SUFFIX).lib
echo. >$@
-$(SMALL_STATIC_STAMPS): $(STATIC_OBJS)
+$(SMALL_STATIC_STAMPS): $(OUTDIR) $(STATIC_OBJS)
if exist $*.lib del $*.lib
- lib $(STATIC_OBJS) /out:$*.lib
+ lib /LTCG $(STATIC_OBJS) /out:$*$(SUFFIX).lib
echo. >$@
+$(OUTDIR):
+ mkdir $(OUTDIR)
+
.c.obj:
$(CC) $(EHFLAGS) /D$(CLEANUP) -c $<
+.c{$(OUTDIR)}.obj:
+ $(CC) $(EHFLAGS) /D$(CLEANUP) -Fo"$@" -c $<
+
# TARGET_CPU is an environment variable set by Visual Studio Command Prompt
# as provided by the SDK
.rc.res:
diff --git a/pthreads/common.mk b/pthreads/common.mk
index da26f719e..86ac3f706 100755
--- a/pthreads/common.mk
+++ b/pthreads/common.mk
@@ -1,11 +1,22 @@
# Common makefile definitions
+!ifdef IS64
+SUFFIX=64
+!else
+SUFFIX=
+!endif
+
+!ifdef DEBUG
+OUTDIR=obj$(SUFFIX)_d
+!else
+OUTDIR=obj$(SUFFIX)
+!endif
RESOURCE_OBJS = \
version.$(RESEXT)
# pthread.c aggregates all source into a single compilation unit for inlinability
DLL_OBJS = \
- pthread.$(OBJEXT)
+ $(OUTDIR)\pthread.$(OBJEXT)
# Separate modules for minimising the size of statically linked images
STATIC_OBJS = \