-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (39 loc) · 1.38 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
# Default command-line flags
CL_FLAGS ?=
# Compiler settings
CXX := g++
CXXFLAGS_DEBUG := -g -Wall -Wextra -pedantic
CXXFLAGS_OPTIMIZED := -Ofast
CXXFLAGS_PUBLISH := -Ofast -static-libgcc -static-libstdc++
# Source files and output name
SRC_FILES := src/main.cpp
OUTPUT := JuulesPlusPlus
OUTPUT_DIR := bin
# Compile the source files with debugging information
debug:
@echo Compiling debugging program...
$(CXX) $(CXXFLAGS_DEBUG) -o $(OUTPUT_DIR)/$(OUTPUT)_debug $(SRC_FILES)
@echo Done!
# Compile with optimizations
optimized:
@echo Compiling optimized program...
$(CXX) $(CXXFLAGS_OPTIMIZED) -o $(OUTPUT_DIR)/$(OUTPUT)_optimized $(SRC_FILES)
@echo Done!
# Compile with optimizations and dependencies
publish:
@echo Compiling published program...
$(CXX) $(CXXFLAGS_PUBLISH) -o $(OUTPUT_DIR)/$(OUTPUT) $(SRC_FILES)
@echo Done!
# Compile and run
run: optimized
@echo Running program...
@$(OUTPUT_DIR)/$(OUTPUT)_optimized $(CL_FLAGS)
webassembly:
@echo Compiling to WebAssembly...
emcc -O3 src/web_build.cpp -o web/JuulesPlusPlus.js \
-s EXPORTED_FUNCTIONS=_setup,_make_move,_engine_move,_valid_move,_valid_targets,_make_move_str,_is_checkmate \
-s EXPORTED_RUNTIME_METHODS=ccall,cwrap,UTF8ToString \
-s MODULARIZE=1 \
-s WASM=1 \
-s WASM_BIGINT=1 \
-s TOTAL_STACK=512mb