Revision 1371 trunk/src/GNUmakefile

GNUmakefile (revision 1371)
1
.NOTPARALLEL: all libs contrib
2

  
3
INSTALL_DIR=/usr/local/
4

  
5 1
ifeq ($(OS),Windows_NT)
6
  ifndef TERM
7
    TERMINAL=dos
2
  SET_VARIABLES=$(shell set)
3
  HAS_CYGWIN=$(findstring OSTYPE=cygwin,$(SET_VARIABLES))
4
  ifeq ("$(HAS_CYGWIN)","")
5
    SHELL=cmd
8 6
  endif
7
  HAS_MSYS=$(findstring OSTYPE=msys,$(SET_VARIABLES))
8
  ifeq ("$(HAS_MSYS)","")
9
    SHELL=cmd
10
  endif
9 11
endif
10 12

  
11
ifeq ($(TERMINAL),dos)
12
  SHELL=cmd
13
  DISK=..\build\dist
14
  LIBPATH=..\build\objects\dist
13
ifeq ($(SHELL),cmd)
15 14
  PWD=$(shell cd)
15
  PATH:=$(PWD)\..\utilities;$(PATH)
16 16
  ifdef MINGW_HOME
17
    PATH:=$(MINGW_HOME)\bin;$(PWD)\..\utilities;$(PATH)
17
    PATH:=$(MINGW_HOME)\bin;$(PATH)
18 18
  else
19
    PATH:=$(PWD)\..\utilities\mingw\bin;$(PWD)\..\utilities;$(PATH)
19
    HAS_CXX=$(shell $(CXX) --version && echo %ERRORLEVEL%)
20
    HAS_CC=$(shell $(CC) --version && echo %ERRORLEVEL%)
21
    ifeq ("$(HAS_CXX)","")
22
      HAS_CXX2=$(shell $(PWD)\..\utilities\mingw\bin\g++ --version && echo %ERRORLEVEL%)
23
      HAS_CC2=$(shell $(PWD)\..\utilities\mingw\bin\gcc --version && echo %ERRORLEVEL%)
24
      ifneq ("$(HAS_CXX2)","")
25
        PATH:=$(PWD)\..\utilities\mingw\bin;$(PATH)
26
      endif
27
    endif
20 28
  endif
29
  DIST=..\build\dist
30
  LIBSDIR=$(DIST)\lib
31
  LIBSDIR:=$(subst  ,\,$(LIBSDIR))
32
  OBJSDIR=..\build\objects\dist
33
  OBJSDIR:=$(subst  ,\,$(OBJSDIR))
21 34
else
22
  DISK=../build/dist
23
  LIBPATH=../build/objects/dist
35
  INSTALL_DIR=/usr/local/
36
  DIST=../build/dist
37
  LIBSDIR=$(DIST)/lib
38
  OBJSDIR=../build/objects/dist/
24 39
  PWD=$(shell pwd)
25 40
endif
26 41

  
42
ifdef CXXFLAGS
43
  CXXFLAGS:= $(CXXFLAGS)
44
endif
45

  
27 46
ifdef DEBUG
28
  CXXFLAGS_PRE:=-g
47
  CXXFLAGS:= -g$(CXXFLAGS)
29 48
else
30 49
  ifeq ($(CXX),openCC)
31
    CXXFLAGS_PRE:=-O2
50
    CXXFLAGS_PRE:= -O2$(CXXFLAGS)
32 51
  else
33
    CXXFLAGS_PRE:=-O3
52
    CXXFLAGS_PRE:= -O3$(CXXFLAGS)
34 53
  endif
35 54
endif
36 55

  
37 56
ifdef BUILD_SHARED_LIBRARY
38
CXXFLAGS_PRE:=$(CXXFLAGS_PRE) -fPIC
57
  CXXFLAGS:= -fPIC$(CXXFLAGS)
39 58
endif
40 59

  
41 60
ifneq ($(CXX),CC)
42
CXXFLAGS_PRE:=$(CXXFLAGS_PRE) -Wall
61
CXXFLAGS:= -Wall$(CXXFLAGS)
43 62
endif
44 63

  
45 64
CXXFLAGS_DEFINES:=-D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE
46 65

  
47
ifeq ($(TERMINAL),dos)
66
ifeq ($(SHELL),cmd)
48 67
CXXFLAGS_INCLUDES:=-I..\build\dist\include
49
CXXFLAGS_INCLUDES_CONTRIB:=-I..\..\build\dist\include
50 68
else
51 69
CXXFLAGS_INCLUDES:=-I../build/dist/include
52
CXXFLAGS_INCLUDES_CONTRIB:=-I../../build/dist/include
53 70
endif
54 71

  
55
ifdef CXXFLAGS
56
CXXFLAGS_OPT:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
57
CXXFLAGS_SAFE:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff