Mercurial > mxe-octave
annotate src/build-msvctools/Makefile @ 3337:8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
* src/build-msvctools/Makefile (getopt.c, getopt.h): Use versions from
mingw64, as they're POSIX compliant.
(posixcompat.lib): New target library, replaces dirent.lib and
getopt.lib.
(dirent.lib, getopt.lib): Removed targets.
* src/build-msvctools/getopt.diff: Removed obsolete patch.
* src/build-msvctools/cc-msvc.cc: Links against posixcompat.lib instead
of dirent.lib
* src/build-msvctools/unistd.h: Include getopt.h, for POSIX compliance.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Fri, 29 Nov 2013 18:46:45 -0500 |
parents | 4f573c0f5955 |
children |
rev | line source |
---|---|
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
1 TARGETS = \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
2 ar-msvc \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
3 cc-msvc.exe \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
4 clgcc.exe \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
5 clg++.exe \ |
3076
b39e8dc859f7
[MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3061
diff
changeset
|
6 clgfortran.exe \ |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
7 dirent.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
8 getopt.h \ |
3337
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
9 posixcompat.lib \ |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
10 inttypes.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
11 lt-postproc \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
12 ranlib-msvc \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
13 stdbool.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
14 unistd.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
15 compat/mingwcompat.lib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
16 math/msvcmath.lib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
17 gfortran-msvc.exe \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
18 gfortran-msvc.lib \ |
3160
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
19 gfortran-msvc-static.lib \ |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
20 Windows-clgcc.cmake |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
21 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
22 MSVCSTDINT := $(shell echo '\#include <stdint.h>' > t.c; cl -nologo -showIncludes -c t.c | $(SED) -n -e 's/^Note: including file: \(.*stdint\.h\)$$/\1/p'; rm -f t.c t.obj) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
23 ifeq ($(MSVCSTDINT),) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
24 TARGETS += stdint.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
25 endif |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
26 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
27 .PHONY: all |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
28 all: $(TARGETS) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
29 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
30 cc-msvc.exe: cc-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
31 cl -nologo -O2 -EHsc cc-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
32 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
33 clgcc.exe clg++.exe: cc-msvc.exe |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
34 cp -a $< $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
35 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
36 fixlibtool2: fixlibtool2.in |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
37 $(SED) \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
38 -e "s/@LIBRARY_PREFIX@/$(LIBRARY_PREFIX)/" \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
39 -e "s/@LIBRARY_SUFFIX@/$(LIBRARY_SUFFIX)/" $< > $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
40 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
41 stdint.h inttypes.h: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
42 $(WGET) http://msinttypes.googlecode.com/svn/trunk/$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
43 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
44 dirent.h: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
45 $(WGET) -O $@ 'http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/include/dirent.h?format=raw' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
46 $(SED) -i -e 's/FILENAME_MAX/260/g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
47 -e 's/__MINGW_NOTHROW//g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
48 -e 's,^.*_mingw\.h.*$$,/*&*/,' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
49 -e 's/_A_VOLID/0x00/g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
50 $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
51 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
52 dirent.c: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
53 $(WGET) -O $@ 'http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/src/libcrt/tchar/dirent.c?format=raw' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
54 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
55 dirent.obj: dirent.c dirent.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
56 cl -nologo -O2 -MD -I. \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
57 -DFILENAME_MAX=260 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
58 -Dinline=__inline \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
59 -D_TDIR=DIR \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
60 -D_tdirent=dirent \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
61 -D_topendir=opendir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
62 -D_tclosedir=closedir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
63 -D_treaddir=readdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
64 -D_trewinddir=rewinddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
65 -D_tseekdir=seekdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
66 -D_ttelldir=telldir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
67 -c dirent.c -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
68 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
69 wdirent.obj: dirent.c dirent.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
70 cl -nologo -O2 -MD -I. \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
71 -D_UNICODE \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
72 -DFILENAME_MAX=260 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
73 -Dinline=__inline \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
74 -D_osver=GetVersion\(\) \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
75 -D_TDIR=_WDIR \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
76 -D_tdirent=_wdirent \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
77 -D_topendir=_wopendir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
78 -D_tclosedir=_wclosedir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
79 -D_treaddir=_wreaddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
80 -D_trewinddir=_wrewinddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
81 -D_tseekdir=_wseekdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
82 -D_ttelldir=_wtelldir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
83 -c dirent.c -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
84 |
3337
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
85 getopt.h: |
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
86 $(WGET) -O $@ 'http://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-headers/crt/getopt.h?format=raw' |
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
87 $(SED) -i -e 's,^.*crtdefs\.h.*$$,/*&*/,' $@ |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
88 |
3337
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
89 getopt.c: |
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
90 $(WGET) -O $@ 'http://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-crt/misc/getopt.c?format=raw' |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
91 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
92 getopt.obj: getopt.c getopt.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
93 cl -nologo -O2 -MD -I. -c $< -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
94 |
3337
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
95 posixcompat.lib: dirent.obj wdirent.obj getopt.obj |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
96 lib -out:$@ $^ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
97 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
98 compat/mingwcompat.lib: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
99 $(MAKE) -C compat |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
100 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
101 math/msvcmath.lib: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
102 $(MAKE) -C math SED='$(SED)' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
103 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
104 math/msvcmath.h: math/msvcmath.lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
105 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
106 gfortran-msvc.exe: gfortran-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
107 cl -nologo -O2 -EHsc gfortran-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
108 |
3076
b39e8dc859f7
[MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3061
diff
changeset
|
109 clgfortran.exe: gfortran-msvc.exe |
b39e8dc859f7
[MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3061
diff
changeset
|
110 cp -a $< $@ |
b39e8dc859f7
[MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3061
diff
changeset
|
111 |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
112 gfortran-msvc-gcc-patch.stamp: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
113 (cd ../gcc-$(GCCVERSION)/ && patch -p1) < gcc.diff |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
114 (cd ../gcc-$(GCCVERSION)/ && \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
115 cp libgcc/config/i386/gthr-win32.h libgcc/gthr-default.h) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
116 touch $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
117 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
118 gfortran-msvc-build: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
119 mkdir $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
120 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
121 gfortran-msvc-build/.libs/libgfortran.a: gfortran-msvc-gcc-patch.stamp gfortran-msvc-build |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
122 cd gfortran-msvc-build && \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
123 ../../gcc-$(GCCVERSION)/libgfortran/configure \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
124 --disable-libquadmath-support \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
125 --disable-shared \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
126 --enable-static \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
127 --disable-multilib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
128 CFLAGS="-O2 -mstackrealign -mincoming-stack-boundary=2" \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
129 FCFLAGS="-O3 -ff2c -mstackrealign -mincoming-stack-boundary=2" |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
130 $(MAKE) -C gfortran-msvc-build |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
131 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
132 gfortran.lst: gfortran-msvc-build/.libs/libgfortran.a |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
133 ar x $< |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
134 ar t $< > $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
135 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
136 gfortran.def: gfortran.lst |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
137 (echo 'EXPORTS'; nm -C @$< | grep ' T _gfortran_' | cut -d' ' -f3) > $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
138 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
139 libgfortran-dllinit.o: libgfortran-dllinit.c cc-msvc.exe |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
140 cc-msvc -O2 -c $< -o $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
141 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
142 libgfortran-msvcinit.o: libgfortran-msvcinit.c cc-msvc.exe |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
143 cc-msvc -O2 -c $< -o $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
144 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
145 gfortran-msvc.lib: gfortran-msvc-build/.libs/libgfortran.a gfortran.def gfortran.lst \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
146 compat/mingwcompat.lib cc-msvc.exe libgfortran-dllinit.o |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
147 cc-msvc -shared -o $(LIBRARY_PREFIX)gfortran-msvc$(LIBRARY_SUFFIX).dll \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
148 libgfortran-dllinit.o @gfortran.lst -Wl,-def:gfortran.def -Wl,-implib:gfortran-msvc.lib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
149 -Lcompat -Lmath -lmingwcompat -ladvapi32 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
150 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
151 gfortran-msvc-static.lib: gfortran-msvc-build/.libs/libgfortran.a gfortran.lst libgfortran-msvcinit.o |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
152 lib -out:$@ libgfortran-msvcinit.o @gfortran.lst |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
153 |
3160
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
154 Windows-clgcc.cmake: Windows-clgcc.cmake.in |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
155 $(SED) -e 's/@@LIBRARY_PREFIX@@/$(LIBRARY_PREFIX)/g' \ |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
156 -e 's/@@LIBRARY_SUFFIX@@/$(LIBRARY_SUFFIX)/g' $< > $@ |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
157 |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
158 .PHONY: install |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
159 install: all |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
160 $(INSTALL) -d $(DESTDIR)/bin |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
161 $(INSTALL) ar-msvc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
162 $(INSTALL) cc-msvc.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
163 $(INSTALL) clgcc.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
164 $(INSTALL) clg++.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
165 $(INSTALL) lt-postproc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
166 $(INSTALL) gfortran-msvc.exe $(DESTDIR)/bin/ |
3076
b39e8dc859f7
[MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3061
diff
changeset
|
167 $(INSTALL) clgfortran.exe $(DESTDIR)/bin/ |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
168 $(INSTALL) ranlib-msvc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
169 $(INSTALL) $(LIBRARY_PREFIX)gfortran-msvc$(LIBRARY_SUFFIX).dll $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
170 $(INSTALL) -d $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
171 test -n "$(MSVCSTDINT)" || $(INSTALL) stdint.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
172 $(INSTALL) inttypes.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
173 $(INSTALL) unistd.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
174 $(INSTALL) stdbool.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
175 $(INSTALL) dirent.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
176 $(INSTALL) getopt.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
177 $(INSTALL) math/msvcmath.h $(DESTDIR)/include/math.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
178 $(INSTALL) -d $(DESTDIR)/lib |
3337
8480924d2b85
[MSVC] Use POSIX compliant getopt version from mingw64.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3160
diff
changeset
|
179 $(INSTALL) posixcompat.lib $(DESTDIR)/lib |
3061
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
180 $(INSTALL) compat/mingwcompat.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
181 $(INSTALL) math/msvcmath.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
182 $(INSTALL) gfortran-msvc.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
183 $(INSTALL) gfortran-msvc-static.lib $(DESTDIR)/lib |
3160
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
184 $(INSTALL) -d $(CMAKE_DESTDIR)/Modules/Platform |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
185 $(INSTALL) Windows-clg++.cmake $(CMAKE_DESTDIR)/Modules/Platform |
4f573c0f5955
[MSVC] better integration between clgcc/clg++ and cmake
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3076
diff
changeset
|
186 $(INSTALL) Windows-clgcc.cmake $(CMAKE_DESTDIR)/Modules/Platform |