Mercurial > dwindows
annotate makefile.mingw @ 2966:48cfd7cb37a6
Add MacOS signing support with environment variable: CODESIGNIDENTITY.
Remove the old code to attempt to sign it manually.
Instead just specify the signing identity in CODESIGNIDENTITY.
Most apps sign it in the "installer" rule, but since we don't have a DMG
installer rule for the library, we instead sign it in the finishup script.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 12 Mar 2023 22:34:00 +0000 |
parents | 33e77761703f |
children |
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 |
2956
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
4 CC = gcc |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
5 CXX = g++ |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
6 RM = rm -f |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
7 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
8 DEFS = |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
9 LIBS = |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
10 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
11 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
|
12 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
|
13 endif |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
14 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
15 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
|
16 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
|
17 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
|
18 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
|
19 else |
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_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
|
21 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
|
22 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
|
23 endif |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
24 |
2165
87d574dda8f5
Win: Remove workaround for massive warnings using older mingw compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1865
diff
changeset
|
25 # 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
|
26 # 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
|
27 # 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
|
28 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
|
29 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
|
30 |
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
|
31 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
|
32 OBJECTS = dw.o browser.o XBrowseForFolder.o |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
33 |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
34 VPATH=../ ../win |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
35 |
2956
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
36 all: dw.dll dwcompat.dll dwtest.exe dwtestoo.exe |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
37 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
38 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
|
39 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
|
40 |
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
41 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
|
42 $(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
|
43 -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
|
44 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
45 dwcompat.dll: $(COMPATOBJECTS) win/dwcompat-mingw.def |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
46 $(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
|
47 -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
|
48 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
49 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
|
50 windres --target=$(PLATFORM_TARGET) --input win/dwtest.rc --output dwtest.res --output-format=coff |
2956
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
51 |
1855
72a75442c51d
Updated MinGW makefile to support picking 32-bit or 64-bit based
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1842
diff
changeset
|
52 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
|
53 $(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
|
54 |
2956
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
55 dwtestoo.exe: dwtestoo.o dw.a dwcompat.a dwtest.res |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
56 $(CXX) $(CFLAGS) -o dwtestoo.exe dwtest.res dwtestoo.o dw.a dwcompat.a |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
57 |
1839
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
58 clean: |
22225eb286e5
Fixes for building with MINGW64 (specifically http://tdm-gcc.tdragon.net/).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1663
diff
changeset
|
59 $(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
|
60 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
61 dw.o: win/dw.c |
2958
33e77761703f
Win/C++: Get dwtestoo building with MinGW32 on Windows 2000.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2956
diff
changeset
|
62 $(CC) $(CFLAGS) -c $< |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
63 |
1856
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
64 browser.o: win/browser.c |
2958
33e77761703f
Win/C++: Get dwtestoo building with MinGW32 on Windows 2000.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2956
diff
changeset
|
65 $(CC) $(CFLAGS) -c $< |
1856
285bf986e4fd
Get HTML support building with MinGW... some warnings need to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1855
diff
changeset
|
66 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
67 XBrowseForFolder.o: win/XBrowseForFolder.cpp |
2958
33e77761703f
Win/C++: Get dwtestoo building with MinGW32 on Windows 2000.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2956
diff
changeset
|
68 $(CC) $(CFLAGS) -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
69 |
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
|
70 dwcompat.o: dwcompat.c |
2958
33e77761703f
Win/C++: Get dwtestoo building with MinGW32 on Windows 2000.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2956
diff
changeset
|
71 $(CC) $(CFLAGS) -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
72 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
73 dirent.o: win/dirent.c |
2958
33e77761703f
Win/C++: Get dwtestoo building with MinGW32 on Windows 2000.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2956
diff
changeset
|
74 $(CC) $(CFLAGS) -c $< |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
75 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1360
diff
changeset
|
76 dwtest.o: dwtest.c |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
77 $(CC) $(CFLAGS) -c $< |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
78 |
2956
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
79 dwtestoo.o: dwtestoo.cpp |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
80 $(CXX) -std=c++11 $(CFLAGS) -c $< |
afe9c20294ca
Win: Fix building dwtestoo with MinGW32/64. Need to use __cdecl in C++ mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
81 |
570
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
82 DEPS := $(wildcard *.d) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
83 ifneq ($(DEPS),) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
84 include $(DEPS) |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
85 endif |
052e9e4a59bd
MinGW support file
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
86 |