forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.win32gcc
86 lines (76 loc) · 2.57 KB
/
Makefile.win32gcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# -*- mode: makefile -*-
#
# Makefile of ROOT for Windows with gcc compiler in Cygwin environment
PLATFORM = linux
DEBUGFLAGS = -g
OPTFLAGS = -O2 -DNDEBUG
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT = $(DEBUGFLAGS)
NOOPT =
else
OPT = $(OPTFLAGS)
NOOPT =
endif
ifeq ($(CXX14),yes)
CXX11FLAGS = -std=gnu++1y
else
CXX11FLAGS = -std=gnu++11
endif
# Compiler:
CXX = g++
CC = gcc
CXXFLAGS = $(CXX11FLAGS) -pipe -Wall -Woverloaded-virtual $(EXTRA_CXXFLAGS) \
-I/usr/X11R6/include $(USERCONF_CXXFLAGS)
CFLAGS = -pipe -Wall $(EXTRA_CFLAGS) -I/usr/X11R6/include $(USERCONF_CFLAGS)
COMPILER = gnu
# Linker:
LD = $(ROOT_SRCDIR)/build/unix/wingcc_ld.sh
LDFLAGS = $(OPT) -Wl,--enable-auto-import \
-Wl,--enable-runtime-pseudo-reloc \
-L/usr/X11R6/lib \
$(EXTRA_LDFLAGS)
SOFLAGS = -shared -Wl,--export-all-symbols -Wl,--enable-auto-image-base \
-Wl,-soname=
# that's what cygwin ld looks for when searching for shared libs
SOEXT = dll
EXEEXT = .exe
FORCELINK = yes
# System libraries:
SYSLIBS = -lm $(OSTHREADLIBDIR) $(OSTHREADLIB) $(ALLOCLIBDIR) $(ALLOCLIB)
XLIBS = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -lXext -lX11
CILIBS = -lm
CRYPTLIBS = -lcrypt
# Fortran:
ifneq ($(findstring gfortran, $(F77)),)
ifeq ($(F77),)
# only needed to get default compiler in ./configure
F77 = gfortran
endif
F77FLAGS = -std=legacy
F77LIBS := $(shell $(F77) -print-file-name=libgfortran.a)
F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a)
endif
ifneq ($(findstring g77, $(F77)),)
ifeq ($(F77),)
# only needed to get default compiler in ./configure
F77 = g77
endif
F77FLAGS =
F77LIBS = -lg2c
endif
# transform cygwin version 1.2.3-4 into integer
# each of the four version parts but the first gets two digits,
# filled up with 0 if necessary (i.e. if a version part only
# has one digit), and removing ".", "-"
# thus, 1.2.3-4 becomes 1020304, 12.3.45-67 becomes 12034567
CYGWINVERSION = $(shell cygcheck -c cygwin | egrep '^cygwin' \
| sed 's,^[^[:digit:]]\+\([^[:space:]]\+\).*$$,\1,' \
| sed 's,[.-]\([[:digit:]]\)\($$\|[^[:digit:]]\),0\1,g' \
| sed 's,[.-],,g' )
# test whether the cygwin version is newer than 1051201 (i.e. 1.5.12-1)
CYGVER1051201 = $(shell test $(CYGWINVERSION) -ge 1051201 \
&& echo $(CYGWINVERSION) )
# Extras
ifeq ($(CYGVER1051201),)
POSTBIN += rebase
endif