Skip to content

Commit

Permalink
patches around config.h; improved "[n]make install" target
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Johnson committed Sep 28, 2012
1 parent 40847f0 commit e91d2cd
Show file tree
Hide file tree
Showing 172 changed files with 1,104 additions and 624 deletions.
2 changes: 1 addition & 1 deletion Bmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OPTIM = /O2
RC = brcc32
RCFLAGS = -i.

CFLAGS = /q /I. /D_WIN32_WINNT=0x400 /DHAVE_PTW32_CONFIG_H=1 /4 /tWD /tWM \
CFLAGS = /q /I. /DHAVE_CONFIG_H=1 /4 /tWD /tWM \
/w-aus /w-asc /w-par

#C cleanup code
Expand Down
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2012-09-28 Daniel Richard. G <danielg at teragram dot com>

* all: #include<config.h>; renamed HAVE_PTW32_CONFIG_H define in
build files to HAVE_CONFIG_H since we no longer need a
uniquely-named symbol for this.
* Bmakefile: Removed _WIN32_WINNT assignment from build files since
this is now handled in source.
* Wmakefile: Likewise.
* Makefile: Added mkdir invocations to "install" target.
* common.mk: Elaborated the pthread.$(OBJEXT) dependency list.
* pthread.h: Removed the #include"config.h" bit.

2012-09-23 Ross Johnson <ross dot johnson at homemail dot com dot au>

* GNUmakefile: Modify "all-tests" to use new targets in tests
Expand Down
35 changes: 30 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,31 @@
DLL_VER = 2
DLL_VERD= $(DLL_VER)d

DEVROOT = C:\PTHREADS

DLLDEST = $(DEVROOT)\DLL
LIBDEST = $(DEVROOT)\DLL
DESTROOT = ../PTHREADS-BUILT
DEST_LIB_NAME = libpthread.a
DLLDEST = $(DESTROOT)/bin
LIBDEST = $(DESTROOT)/lib
HDRDEST = $(DESTROOT)/include

# If Running MsysDTK
RM = rm -f
MV = mv -f
CP = cp -f
MKDIR = mkdir -p
ECHO = echo
TESTNDIR = test ! -d
TESTFILE = test -f
AND = &&

# If not.
#RM = erase
#MV = rename
#CP = copy
#MKDIR = mkdir
#ECHO = echo
#TESTNDIR = if exist
#TESTFILE = if exist
# AND =

# For cross compiling use e.g.
# make CROSS=x86_64-w64-mingw32- clean GC-inlined
Expand Down Expand Up @@ -108,7 +117,7 @@ GCE_CFLAGS = $(PTW32_FLAGS) -mthreads

## Mingw
#MAKE ?= make
CFLAGS = $(OPT) $(XOPT) -I. -DHAVE_PTW32_CONFIG_H -Wall
CFLAGS = $(OPT) $(XOPT) -I. -DHAVE_CONFIG_H -Wall

OBJEXT = o
RESEXT = o
Expand Down Expand Up @@ -220,6 +229,22 @@ tests:
@ cd tests
@ $(MAKE) auto

# Very basic install. It assumes "realclean" was done just prior to build target if
# you want the installed $(DEVDEST_LIB_NAME) to match that build.
install:
-$(TESTNDIR) $(DLLDEST) $(AND) $(MKDIR) $(DLLDEST)
-$(TESTNDIR) $(LIBDEST) $(AND) $(MKDIR) $(LIBDEST)
-$(TESTNDIR) $(HDRDEST) $(AND) $(MKDIR) $(HDRDEST)
$(CP) pthreadGC*.dll $(DLLDEST)
$(CP) libpthreadGC*.a $(LIBDEST)
$(CP) pthread.h $(HDRDEST)
$(CP) sched.h $(HDRDEST)
$(CP) semaphore.h $(HDRDEST)
-$(TESTFILE) libpthreadGC$(DLL_VER).a $(AND) $(CP) libpthreadGC$(DLL_VER).a $(LIBDEST)/$(DEST_LIB_NAME)
-$(TESTFILE) libpthreadGC$(DLL_VERD).a $(AND) $(CP) libpthreadGC$(DLL_VERD).a $(LIBDEST)/$(DEST_LIB_NAME)
-$(TESTFILE) libpthreadGCE$(DLL_VER).a $(AND) $(CP) libpthreadGCE$(DLL_VER).a $(LIBDEST)/$(DEST_LIB_NAME)
-$(TESTFILE) libpthreadGCE$(DLL_VERD).a $(AND) $(CP) libpthreadGCE$(DLL_VERD).a $(LIBDEST)/$(DEST_LIB_NAME)

%.pre: %.c
$(CC) -E -o $@ $(CFLAGS) $^

Expand Down
27 changes: 19 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
DLL_VER = 2
DLL_VERD= $(DLL_VER)d

DEVROOT = C:\pthreads
DESTROOT = ..\PTHREADS-BUILT
DEST_LIB_NAME = pthread.lib

DLLDEST = $(DEVROOT)\dll
LIBDEST = $(DEVROOT)\lib
HDRDEST = $(DEVROOT)\include
DLLDEST = $(DESTROOT)\bin
LIBDEST = $(DESTROOT)\lib
HDRDEST = $(DESTROOT)\include

DLLS = pthreadVCE$(DLL_VER).dll pthreadVSE$(DLL_VER).dll pthreadVC$(DLL_VER).dll \
pthreadVCE$(DLL_VERD).dll pthreadVSE$(DLL_VERD).dll pthreadVC$(DLL_VERD).dll
Expand All @@ -25,7 +26,7 @@ SMALL_STATIC_STAMPS = pthreadVCE$(DLL_VER).small_stamp pthreadVSE$(DLL_VER).smal
pthreadVCE$(DLL_VERD).small_stamp pthreadVSE$(DLL_VERD).small_stamp pthreadVC$(DLL_VERD).small_stamp

CC = cl
CPPFLAGS = /I. /DHAVE_PTW32_CONFIG_H
CPPFLAGS = /I. /DHAVE_CONFIG_H
XCFLAGS = /W3 /MD /nologo
CFLAGS = /O2 /Ob2 $(XCFLAGS)
CFLAGSD = /Z7 $(XCFLAGS)
Expand Down Expand Up @@ -236,13 +237,23 @@ clean:
if exist *.i del *.i
if exist *.res del *.res


# Very basic install. It assumes "realclean" was done just prior to build target if
# you want the installed $(DEVDEST_LIB_NAME) to match that build.
install:
if exist pthread*.dll copy pthread*.dll $(DLLDEST)
copy pthread*.lib $(LIBDEST)
if not exist $(DLLDEST) mkdir $(DLLDEST)
if not exist $(LIBDEST) mkdir $(LIBDEST)
if not exist $(HDRDEST) mkdir $(HDRDEST)
copy pthreadV*.dll $(DLLDEST)
copy pthreadV*.lib $(LIBDEST)
copy pthread.h $(HDRDEST)
copy sched.h $(HDRDEST)
copy semaphore.h $(HDRDEST)
if exist pthreadVC$(DLL_VER).lib copy pthreadVC$(DLL_VER).lib $(LIBDEST)\$(DEST_LIB_NAME)
if exist pthreadVC$(DLL_VERD).lib copy pthreadVC$(DLL_VERD).lib $(LIBDEST)\$(DEST_LIB_NAME)
if exist pthreadVCE$(DLL_VER).lib copy pthreadVCE$(DLL_VER).lib $(LIBDEST)\$(DEST_LIB_NAME)
if exist pthreadVCE$(DLL_VERD).lib copy pthreadVCE$(DLL_VERD).lib $(LIBDEST)\$(DEST_LIB_NAME)
if exist pthreadVSE$(DLL_VER).lib copy pthreadVSE$(DLL_VER).lib $(LIBDEST)\$(DEST_LIB_NAME)
if exist pthreadVSE$(DLL_VERD).lib copy pthreadVSE$(DLL_VERD).lib $(LIBDEST)\$(DEST_LIB_NAME)

$(DLLS): $(DLL_OBJS)
$(CC) /LDd /Zi /nologo $(DLL_OBJS) /link /implib:$*.lib $(XLIBS) /out:$@
Expand Down
8 changes: 4 additions & 4 deletions Nmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* nmake file for uwin pthread library
*/

VERSION = -
CCFLAGS = -V -g $(CC.DLL)
HAVE_PTW32_CONFIG_H == 1
_MT == 1
VERSION = -
CCFLAGS = -V -g $(CC.DLL)
HAVE_CONFIG_H == 1
_MT == 1
_timeb == timeb
_ftime == ftime
_errno == _ast_errno
Expand Down
4 changes: 4 additions & 0 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "pthread.h"
#include "implement.h"

Expand Down
4 changes: 4 additions & 0 deletions autostatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "pthread.h"
#include "implement.h"

Expand Down
4 changes: 4 additions & 0 deletions barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "pthread.h"
#include "implement.h"

Expand Down
4 changes: 2 additions & 2 deletions builddmc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set DMCDIR=c:\dm

; RELEASE
%DMCDIR%\bin\dmc -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/NODEBUG -L/SU:WINDOWS
%DMCDIR%\bin\dmc -D_MT -DHAVE_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/NODEBUG -L/SU:WINDOWS

; DEBUG
%DMCDIR%\bin\dmc -g -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:WINDOWS
%DMCDIR%\bin\dmc -g -D_MT -DHAVE_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:WINDOWS
4 changes: 4 additions & 0 deletions cancel.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "pthread.h"
#include "implement.h"

Expand Down
4 changes: 4 additions & 0 deletions cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "pthread.h"
#include "implement.h"

Expand Down
Loading

0 comments on commit e91d2cd

Please sign in to comment.