-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile.devel
More file actions
65 lines (49 loc) · 1.71 KB
/
Makefile.devel
File metadata and controls
65 lines (49 loc) · 1.71 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
# -*- makefile -*-
# This is the developer's makefile.
# It obeys the environment variables CXX, CFLAGS and CXXFLAGS if you have set them.
GPERF = gperf
CMAKE = cmake
CTEST = ctest
MKDIR = mkdir
RM = rm
CXX ?= g++
CFLAGS := $(CFLAGS)
CXXFLAGS := $(CXXFLAGS) -Ilib
all : lib/generated \
lib/generated/check-encodings \
lib/generated/aliases.h \
lib/generated/indexes.hpp.shippet \
lib/generated/indexes.h.shippet
lib/generated :
$(MKDIR) -p lib/generated
lib/generated/check-encodings : tools/check-encodings.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@
./lib/generated/check-encodings
lib/generated/genaliases : tools/genaliases.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@
lib/generated/aliases.gperf : lib/generated/genaliases
./lib/generated/genaliases $@
lib/generated/aliases.h : lib/generated/aliases.gperf
$(GPERF) -L ANSI-C -m 10 $< > $@
lib/generated/genindexes : tools/genindexes.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@
lib/generated/indexes.hpp.shippet : lib/generated/genindexes
./lib/generated/genindexes C++ > $@
lib/generated/indexes.h.shippet : lib/generated/genindexes
./lib/generated/genindexes C > $@
test : all
$(RM) -r -f build tests/data/GB18030-2005.TXT tests/data/GB18030-2022.TXT tests/data/UTF-8.TXT
$(CMAKE) -B build -S . -DCMAKE_BUILD_TYPE=Debug
$(CMAKE) --build build --config Debug --target all -j $(shell nproc)
$(CTEST) --test-dir build --output-on-failure
# Alias to test
check : test
clean :
$(RM) -r -f build
$(RM) -r -f cppp-reiconv-*
$(RM) -r -f .cache
$(RM) -f lib/generated/aliases.gperf
$(RM) -f lib/generated/genaliases
$(RM) -f tests/data/GB18030-2005.TXT
$(RM) -f tests/data/GB18030-2022.TXT
$(RM) -f tests/data/UTF-8.TXT