-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathMakefile
110 lines (92 loc) · 2.24 KB
/
Makefile
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
ifeq ($(BUILDTYPE),)
buildtype_Darwin = osx
buildtype_Haiku = haiku
BUILDTYPE := $(buildtype_$(shell uname -s ))
ifeq ($(BUILDTYPE),)
BUILDTYPE := unix
endif
endif
export BUILDTYPE
ifeq ($(BUILDTYPE),windows)
MINGW = i686-w64-mingw32-
CC = $(MINGW)gcc
CXX = $(MINGW)g++ -std=c++17
CFLAGS += -g -O3
CXXFLAGS += \
-fext-numeric-literals \
-Wno-deprecated-enum-float-conversion \
-Wno-deprecated-enum-enum-conversion
LDFLAGS += -static
AR = $(MINGW)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
EXT = .exe
else
CC = gcc
CXX = g++ -std=c++17
CFLAGS = -g -O3
LDFLAGS =
AR = ar
PKG_CONFIG = pkg-config
ifeq ($(BUILDTYPE),osx)
else
LDFLAGS += -pthread -Wl,--no-as-needed
endif
endif
HOSTCC = gcc
HOSTCXX = g++ -std=c++17
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 Foundation
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
DOCKERFILES = \
debian11 \
debian12 \
fedora40 \
fedora41 \
manjaro
docker-%: tests/docker/Dockerfile.%
docker build -t $* -f $< .
.PHONY: dockertests
dockertests: $(foreach f,$(DOCKERFILES), docker-$(strip $f) .WAIT)