-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
151 lines (127 loc) · 3.89 KB
/
Makefile.in
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#
# Copyright (C) 2017-2020, Thomas Maier-Komor
#
# This file belongs to Wire-Format-Compiler.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
CC = @CC@
CXX = @CXX@
LEX = @LEX@
YACC = @YACC@
SED = @SED@
HG = @HG@
DIFF = @DIFF@
RM = @RM@
MV = @MV@
XXD = @XXD@
MKDIR = @MKDIR@
INSTALL = @INSTALL@
PREFIX = @prefix@
BETA = @BETA@
SHAREFILES =$(shell hg st --all share | awk '/^[CAM]/{print $$2}')
INCFILES =$(shell hg st --all include | awk '/^[CAM]/{print $$2}')
INCDIRS =
DEFS = $(BETA)
CFLAGS = $(DEFS) $(INCDIRS)
CXXFLAGS = -std=c++11 $(DEFS) $(INCDIRS)
LIBS =
export CC CFLAGS CXX CXXFLAGS DEFS LDFLAGS LIBS OBJDIR DIFF RELEASE YACC INSTALL SED LEX HG XXD
default: release
dist:
$(MAKE) distclean
+$(MAKE) release
+$(MAKE) mingw
$(MAKE) -C src doc
$(MAKE) tar
prepare: bin
debug:DEFS +=-DDEBUG -DYYDEBUG=1
debug:CFLAGS += -g -Wall
debug:CXXFLAGS +=-g -Wall
debug:LIBS +=-lpthread
debug:OBJDIR =../obj-g
debug: prepare
+$(MAKE) -C src -e ../bin/wfc
release:CFLAGS +=-O2
release:CXXFLAGS+=-O2
release:LIBS +=-lpthread
release:LDFLAGS +=-Wl,-s
release:OBJDIR =../obj-r
release: prepare
+$(MAKE) -C src -e ../bin/wfc
clang:CC =clang
clang:CXX =clang++
clang:CFLAGS +=-O2
clang:CXXFLAGS +=-O2
clang:LIBS +=-lpthread
clang:OBJDIR =../obj-c
clang: prepare
+$(MAKE) -C src -e ../bin/wfc
tcov:CFLAGS += -fprofile-arcs -ftest-coverage
tcov:CXXFLAGS += -fprofile-arcs -ftest-coverage
tcov:LIBS +=-lpthread
tcov:OBJDIR =../obj-t
tcov: prepare
+$(MAKE) -C src -e ../bin/wfc
prof:CFLAGS += -pg -O2
prof:CXXFLAGS += -pg -O2
prof:LIBS +=-lpthread
prof:OBJDIR =../obj-p
prof: prepare
+$(MAKE) -C src -e ../bin/wfc
mingw:CC =i686-w64-mingw32-gcc
mingw:CXX =$(shell which i686-w64-mingw32-g++-posix || echo i686-w64-mingw32-g++)
mingw:CXXFLAGS +=-g -O2 -fstack-protector-all
mingw:INCDIRS =
mingw:LDFLAGS =-static -static-libgcc -static-libstdc++ -Wl,-Bstatic,--nxcompat,--dynamicbase,--export-all-symbols,-s
mingw:LIBS =-liphlpapi -lws2_32 #-lwsock32
mingw:OBJDIR =../obj-m32
mingw: prepare
+$(MAKE) -C src -e ../bin/wfc.exe
mingw64:CC =x86_64-w64-mingw32-gcc
mingw64:CXX =$(shell which x86_64-w64-mingw32-g++-posix || echo x86_64-w64-mingw32-g++)
mingw64:CXXFLAGS+=-g -O2 -fno-keep-inline-dllexport -fstack-protector-all
mingw64:INCDIRS =
mingw64:LDFLAGS =-static -static-libgcc -static-libstdc++ -Wl,-Bstatic,--nxcompat -Wl,--dynamicbase,--export-all-symbols,-s
mingw64:LIBS =-liphlpapi -lws2_32 #-lwsock32
mingw64:OBJDIR =../obj-m64
mingw64: prepare
+$(MAKE) -C src -e ../bin/wfc.exe
# job server will not be used by testsuite this way
# please start test-suite manually
test:
cd testsuite; bash ./runtests.sh
bin:
mkdir bin
always:
clean:
-rm -r obj-g obj-r obj-m obj-c obj-t src/.depend
distclean: clean
-$(RM) bin/wfc bin/wfc.exe
-$(MAKE) -C tests clean
docs:
$(MAKE) -C doc
doc/wfc.pdf:
$(MAKE) -C doc
install:
-$(MKDIR) -p $(PREFIX)/bin
if [ -x bin/wfc ]; then $(INSTALL) bin/wfc $(PREFIX)/bin; elif [ -x bin/wfc.exe ]; then $(INSTALL) bin/wfc.exe $(PREFIX)/bin; else echo "build binary before installing"; exit 1; fi
-$(MKDIR) -p $(PREFIX)/share
$(INSTALL) -m0644 share/* $(PREFIX)/share
-$(MKDIR) -p $(PREFIX)/include
$(INSTALL) -m0644 include/* $(PREFIX)/include
-$(MKDIR) -p $(PREFIX)/doc
-$(INSTALL) -m0644 doc/wfc.pdf $(PREFIX)/doc
-$(MKDIR) -p $(PREFIX)/man/man1
-$(INSTALL) -m0644 doc/wfc.1 $(PREFIX)/man/man1