-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (116 loc) · 2.9 KB
/
Copy pathMakefile
File metadata and controls
132 lines (116 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
ifeq ($(BUILDTYPE),)
# On MSYS2 uname -s produces something like: MINGW64_NT-10.0-19045
# Strip the suffix off
OS := $(patsubst MINGW%,MINGW,$(shell uname -s))
buildtype_Darwin = osx
buildtype_Haiku = haiku
buildtype_MINGW = windows
BUILDTYPE := $(buildtype_$(OS))
ifeq ($(BUILDTYPE),)
BUILDTYPE := unix
endif
endif
export BUILDTYPE
OPTFLAGS = -g -O3
ifeq ($(BUILDTYPE),windows)
MINGW = x86_64-w64-mingw32-
CC = $(MINGW)gcc
CXX = $(MINGW)g++
CFLAGS += \
$(OPTFLAGS) \
-ffunction-sections \
-fdata-sections \
-Wno-attributes \
-Wa,-mbig-obj \
-static
CXXFLAGS += \
$(OPTFLAGS) \
-std=c++23 \
-Wno-deprecated-enum-float-conversion \
-Wno-deprecated-enum-enum-conversion \
-Wno-attributes \
-Wa,-mbig-obj \
-static
LDFLAGS += -Wl,--gc-sections -static
AR = $(MINGW)gcc-ar
PKG_CONFIG = $(MINGW)pkg-config --static
WINDRES = $(MINGW)windres
WX_CONFIG = /usr/i686-w64-mingw32/sys-root/mingw/bin/wx-config-3.0 --static=yes
NINJA = /bin/ninja
PROTOC = /mingw64/bin/protoc
PROTOC_SEPARATOR = ;
EXT = .exe
AB_SANDBOX = no
else
CFLAGS += \
$(OPTFLAGS) \
-I/opt/homebrew/include -I/usr/local/include \
-Wno-unknown-warning-option
CXXFLAGS += \
$(OPTFLAGS) \
-std=c++23 \
-I/opt/homebrew/include -I/usr/local/include \
-Wformat \
-Wformat-security \
-Wno-deprecated-enum-float-conversion \
-Wno-deprecated-enum-enum-conversion
LDFLAGS +=
AR = ar
PKG_CONFIG = pkg-config
ifeq ($(BUILDTYPE),osx)
CXXFLAGS += -fexperimental-library
else
LDFLAGS += -pthread
endif
endif
HOSTCC = gcc
HOSTCXX = g++ -std=c++20
HOSTCFLAGS += -g -O3
HOSTLDFLAGS =
REALOBJ = .obj
OBJ = $(REALOBJ)/$(BUILDTYPE)
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
# Special Windows settings.
#ifeq ($(OS), Windows_NT)
# EXT ?= .exe
# MINGWBIN = /mingw32/bin
# CCPREFIX = $(MINGWBIN)/
# PKG_CONFIG = $(MINGWBIN)/pkg-config
# WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes
# PROTOC = $(MINGWBIN)/protoc
# WINDRES = windres
# LDFLAGS += \
# -static
# CXXFLAGS += \
# -fext-numeric-literals \
# -Wno-deprecated-enum-float-conversion \
# -Wno-deprecated-enum-enum-conversion
#
# # Required to get the gcc run - time libraries on the path.
# export PATH := $(PATH):$(MINGWBIN)
#endif
# Special OSX settings.
ifeq ($(shell uname),Darwin)
LDFLAGS += \
-framework IOKit \
-framework AppKit \
-framework UniformTypeIdentifiers \
-framework UserNotifications
endif
.PHONY: all
all: +all README.md
.PHONY: binaries tests
binaries: all
tests: all
README.md: $(OBJ)/scripts/+mkdocindex/mkdocindex$(EXT)
@echo $(PROGRESSINFO)MKDOC $@
@csplit -s -f$(OBJ)/README. README.md '/<!-- FORMATSSTART -->/' '%<!-- FORMATSEND -->%'
@(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md
.PHONY: tests
clean::
$(hide) rm -rf $(REALOBJ)
include build/ab.mk
docker-%: tests/docker/Dockerfile.%
docker build --progress=plain -t $* -f $< .