10
|
1 # Project: gvimext
|
|
2 # Generates gvimext.dll with gcc.
|
|
3 # Can be used for Cygwin and MingW (MingW ignores -mno-cygwin)
|
|
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
|
|
20 ifeq ($(CROSS),yes)
|
89
|
21 DEL = rm
|
10
|
22 ifeq ($(MINGWOLD),yes)
|
|
23 CXX = i586-mingw32msvc-g++
|
|
24 CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks
|
|
25 WINDRES = i586-mingw32msvc-windres
|
|
26 else
|
|
27 CXX = i386-mingw32msvc-g++
|
|
28 CXXFLAGS := -O2 -mno-cygwin
|
|
29 WINDRES = i386-mingw32msvc-windres
|
|
30 endif
|
|
31 else
|
12
|
32 CXX := g++
|
|
33 WINDRES := windres
|
10
|
34 CXXFLAGS := -O2 -mno-cygwin
|
89
|
35 ifneq (sh.exe, $(SHELL))
|
|
36 DEL = rm
|
|
37 else
|
|
38 DEL = del
|
|
39 endif
|
10
|
40 endif
|
|
41 LIBS := -luuid
|
|
42 RES := gvimext.res
|
|
43 DEFFILE = gvimext_ming.def
|
|
44 OBJ := gvimext.o
|
|
45
|
|
46 DLL := gvimext.dll
|
|
47
|
|
48 .PHONY: all all-before all-after clean clean-custom
|
|
49
|
|
50 all: all-before $(DLL) all-after
|
|
51
|
|
52 $(DLL): $(OBJ) $(RES) $(DEFFILE)
|
|
53 $(CXX) -shared $(CXXFLAGS) -s -o $@ \
|
|
54 -Wl,--enable-auto-image-base \
|
|
55 -Wl,--enable-auto-import \
|
|
56 -Wl,--whole-archive \
|
|
57 $^ \
|
|
58 -Wl,--no-whole-archive \
|
|
59 $(LIBS)
|
|
60
|
|
61 gvimext.o: gvimext.cpp
|
|
62 $(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@
|
|
63
|
|
64 $(RES): gvimext_ming.rc
|
|
65 $(WINDRES) --input-format=rc --output-format=coff -DMING $? -o $@
|
|
66
|
|
67 clean: clean-custom
|
89
|
68 -$(DEL) $(OBJ) $(RES) $(DLL)
|
10
|
69
|