Mercurial > vim
annotate src/GvimExt/Make_ming.mak @ 29134:cc1f2ef46aaa v8.2.5087
patch 8.2.5087: cannot build with clang on MS-Windows
Commit: https://github.com/vim/vim/commit/1630bd980a1f7f62adc6f73cb20be66a3c382225
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Jun 14 12:30:25 2022 +0100
patch 8.2.5087: cannot build with clang on MS-Windows
Problem: Cannot build with clang on MS-Windows.
Solution: Add support for building with clang. (Yegappan Lakshmanan,
closes #10557)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Jun 2022 13:45:03 +0200 |
parents | 0660cb0a1cd8 |
children | 360f286b5869 |
rev | line source |
---|---|
10 | 1 # Project: gvimext |
2 # Generates gvimext.dll with gcc. | |
7602
a82b2d79e61b
commit https://github.com/vim/vim/commit/abfa9efb983c6fe9f5c4c342ff4d7017ce9a2c4b
Christian Brabandt <cb@256bit.org>
parents:
6811
diff
changeset
|
3 # To be used with MingW and Cygwin. |
10 | 4 # |
5 # Originally, the DLL base address was fixed: -Wl,--image-base=0x1C000000 | |
6 # Now it is allocated dymanically by the linker by evaluating all DLLs | |
7 # already loaded in memory. The binary image contains as well information | |
8 # for automatic pseudo-rebasing, if needed by the system. ALV 2004-02-29 | |
9 | |
10 # If cross-compiling set this to yes, else set it to no | |
11 CROSS = no | |
12 #CROSS = yes | |
13 # For the old MinGW 2.95 (the one you get e.g. with debian woody) | |
14 # set the following variable to yes and check if the executables are | |
15 # really named that way. | |
16 # If you have a newer MinGW or you are using cygwin set it to no and | |
17 # check also the executables | |
18 MINGWOLD = no | |
19 | |
2674 | 20 # Link against the shared versions of libgcc/libstdc++ by default. Set |
21 # STATIC_STDCPLUS to "yes" to link against static versions instead. | |
22 STATIC_STDCPLUS=no | |
23 #STATIC_STDCPLUS=yes | |
24 | |
25 # Note: -static-libstdc++ is not available until gcc 4.5.x. | |
26 LDFLAGS += -shared | |
27 ifeq (yes, $(STATIC_STDCPLUS)) | |
28 LDFLAGS += -static-libgcc -static-libstdc++ | |
29 endif | |
30 | |
10 | 31 ifeq ($(CROSS),yes) |
89 | 32 DEL = rm |
10 | 33 ifeq ($(MINGWOLD),yes) |
3110 | 34 CXXFLAGS := -O2 -fvtable-thunks |
10 | 35 else |
3110 | 36 CXXFLAGS := -O2 |
10 | 37 endif |
38 else | |
3110 | 39 CXXFLAGS := -O2 |
89 | 40 ifneq (sh.exe, $(SHELL)) |
41 DEL = rm | |
42 else | |
43 DEL = del | |
44 endif | |
10 | 45 endif |
8434
a0e7d7070799
commit https://github.com/vim/vim/commit/47cff3a444be7e99bae52b39b2174c22d58d2f86
Christian Brabandt <cb@256bit.org>
parents:
7602
diff
changeset
|
46 # Set the default $(WINVER) to make it work with WinXP. |
a0e7d7070799
commit https://github.com/vim/vim/commit/47cff3a444be7e99bae52b39b2174c22d58d2f86
Christian Brabandt <cb@256bit.org>
parents:
7602
diff
changeset
|
47 ifndef WINVER |
a0e7d7070799
commit https://github.com/vim/vim/commit/47cff3a444be7e99bae52b39b2174c22d58d2f86
Christian Brabandt <cb@256bit.org>
parents:
7602
diff
changeset
|
48 WINVER = 0x0501 |
a0e7d7070799
commit https://github.com/vim/vim/commit/47cff3a444be7e99bae52b39b2174c22d58d2f86
Christian Brabandt <cb@256bit.org>
parents:
7602
diff
changeset
|
49 endif |
2088 | 50 CXX := $(CROSS_COMPILE)g++ |
2674 | 51 WINDRES := $(CROSS_COMPILE)windres |
23733
0660cb0a1cd8
patch 8.2.2408: MinGW: "--preprocessor" flag no longer supported
Bram Moolenaar <Bram@vim.org>
parents:
8434
diff
changeset
|
52 # this used to have --preprocessor, but it's no longer supported |
0660cb0a1cd8
patch 8.2.2408: MinGW: "--preprocessor" flag no longer supported
Bram Moolenaar <Bram@vim.org>
parents:
8434
diff
changeset
|
53 WINDRES_FLAGS = |
6811 | 54 LIBS := -luuid -lgdi32 |
10 | 55 RES := gvimext.res |
29134
cc1f2ef46aaa
patch 8.2.5087: cannot build with clang on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
23733
diff
changeset
|
56 ifeq ($(findstring clang++,$(CXX)),) |
10 | 57 DEFFILE = gvimext_ming.def |
29134
cc1f2ef46aaa
patch 8.2.5087: cannot build with clang on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
23733
diff
changeset
|
58 endif |
10 | 59 OBJ := gvimext.o |
60 | |
61 DLL := gvimext.dll | |
62 | |
63 .PHONY: all all-before all-after clean clean-custom | |
64 | |
65 all: all-before $(DLL) all-after | |
66 | |
67 $(DLL): $(OBJ) $(RES) $(DEFFILE) | |
2674 | 68 $(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \ |
10 | 69 -Wl,--enable-auto-image-base \ |
70 -Wl,--enable-auto-import \ | |
71 -Wl,--whole-archive \ | |
72 $^ \ | |
73 -Wl,--no-whole-archive \ | |
74 $(LIBS) | |
75 | |
76 gvimext.o: gvimext.cpp | |
8434
a0e7d7070799
commit https://github.com/vim/vim/commit/47cff3a444be7e99bae52b39b2174c22d58d2f86
Christian Brabandt <cb@256bit.org>
parents:
7602
diff
changeset
|
77 $(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) -c $? -o $@ |
10 | 78 |
79 $(RES): gvimext_ming.rc | |
2674 | 80 $(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@ |
10 | 81 |
82 clean: clean-custom | |
89 | 83 -$(DEL) $(OBJ) $(RES) $(DLL) |