-
Notifications
You must be signed in to change notification settings - Fork 0
/
Web_Makefile
52 lines (45 loc) · 2.52 KB
/
Web_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
# This file is part of weak-lang.
# weak-lang is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# weak-lang 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 Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with weak-lang. If not, see <https://www.gnu.org/licenses/>.
CXX=emcc
CXXFLAGS=-std=c++20 -g -fstandalone-debug -Iinclude/ -Iinclude/CBLAS/include/ -DWEB_TARGET -fexceptions
weak: web_bin/weak
tests: web_bin/tests
web_bin/weak: web_bin/main.o web_bin/lexer.o web_bin/error.o web_bin/stmt.o web_bin/token.o web_bin/expr.o web_bin/parser.o web_bin/environment.o web_bin/variable.o
$(CXX) $(CXXFLAGS) $^ -o [email protected] -s EXPORTED_FUNCTIONS='["_execute_program", "_main", "_free"]' -s EXPORTED_RUNTIME_METHODS='["ccall","cwrap", "intArrayFromString", "UTF8ToString", "ExceptionInfo"]' -s ENVIRONMENT=web -s WASM=0 -s NO_DISABLE_EXCEPTION_CATCHING
web_bin/main.o: src/main.cpp include/lexer.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/lexer.o: src/lexer.cpp include/lexer.hpp include/token.hpp include/error.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/error.o: src/error.cpp include/error.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/util.o: src/util.cpp include/util.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/token.o: src/token.cpp include/token.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/stmt.o: src/stmt.cpp include/stmt.hpp include/token.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/expr.o: src/expr.cpp include/expr.hpp include/token.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/parser.o: src/parser.cpp include/parser.hpp include/token.hpp include/stmt.hpp include/expr.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/environment.o: src/environment.cpp include/environment.hpp include/variable.hpp include/parser.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/variable.o: src/variable.cpp include/variable.hpp
$(CXX) $(CXXFLAGS) $< -c -o $@
web_bin/tests: web_bin/catch.o tests/tests.cc src/lexer.cpp src/token.cpp src/error.cpp src/stmt.cpp src/expr.cpp src/parser.cpp src/util.cpp src/environment.cpp src/variable.cpp
$(CXX) $(CXXFLAGS) $^ -o $@ $(LFLAGS)
web_bin/catch.o: tests/catch.cc
$(CXX) $(CXXFLAGS) -c $^ -o $@
.DEFAULT_GOAL := weak
.PHONY: clean weak
clean:
rm -rf web_bin/*