Mercurial > dwindows
annotate makefile.mingw @ 2323:4b04943319c5
GTK4: Move a few more functions into thread safety. Add API to functions
that were missing it. API is used for speficying calling convention, that
isn't usually required on Unix, but should be there for future use. The
thread safety macros will automatically add API, so just required to add it
to ones not in the thread safety system.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 17 Feb 2021 06:21:27 +0000 |
parents | e7060d262939 |
children | afe9c20294ca |
rev | line source |
---|---|
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
2 # Dynamic Windows MINGW Makefile |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
3 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
4 CC = gcc |
1839
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
5 RM = del /f |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
6 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
7 DEFS = |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
8 LIBS = |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
9 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
10 ifndef TARGET_CPU |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
11 TARGET_CPU=x86 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
12 endif |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
13 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
14 ifeq ($(TARGET_CPU), x86) |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
15 PLATFORM_DEF=-DWIN32 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
16 PLATFORM_CFLAGS=-m32 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
17 PLATFORM_TARGET=pe-i386 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
18 else |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
19 PLATFORM_DEF=-DWIN64 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
20 PLATFORM_CFLAGS=-m64 |
1865
43c6ecfc598a
It seems WIN64 is defined in 32-bit mode using MinGW... so switch
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1857
diff
changeset
|
21 PLATFORM_TARGET=pe-x86-64 -DDW64 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
22 endif |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
23 |
2165
87d574dda8f5
Win: Remove workaround for massive warnings using older mingw compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1865
diff
changeset
|
24 # Had to add -Wno-unused-value due to every Win32 macro generating this warning... |
1842
123d1a900f54
More MINGW cleanups... eliminate a few more warnings and disable the unused-value warning due to unfixable warnings generated by the Win32 macros.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1839
diff
changeset
|
25 # GCC has marked this as WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900 |
2165
87d574dda8f5
Win: Remove workaround for massive warnings using older mingw compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1865
diff
changeset
|
26 # This seems to be fixed in Mingw-w64 8.1 readd the option below if using an old compiler |
2236
e7060d262939
Win: Switched to using Rich Edit MLE by default on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2165
diff
changeset
|
27 CFLAGS = -O -g -DMSVC $(PLATFORM_DEF) $(PLATFORM_CFLAGS) -D__WIN32__ -DBUILD_DLL -DGDIPLUS -DRICHEDIT -DTOOLBAR -DUNICODE -D_UNICODE -DISOLATION_AWARE_ENABLED=1 -I./win -I. -I./platform -Wall -mthreads -o $(@) |
1856
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
28 LDFLAGS = -shared -mwindows -mthreads -lcomctl32 -lole32 -loleaut32 -luserenv -lmsimg32 -lgdiplus -luuid |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
29 |
1594
6baf177f335c
Rename compat.c/h dwcompat.c/h and configure option to --with-dwcompat.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1532
diff
changeset
|
30 COMPATOBJECTS = dwcompat.o dirent.o |
1856
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
31 OBJECTS = dw.o browser.o XBrowseForFolder.o |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
32 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
33 VPATH=../ ../win |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
34 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
35 all: dw.dll dwcompat.dll dwtest.exe |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
36 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
37 dw.res: win/dw.rc |
1865
43c6ecfc598a
It seems WIN64 is defined in 32-bit mode using MinGW... so switch
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1857
diff
changeset
|
38 windres --target=$(PLATFORM_TARGET) --input win/dw.rc --output dw.res --output-format=coff |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
39 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
40 dw.dll: $(OBJECTS) win/dw-mingw.def dw.res |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
41 $(CC) $(CFLAGS) $(DEFS) -o dw.dll dw.res $(OBJECTS) $(LDFLAGS) \ |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
42 -Wl,--out-implib,dw.a -Wl,-Map,dw.dll.map -Wl,--cref -Wl,--enable-stdcall-fixup win/dw-mingw.def |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
43 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
44 dwcompat.dll: $(COMPATOBJECTS) win/dwcompat-mingw.def |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
45 $(CC) $(CFLAGS) $(DEFS) -o dwcompat.dll $(COMPATOBJECTS) $(LDFLAGS) -lwsock32 \ |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
46 -Wl,--out-implib,dwcompat.a -Wl,-Map,dwcompat.dll.map -Wl,--cref -Wl,--enable-stdcall-fixup win/dwcompat-mingw.def |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
47 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
48 dwtest.res: win/dwtest.rc |
1865
43c6ecfc598a
It seems WIN64 is defined in 32-bit mode using MinGW... so switch
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1857
diff
changeset
|
49 windres --target=$(PLATFORM_TARGET) --input win/dwtest.rc --output dwtest.res --output-format=coff |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
50 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
51 dwtest.exe: dwtest.o dw.a dwcompat.a dwtest.res |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
52 $(CC) $(CFLAGS) -o dwtest.exe dwtest.res dwtest.o dw.a dwcompat.a |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
53 |
1839
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
54 clean: |
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
55 $(RM) *.obj *.o *.lib *.res *~ dwtest.exe dw.dll dwcompat.dll SVN.REV |
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
56 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
57 dw.o: win/dw.c |
1663
a76fb5f1a6c8
Fixes for building in Unicode mode with MinGW on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1594
diff
changeset
|
58 $(CC) $(CFLAGS) -DBUILD_DLL -c $< |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
59 |
1856
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
60 browser.o: win/browser.c |
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
61 $(CC) $(CFLAGS) -DBUILD_DLL -c $< |
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
62 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
63 XBrowseForFolder.o: win/XBrowseForFolder.cpp |
1663
a76fb5f1a6c8
Fixes for building in Unicode mode with MinGW on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1594
diff
changeset
|
64 $(CC) $(CFLAGS) -DBUILD_DLL -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
65 |
1594
6baf177f335c
Rename compat.c/h dwcompat.c/h and configure option to --with-dwcompat.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1532
diff
changeset
|
66 dwcompat.o: dwcompat.c |
1663
a76fb5f1a6c8
Fixes for building in Unicode mode with MinGW on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1594
diff
changeset
|
67 $(CC) $(CFLAGS) -DBUILD_DLL -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
68 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
69 dirent.o: win/dirent.c |
1663
a76fb5f1a6c8
Fixes for building in Unicode mode with MinGW on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1594
diff
changeset
|
70 $(CC) $(CFLAGS) -DBUILD_DLL -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
71 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
72 dwtest.o: dwtest.c |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
73 $(CC) $(CFLAGS) -c $< |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
74 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
75 DEPS := $(wildcard *.d) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
76 ifneq ($(DEPS),) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
77 include $(DEPS) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
78 endif |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
79 |