Update of /cvsroot/pure-data/externals/grill/flext/buildsys/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16508/buildsys/win
Added Files: make-bcc.inc make-cygwin.inc make-mingw.inc make-msvc.inc Log Message: simplified make system updated make system for BCC updated make system updated build system
--- NEW FILE: make-cygwin.inc --- ifndef FLEXTBUILD INCPATH += -I$(FLEXTPATH) LIBPATH += -L$(FLEXTPATH) LIBS+=$(FLEXTPATH)/$(FLEXTNAME).a endif
LDFLAGS += -shared -Wl,-x
##############################################
ifdef DEBUG CFLAGS += -g -D_DEBUG else CFLAGS += $(OFLAGS) -DNDEBUG LDFLAGS += -Wl,-S endif
##############################################
ifdef FLEXTBUILD OUTNAME=$(FLEXTNAME)
ifdef SHARED EXT=dll else EXT=a BUILDLIB=1 endif
else OUTNAME=$(NAME) endif
##############################################
TARGETPATH=$(OUTPATH)/$(OUTSUB) TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
##############################################
CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS))) CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS))) COBJS=$(patsubst %.c,$(TARGETPATH)/%.o,$(filter %.c,$(SRCS))) CPPOBJS=$(patsubst %.cpp,$(TARGETPATH)/%.opp,$(filter %.cpp,$(SRCS)))
# default target _all_: $(TARGET)
$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS)) touch $@
$(TARGETPATH): -mkdir $(OUTPATH) -mkdir $@
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGETPATH)/%.o : $(SRCDIR)/%.c $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGET) :: $(TARGETPATH)
$(TARGET) :: $(COBJS) $(CPPOBJS) ifdef BUILDLIB $(AR) rc $@ $(COBJS) $(CPPOBJS) else $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS) chmod 755 $@ endif
##############################################
_clean_: rm $(COBJS) $(CPPOBJS) $(TARGET)
##############################################
$(INSTPATH): -mkdir $@
$(FLEXTPATH): -mkdir $@
_install_:: $(INSTPATH) $(FLEXTPATH)
_install_:: $(TARGET) ifdef FLEXTBUILD cp $(TARGET) $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(FLEXTPATH) else install $(TARGET) $(INSTPATH) endif
--- NEW FILE: make-bcc.inc --- !ifndef FLEXTBUILD INCPATH=$(INCPATH) -I$(FLEXTPATH) LIBPATH=$(LIBPATH) -L$(FLEXTPATH) LIBS=$(LIBS) $(FLEXTNAME).lib !endif
!ifdef BCCPATH INCPATH=$(INCPATH) -I$(BCCPATH)\include LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib !endif
LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057 LDFLAGS=$(LDFLAGS) /C /Tpd
##############################################
# use multithreaded static libraries !ifdef DEBUG CFLAGS=$(CFLAGS) -v -D_DEBUG LDFLAGS=$(LDFLAGS) /v !else CFLAGS=$(CFLAGS) $(OFLAGS) -DNDEBUG !endif
##############################################
!ifdef FLEXTBUILD OUTNAME=$(FLEXTNAME)
!ifdef SHARED EXT=dll !else EXT=lib BUILDLIB=1 !endif
!else OUTNAME=$(NAME) !endif
##############################################
TARGETPATH=$(OUTPATH)$(OUTSUB) TARGET=$(TARGETPATH)$(OUTNAME).$(EXT)
##############################################
!ifdef PDPATH
$(TARGETPATH)\pd.lib : $(PDPATH)\bin\pd.dll implib -a $< $**
$(TARGETPATH)\pthreadVC.lib : $(PDPATH)\bin\pthreadVC.dll implib -a $< $**
PDTARGETS=$(TARGETPATH)\pd.lib $(TARGETPATH)\pthreadVC.lib
!endif
##############################################
# default target _all_: $(TARGET)
# convert both *.c and *.cpp OBJSTMP= $(SRCS:.c=.obj) OBJS= $(OBJSTMP:.objpp=.obj)
$(TARGETPATH): if not exist $(OUTPATH) mkdir $(OUTPATH) > nul if not exist $@ mkdir $@ > nul
!ifndef FLEXTBUILD SETUPFUNCTION=$(NAME)_setup
$(TARGETPATH)$(NAME).def: @echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $< # this next line fixes a strange problem with implib - lacking underscore?! @echo IMPORTS _rtext_retext=PD.rtext_retext >> $<
$(TARGET) :: $(TARGETPATH)$(NAME).def !endif
{$(SRCDIR)}.cpp{}.obj: bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
{$(SRCDIR)}.c{}.obj: bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
$(TARGET) :: $(TARGETPATH) $(PDTARGETS)
$(TARGET) :: $(OBJS) cd $(TARGETPATH) !ifdef BUILDLIB -del $(<F) tlib "$(<F)" +$(OBJS: = +) cd .. !else ilink32 $(LDFLAGS) $(LIBPATH) -L. $(OBJS) ,$(<F),,$(LIBS),$(NAME).def !endif cd ..
##############################################
_clean_: -del /q $(TARGET) > nul -cd $(TARGETPATH) -del /q $(OBJS) > nul
##############################################
$(INSTPATH): if not exist $@ mkdir $@ > nul
$(FLEXTPATH): if not exist $@ mkdir $@ > nul
_install_ :: $(INSTPATH) $(FLEXTPATH)
_install_ :: !ifdef FLEXTBUILD -copy $(TARGET) $(FLEXTPATH) > nul @cd $(SRCDIR) -for %%i in ($(HDRS)) do @copy %%i $(FLEXTPATH) > nul !else copy $(TARGET) $(INSTPATH) > nul !endif
--- NEW FILE: make-msvc.inc --- !ifndef FLEXTBUILD INCPATH=$(INCPATH) /I$(FLEXTPATH) LIBPATH=$(LIBPATH) /LIBPATH:$(FLEXTPATH) LIBS=$(LIBS) $(FLEXTNAME).lib !endif
!ifdef MSVCPATH INCPATH=$(INCPATH) /I$(MSVCPATH)\include LIBPATH=$(LIBPATH) /LIBPATH:$(MSVCPATH)\lib !endif
# for VC7 - enable exception handling CFLAGS=$(CFLAGS) /EHsc
##############################################
!ifdef DEBUG CFLAGS=$(CFLAGS) /D_DEBUG /DMTd LDFLAGS=$(LDFLAGS) /DEBUG !else CFLAGS=$(CFLAGS) $(OFLAGS) /DNDEBUG /DMT LDFLAGS=$(LDFLAGS) /INCREMENTAL:NO !endif
##############################################
!ifdef FLEXTBUILD OUTNAME=$(FLEXTNAME)
!ifdef SHARED EXT=dll !else EXT=lib BUILDLIB=1 !endif
!else OUTNAME=$(NAME) !endif
##############################################
TARGETPATH=$(OUTPATH)$(OUTSUB) TARGET=$(TARGETPATH)$(OUTNAME).$(EXT)
##############################################
# default target _all_: $(TARGET)
# convert both *.c and *.cpp OBJSTMP= $(SRCS:.c=.obj) OBJS= $(OBJSTMP:.objpp=.obj)
$(TARGETPATH): if not exist $(OUTPATH) mkdir $(OUTPATH) > nul if not exist $@ mkdir $@ > nul
{$(SRCDIR)}.cpp{}.obj: cl /c /LD $(CFLAGS) $(DEFS) $(INCPATH) $** /Fo$(TARGETPATH)$@
{$(SRCDIR)}.c{}.obj: cl /c /LD $(CFLAGS) $(DEFS) $(INCPATH) $** /Fo$(TARGETPATH)$@
$(TARGET):: $(TARGETPATH)
$(TARGET):: $(OBJS) @cd $(TARGETPATH) !ifdef BUILDLIB lib /OUT:$(@F) $(OBJS) cd .. !else echo $** link /DLL $(LDFLAGS) $(LIBPATH) $(OBJS) $(LIBS) /out:$(@F) !endif cd ..
##############################################
# remove build _clean_: -del /q $(TARGET) > nul -cd $(TARGETPATH) -del /q $(OBJS) > nul
##############################################
$(INSTPATH): if not exist $@ mkdir $@ > nul
$(FLEXTPATH): if not exist $@ mkdir $@ > nul
_install_:: $(INSTPATH) $(FLEXTPATH)
_install_:: !ifdef FLEXTBUILD -copy $(TARGET) $(FLEXTPATH) > nul @cd $(SRCDIR) -for %%i in ($(HDRS)) do @copy %%i $(FLEXTPATH) > nul !else copy $(TARGET) $(INSTPATH) > nul !endif
--- NEW FILE: make-mingw.inc --- ifndef FLEXTBUILD INCPATH += -I$(FLEXTPATH) LIBPATH += -L$(FLEXTPATH) LIBS+=$(FLEXTPATH)/$(FLEXTNAME).lib endif
LDFLAGS += -shared -Wl,-x
##############################################
ifdef DEBUG CFLAGS += -g -D_DEBUG else CFLAGS += $(OFLAGS) -DNDEBUG LDFLAGS += -Wl,-S endif
##############################################
ifdef FLEXTBUILD OUTNAME=$(FLEXTNAME)
ifdef SHARED EXT=dll else EXT=lib BUILDLIB=1 endif
else OUTNAME=$(NAME) endif
##############################################
TARGETPATH=$(OUTPATH)/$(OUTSUB) TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
##############################################
CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS))) CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS))) COBJS=$(patsubst %.c,$(TARGETPATH)/%.o,$(filter %.c,$(SRCS))) CPPOBJS=$(patsubst %.cpp,$(TARGETPATH)/%.opp,$(filter %.cpp,$(SRCS)))
# default target _all_: $(TARGET)
#$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS)) # touch $@
$(TARGETPATH): -mkdir $(subst /,,$(OUTPATH)) -mkdir $(subst /,,$@)
$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGETPATH)/%.o : $(SRCDIR)/%.c $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
$(TARGET) :: $(TARGETPATH)
$(TARGET) :: $(COBJS) $(CPPOBJS) ifdef BUILDLIB $(AR) rc $@ $(COBJS) $(CPPOBJS) else $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS) endif
##############################################
_clean_: -del $(subst /,,$(COBJS) $(CPPOBJS) $(TARGET))
##############################################
$(FLEXTPATH): -mkdir $(subst /,,$@)
$(INSTPATH): -mkdir $(subst /,,$@)
_install_:: $(INSTPATH) $(FLEXTPATH)
_install_:: $(TARGET) ifdef FLEXTBUILD copy $(subst /,,$(TARGET) $(FLEXTPATH)) -for %%i in ($(subst /,,$(patsubst %,$(SRCDIR)/%,$(HDRS)))) do @copy %%i $(subst /,,$(FLEXTPATH)) > nul else copy $(subst /,,$(TARGET) $(INSTPATH)) endif