-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile
71 lines (57 loc) · 2.27 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
.PHONY: build build/game build/game_gen build/dict
MAKE_FLAGS=-j $$(nproc)
# ---------------------------------------------------------------------------- #
# Complete build script.
# ---------------------------------------------------------------------------- #
build:
# Build React Page
make $(MAKE_FLAGS) clean
make $(MAKE_FLAGS) build/game
# Remove Developer games
rm -rf build/dict/**
# Build Dictionaries
make $(MAKE_FLAGS) build/game_gen
make $(MAKE_FLAGS) build/dict DICT=da-DK
mv out build/dict/da-DK
make $(MAKE_FLAGS) build/dict DICT=de-DE
mv out build/dict/de-DE
make $(MAKE_FLAGS) build/dict DICT=en-US
mv out build/dict/en-US
make $(MAKE_FLAGS) build/dict DICT=es-ES
mv out build/dict/es-ES
# Add CNAME record
# https://stackoverflow.com/questions/9082499/custom-domain-for-github-project-pages
echo "wordrow.io" > build/CNAME
# ---------------------------------------------------------------------------- #
# Build React application.
# ---------------------------------------------------------------------------- #
build/game:
cd game && npm install
cd game && npm run build
mv ./game/build ./build
# ---------------------------------------------------------------------------- #
# Build Anatree and Dictionary parser.
# ---------------------------------------------------------------------------- #
build/game_gen:
mkdir -p game_gen/build/
cd game_gen/build/ && cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_C_FLAGS=$(O2_FLAGS) \
-D CMAKE_CXX_FLAGS=$(O2_FLAGS) \
..
cd game_gen/build/ && make $(MAKE_FLAGS) anagrams
# ---------------------------------------------------------------------------- #
# Build .json files for the games for the given language.
# ---------------------------------------------------------------------------- #
build/dict: MIN := 3
build/dict: MAX := 6
build/dict: DICT := da-DK
build/dict:
mkdir -p out/
rm -f ./out/*.json
./game_gen/build/src/anagrams $(MIN) $(MAX) ./dict/$(DICT)/$(DICT).txt
# ---------------------------------------------------------------------------- #
# Remove all build files.
# ---------------------------------------------------------------------------- #
clean:
rm -rf ./build
rm -rf ./out