Mercurial > mxe-octave
annotate src/build-msvctools/Makefile @ 3061:f8299bb6c872
Initial support for native MSVC compilation.
* add MSVC support files: compiler wrappers and support libraries
* adapt libiconv to work with MSVC
* adapt gettext to work with MSVC
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Mon, 17 Jun 2013 22:43:11 -0400 |
parents | |
children | b39e8dc859f7 |
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 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
6 dirent.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
7 dirent.lib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
8 getopt.h \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
9 getopt.lib \ |
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 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
19 gfortran-msvc-static.lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
20 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
21 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
|
22 ifeq ($(MSVCSTDINT),) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
23 TARGETS += stdint.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
24 endif |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
25 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
26 .PHONY: all |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
27 all: $(TARGETS) |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
28 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
29 cc-msvc.exe: cc-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
30 cl -nologo -O2 -EHsc cc-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
31 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
32 clgcc.exe clg++.exe: cc-msvc.exe |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
33 cp -a $< $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
34 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
35 fixlibtool2: fixlibtool2.in |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
36 $(SED) \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
37 -e "s/@LIBRARY_PREFIX@/$(LIBRARY_PREFIX)/" \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
38 -e "s/@LIBRARY_SUFFIX@/$(LIBRARY_SUFFIX)/" $< > $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
39 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
40 stdint.h inttypes.h: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
41 $(WGET) http://msinttypes.googlecode.com/svn/trunk/$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
42 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
43 dirent.h: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
44 $(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
|
45 $(SED) -i -e 's/FILENAME_MAX/260/g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
46 -e 's/__MINGW_NOTHROW//g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
47 -e 's,^.*_mingw\.h.*$$,/*&*/,' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
48 -e 's/_A_VOLID/0x00/g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
49 $@ |
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 dirent.c: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
52 $(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
|
53 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
54 dirent.obj: dirent.c dirent.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
55 cl -nologo -O2 -MD -I. \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
56 -DFILENAME_MAX=260 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
57 -Dinline=__inline \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
58 -D_TDIR=DIR \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
59 -D_tdirent=dirent \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
60 -D_topendir=opendir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
61 -D_tclosedir=closedir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
62 -D_treaddir=readdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
63 -D_trewinddir=rewinddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
64 -D_tseekdir=seekdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
65 -D_ttelldir=telldir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
66 -c dirent.c -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
67 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
68 wdirent.obj: dirent.c dirent.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
69 cl -nologo -O2 -MD -I. \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
70 -D_UNICODE \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
71 -DFILENAME_MAX=260 \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
72 -Dinline=__inline \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
73 -D_osver=GetVersion\(\) \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
74 -D_TDIR=_WDIR \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
75 -D_tdirent=_wdirent \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
76 -D_topendir=_wopendir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
77 -D_tclosedir=_wclosedir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
78 -D_treaddir=_wreaddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
79 -D_trewinddir=_wrewinddir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
80 -D_tseekdir=_wseekdir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
81 -D_ttelldir=_wtelldir \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
82 -c dirent.c -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
83 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
84 dirent.lib: dirent.obj wdirent.obj |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
85 lib -out:$@ $^ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
86 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
87 getopt.h: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
88 $(WGET) -O $@ 'http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/include/getopt.h?format=raw' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
89 $(SED) -i -e 's/__MINGW_NOTHROW//g' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
90 -e 's,^.*_mingw\.h.*$$,/*&*/,' \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
91 getopt.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
92 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
93 getopt.c: getopt.diff |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
94 $(WGET) -O $@ 'http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/src/libcrt/misc/getopt.c?format=raw' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
95 $(PATCH) -p0 < getopt.diff |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
96 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
97 getopt.obj: getopt.c getopt.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
98 cl -nologo -O2 -MD -I. -c $< -Fo$@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
99 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
100 getopt.lib: getopt.obj |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
101 lib -out:$@ $^ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
102 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
103 compat/mingwcompat.lib: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
104 $(MAKE) -C compat |
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 math/msvcmath.lib: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
107 $(MAKE) -C math SED='$(SED)' |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
108 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
109 math/msvcmath.h: math/msvcmath.lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
110 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
111 gfortran-msvc.exe: gfortran-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
112 cl -nologo -O2 -EHsc gfortran-msvc.cc |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
113 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
114 gfortran-msvc-gcc-patch.stamp: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
115 (cd ../gcc-$(GCCVERSION)/ && patch -p1) < gcc.diff |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
116 (cd ../gcc-$(GCCVERSION)/ && \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
117 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
|
118 touch $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
119 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
120 gfortran-msvc-build: |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
121 mkdir $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
122 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
123 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
|
124 cd gfortran-msvc-build && \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
125 ../../gcc-$(GCCVERSION)/libgfortran/configure \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
126 --disable-libquadmath-support \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
127 --disable-shared \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
128 --enable-static \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
129 --disable-multilib \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
130 CFLAGS="-O2 -mstackrealign -mincoming-stack-boundary=2" \ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
131 FCFLAGS="-O3 -ff2c -mstackrealign -mincoming-stack-boundary=2" |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
132 $(MAKE) -C gfortran-msvc-build |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
133 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
134 gfortran.lst: gfortran-msvc-build/.libs/libgfortran.a |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
135 ar x $< |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
136 ar t $< > $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
137 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
138 gfortran.def: gfortran.lst |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
139 (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
|
140 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
141 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
|
142 cc-msvc -O2 -c $< -o $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
143 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
144 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
|
145 cc-msvc -O2 -c $< -o $@ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
146 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
147 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
|
148 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
|
149 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
|
150 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
|
151 -Lcompat -Lmath -lmingwcompat -ladvapi32 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
152 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
153 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
|
154 lib -out:$@ libgfortran-msvcinit.o @gfortran.lst |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
155 |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
156 .PHONY: install |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
157 install: all |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
158 $(INSTALL) -d $(DESTDIR)/bin |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
159 $(INSTALL) ar-msvc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
160 $(INSTALL) cc-msvc.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
161 $(INSTALL) clgcc.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
162 $(INSTALL) clg++.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
163 $(INSTALL) lt-postproc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
164 $(INSTALL) gfortran-msvc.exe $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
165 $(INSTALL) ranlib-msvc $(DESTDIR)/bin/ |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
166 $(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
|
167 $(INSTALL) -d $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
168 test -n "$(MSVCSTDINT)" || $(INSTALL) stdint.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
169 $(INSTALL) inttypes.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
170 $(INSTALL) unistd.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
171 $(INSTALL) stdbool.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
172 $(INSTALL) dirent.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
173 $(INSTALL) getopt.h $(DESTDIR)/include |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
174 $(INSTALL) math/msvcmath.h $(DESTDIR)/include/math.h |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
175 $(INSTALL) -d $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
176 $(INSTALL) dirent.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
177 $(INSTALL) getopt.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
178 $(INSTALL) compat/mingwcompat.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
179 $(INSTALL) math/msvcmath.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
180 $(INSTALL) gfortran-msvc.lib $(DESTDIR)/lib |
f8299bb6c872
Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
181 $(INSTALL) gfortran-msvc-static.lib $(DESTDIR)/lib |