Commit ad23759b authored by thomas's avatar thomas
Browse files

updated build system

git-svn-id: https://svn.grrrr.org/ext/trunk@922 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 97212bff
......@@ -49,13 +49,13 @@ TARGETTYPE=single
##############################
# platform-specific make stuff
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\bmake-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER)-$(BUILDCLASS).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\bmake-$(COMPILER)-$(BUILDCLASS).inc
##############################
# general make stuff
!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\bmake-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER)-$(BUILDCLASS).inc
!include $(BUILDPATH)$(PLATFORM)\bmake-$(COMPILER)-$(BUILDCLASS).inc
......@@ -24,6 +24,6 @@ endif
include $(BUILDPATH)gnumake.inc
# platform-specific make stuff
include $(BUILDPATH)$(PLATFORM)/$(RTSYS)/make-$(COMPILER).inc
include $(BUILDPATH)$(PLATFORM)/$(RTSYS)/gnumake-$(COMPILER).inc
# general make stuff
include $(BUILDPATH)$(PLATFORM)/make-$(COMPILER).inc
include $(BUILDPATH)$(PLATFORM)/gnumake-$(COMPILER).inc
......@@ -49,13 +49,13 @@ TARGETTYPE=single
##############################
# platform-specific make stuff
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\nmake-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER)-$(BUILDCLASS).inc
!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\nmake-$(COMPILER)-$(BUILDCLASS).inc
##############################
# general make stuff
!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\nmake-$(COMPILER).inc
!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER)-$(BUILDCLASS).inc
!include $(BUILDPATH)$(PLATFORM)\nmake-$(COMPILER)-$(BUILDCLASS).inc
......@@ -3,7 +3,6 @@
INCPATH=$(INCPATH) -I$(FLEXTINC)
LIBPATH=$(LIBPATH) -L$(FLEXTLIB)
LIBS=$(LIBS) $(FLEXTNAME).lib
!endif
##############################################
......@@ -18,10 +17,10 @@ $(TARGETPATH): $(OUTPATH)
SETUPFUNCTION=$(NAME)_setup
$(TARGETPATH)\$(NAME).def:
@echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $<
$(TARGETPATH)\$(NAME).def: $(TARGETPATH)
@echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $@
# this next line fixes a strange problem with implib - lacking underscore?!
@echo IMPORTS _rtext_retext=PD.rtext_retext >> $<
@echo IMPORTS _rtext_retext=PD.rtext_retext >> $@
$(TARGET) :: $(TARGETPATH)\$(NAME).def
......
!ifdef BCCPATH
INCPATH=$(INCPATH) -I$(BCCPATH)\include
LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib
!endif
##############################################
TARGETPATH=$(OUTPATH)\$(OUTSUB)
TARGET=$(TARGETPATH)\$(OUTNAME).$(EXT)
##############################################
# use precompiled headers
!ifndef PRECOMPILE
CFLAGS=$(CFLAGS) -Hh=flext.h
!else
CFLAGS=$(CFLAGS) -Hh=$(PRECOMPILE)
!endif
# location of precompiled file
CFLAGS=$(CFLAGS) -H=$(TARGETPATH)\precompiled.pch
##############################################
LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ
CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057
LDFLAGS=$(LDFLAGS) /C /Tpd
##############################################
!ifdef DEBUG
CFLAGS=$(CFLAGS) -v -D_DEBUG
LDFLAGS=$(LDFLAGS) /v
!else
CFLAGS=$(CFLAGS) $(OFLAGS) -DNDEBUG
!endif
##############################################
# convert both *.c and *.cpp
OBJSTMP= $(SRCS:.c=.obj)
OBJS= $(OBJSTMP:.objpp=.obj)
!ifdef BCCPATH
INCPATH=$(INCPATH) -I$(BCCPATH)\include
LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib
!endif
##############################################
TARGETPATH=$(OUTPATH)\$(OUTSUB)
TARGET=$(TARGETPATH)\$(OUTNAME).$(EXT)
##############################################
# use precompiled headers
!ifndef PRECOMPILE
CFLAGS=$(CFLAGS) -Hh=flext.h
!else
CFLAGS=$(CFLAGS) -Hh=$(PRECOMPILE)
!endif
# location of precompiled file
CFLAGS=$(CFLAGS) -H=$(TARGETPATH)\precompiled.pch
##############################################
LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ
CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057
LDFLAGS=$(LDFLAGS) /C /Tpd
##############################################
!ifdef DEBUG
CFLAGS=$(CFLAGS) -v -D_DEBUG
LDFLAGS=$(LDFLAGS) /v
!else
CFLAGS=$(CFLAGS) $(OFLAGS) -DNDEBUG
!endif
##############################################
# convert both *.c and *.cpp
OBJSTMP= $(SRCS:.c=.obj)
OBJS= $(OBJSTMP:.objpp=.obj)
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
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
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