Commit 65657716 authored by thomas's avatar thomas
Browse files

updated make system for BCC

git-svn-id: https://svn.grrrr.org/ext/trunk@898 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent fbc2d5cd
@echo --- Building flext with BorlandC++ ---
make -f makefile.pd-bcc
make -f makefile.pd-bcc %1 %2 %3 %4 %5 %6 %7 %8 %9
......@@ -7,7 +7,7 @@ LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib
!endif
LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ
CFLAGS=$(CFLAGS) -tWD -tWM
CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057
LDFLAGS=$(LDFLAGS) /C /Tpd
##############################################
......
......@@ -22,6 +22,3 @@ OUTPATH=.\pd-bcc
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=$(PDPATH)\flext
SRCDIR=source
SRCS= \
flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp \
flxlet.cpp flattr.cpp flattr_ed.cpp flsupport.cpp \
......
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (gr@grrrr.org)
#
# Makefile for BorlandC++
#
# usage: make -f makefile.bcc
!include config-pd-bcc.txt
TARGET=pdwin # appendix to lib name
# includes
INCPATH=-I$(BCCPATH)\include -I$(PDPATH)\src -I$(SRCDIR)
# compiler definitions and flags
DEFS=-DFLEXT_SYS=2
CFLAGS=-tWD
!ifdef DEBUG
CFLAGS=$(CFLAGS) -v
DEFS=$(DEFS) -DFLEXT_DEBUG
!else
CFLAGS=$(CFLAGS) -6 -O2 -OS -ff
!endif
!ifdef THREADED
CFLAGS=$(CFLAGS) -tWM
DEFS=$(DEFS) -DFLEXT_THREADS
!endif
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
!include make-files.txt
!ifdef SNDOBJ
INCPATH=$(INCPATH) -I$(SNDOBJ)
SRCS=$(SRCS) $(SRCS_SNDOBJ)
HDRS=$(HDRS) $(HDRS_SNDOBJ)
!endif
!ifdef STK
INCPATH=$(INCPATH) -I$(STK)
SRCS=$(SRCS) $(SRCS_STK)
HDRS=$(HDRS) $(HDRS_STK)
!endif
TARGET=$(OUTPATH)\$(NAME)-$(TARGET).lib
#default target
all: $(OUTPATH) $(TARGET)
# remove build
clean:
-del /s /q $(OUTPATH) > nul
rmdir $(OUTPATH)
# -----------------------------------------------
OBJS= $(SRCS:.cpp=.obj)
#.PATH.obj=$(OUTPATH)
DIR="/"
{$(SRCDIR)}.cpp.obj:
bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(OUTPATH) $<
$(OUTPATH):
@-if not exist $< mkdir $<
$(TARGET): $(OBJS)
@-del "$<"
cd $(OUTPATH)
tlib "..\$<" +$(**: = +)
cd ..
!if $d(INSTDIR) && "$(INSTDIR)" != ""
@-if not exist $(INSTDIR) mkdir $(INSTDIR)
copy $< $(INSTDIR) >nul
copy $(SRCDIR)\*.h $(INSTDIR) >nul
!endif
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
# Copyright (c) 2001-2004 Thomas Grill (gr@grrrr.org)
#
# Makefile for BorlandC++
# Makefile for BCC++
#
# usage: make -f makefile.bcc
#
# ---------------------------------------------
# IMPORTANT: Adjust some of the paths also in makefile-inc.bcc
#
# note: no threading support for BorlandC++
# usage: make -f makefile.pd-bcc
#
# ---------------------------------------------
# ---------------------------------------------------------------
!include config-pd-bcc.txt
all: flext flext_t flext_d flext_td
SOURCE=source
flext:
make /f make-inc.pd-bcc NAME=$*
NAME=flext
TARGET=pdwin # appendix to lib name
flext_d:
make /f make-inc.pd-bcc NAME=$* DEBUG=1
# includes
INCPATH=-I$(BCCPATH)\include -I$(PDPATH)\src -I$(SOURCE)
flext_t:
make /f make-inc.pd-bcc NAME=$* THREADED=1
!ifdef SNDOBJ
INCPATH=$(INCPATH) -I$(SNDOBJ)
!endif
flext_td:
make /f make-inc.pd-bcc NAME=$* THREADED=1 DEBUG=1
# compiler definitions and flags
DEFS=-DFLEXT_SYS=2
CFLAGS=-6 -O2 -OS -ff -tWD
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
!include make-files.txt
!ifdef SNDOBJ
SRCS=$(SRCS) $(SRCS_SNDOBJ)
HDRS=$(HDRS) $(HDRS_SNDOBJ)
!endif
#default target
all: $(OUTPATH)\$(NAME)-$(TARGET).lib
# remove build
clean:
-del /s /q $(OUTPATH) > nul
rmdir $(OUTPATH)
# -----------------------------------------------
OBJS= $(SRCS:.cpp=.obj)
#.PATH.obj=$(OUTPATH)
DIR="/"
{$(SOURCE)}.cpp.obj:
bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(OUTPATH) $<
$(OUTPATH):
@if not exist $< mkdir $<
$(OUTPATH)\$(NAME)-$(TARGET).lib:: $(OUTPATH)
$(OUTPATH)\$(NAME)-$(TARGET).lib:: $(OBJS)
@-del "$<"
cd $(OUTPATH)
tlib "..\$<" +$(**: = +)
cd ..
!if $d(INSTDIR) && "$(INSTDIR)" != ""
@-if not exist $(INSTDIR) mkdir $(INSTDIR)
copy $< $(INSTDIR) >nul
copy $(SOURCE)\*.h $(INSTDIR) >nul
!endif
make /f make-inc.pd-bcc clean
......@@ -604,12 +604,17 @@ bool flext::ThrCond::Wait() {
return ret;
}
bool flext::ThrCond::TimedWait(double ftime)
bool flext::ThrCond::TimedWait(double ftm)
{
timespec tm;
#if FLEXT_OS == FLEXT_OS_WIN && FLEXT_OSAPI == FLEXT_OSAPI_WIN_NATIVE
#ifdef _MSC_VER
_timeb tmb;
_ftime(&tmb);
#else
timeb tmb;
ftime(&tmb);
#endif
tm.tv_nsec = tmb.millitm*1000000;
tm.tv_sec = tmb.time;
#else // POSIX
......@@ -623,9 +628,9 @@ bool flext::ThrCond::TimedWait(double ftime)
#endif
#endif
tm.tv_nsec += (long)((ftime-(long)ftime)*1.e9);
tm.tv_nsec += (long)((ftm-(long)ftm)*1.e9);
long nns = tm.tv_nsec%1000000000;
tm.tv_sec += (long)ftime+(tm.tv_nsec-nns)/1000000000;
tm.tv_sec += (long)ftm+(tm.tv_nsec-nns)/1000000000;
tm.tv_nsec = nns;
Lock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment