-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
80 lines (70 loc) · 1.82 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
export BUILDTYPE ?= unix
ifeq ($(BUILDTYPE),windows)
MINGW = i686-w64-mingw32-
CC = $(MINGW)gcc
CXX = $(MINGW)g++ -std=c++17
CFLAGS += \
-ffunction-sections \
-fdata-sections \
-Wno-attributes
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
MAKENSIS = makensis
EXT = .exe
else
export CC = gcc
export CXX = g++ -std=c++20
export CFLAGS
export CXXFLAGS
export LDFLAGS
export AR = ar
export PKG_CONFIG = pkg-config
endif
CFLAGS += -g -Os -ffunction-sections -fdata-sections
CXXFLAGS = $(CFLAGS) --std=c++17
LDFLAGS += -ffunction-sections -fdata-sections
export PREFIX = /usr/local
export REALOBJ = .obj
export OBJ = $(REALOBJ)/$(BUILDTYPE)
.PHONY: all
all: +all
clean::
$(hide) rm -rf $(REALOBJ)
.PHONY: install
install: +all
test -f bin/wordgrinder && cp bin/wordgrinder $(PREFIX)/bin/wordgrinder
test -f bin/wordgrinder.1 && cp bin/wordgrinder.1 $(PREFIX)/man/man1/wordgrinder.1
test -f bin/xwordgrinder && cp bin/xwordgrinder $(PREFIX)/bin/xwordgrinder
test -f bin/xwordgrinder.1 && cp bin/wordgrinder.1 $(PREFIX)/man/man1/xwordgrinder.1
.PHONY: debian-distr
debian-distr: bin/wordgrinder-minimal-dependencies-for-debian.tar.xz
.PHONY: bin/wordgrinder-minimal-dependencies-for-debian.tar.xz
bin/wordgrinder-minimal-dependencies-for-debian.tar.xz:
@echo Make Debian distribution
$(hide) mkdir -p $(dir $@)
$(hide) tar cvaf $@ \
--transform "s,^,wordgrinder-$(VERSION)/," \
--exclude "*.dictionary" \
Makefile \
README \
README.Windows.txt \
README.wg \
build.py \
config.py \
extras \
licenses \
scripts \
src \
testdocs \
tests \
third_party/luau \
tools \
wordgrinder.man \
xwordgrinder.man
include build/ab.mk