Changeset 1324 for js/sdk/Makefile-SDK-Emscripten.mak
- Timestamp:
- 08/14/24 00:56:06 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
js/sdk/Makefile-SDK-Emscripten.mak
r865 r1324 1 1 # 2 2 # Framsticks SDK makefile for Emscripten builds 3 # 4 # Before 2020, this makefile could be used natively under Windows as well (see history if needed). 5 # However, now that the Windows Subsystem for Linux (WSL) exists, this file only supports Linux. 3 6 # 4 7 5 8 include frams/Makefile-SDK-files 6 9 10 # set this path based on the project directory structure 7 11 JS_PATH=../js/sdk 8 9 #Note: CURDIR needed because on linux, Emscripten does not differentiate between relative and absolute path, which causes shutil to raise Error("%s and %s are the same file" % (src, dst))10 ifeq ($(OS),Windows_NT)11 CACHE_DIR=cache-tmp12 else13 CACHE_DIR=$(CURDIR)/cache-tmp14 endif15 12 16 13 SDK_JS=$(JS_PATH)/frams-sdk.js … … 25 22 26 23 # same as in cpp/frams/Makefile-SDK: 27 CXXWARNINGS=-Wall -Wno-parentheses -Wno-overloaded-virtual -Wno-format -W error=return-type24 CXXWARNINGS=-Wall -Wno-parentheses -Wno-overloaded-virtual -Wno-format -Wno-invalid-offsetof -Werror=return-type 28 25 29 SDK_BUILD_CONFIG= -include frams/config/sdk_build_config.h 30 CACHE_DESTINATION= --cache $(CACHE_DIR) 31 CXXFLAGS= -I$(CURDIR) -std=gnu++11 -O3 $(SDK_BUILD_CONFIG) $(CXXWARNINGS) $(CACHE_DESTINATION) 26 SDK_BUILD_CONFIG= -include frams/config/sdk-build-config.h 27 CXXFLAGS= -I$(CURDIR) -std=gnu++17 -O3 $(SDK_BUILD_CONFIG) $(CXXWARNINGS) 28 29 # avoid "duplicate symbol" linking errors. Instead of this pipeline, could use the "uniq" function built in included gmsl, or define a recursive function to filter out duplicates while preserving the order of elements. Also consider "$^". 30 SDK_LIB_OBJS := $(shell echo $(SDK_LIB_OBJS) | tr ' ' '\n' | sort | uniq | tr '\n' ' ') 32 31 33 32 ############################################# 34 33 35 $(SDK_JS): $(I_IMPL_JS) $(I_IMPL_SRC) $(I_OBJ) $(SDK_BIN) 36 $(CXX) $(SDK_BIN) $(I_OBJ) --post-js $(I_IMPL_JS) -g4 --memory-init-file 0 -s FORCE_FILESYSTEM=1 -s ALIASING_FUNCTION_POINTERS=0 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=3 -s BINARYEN_ASYNC_COMPILATION=0 -s WASM=0 $(CACHE_DESTINATION) -o $@ 37 38 $(SDK_BIN): $(SDK_LIB_OBJS) 39 $(CXX) $(SDK_LIB_OBJS) $(LDFLAGS) $(CACHE_DESTINATION) -o $@ 34 $(SDK_JS): $(I_IMPL_JS) $(I_IMPL_SRC) $(I_OBJ) $(SDK_LIB_OBJS) 35 $(CXX) $(SDK_LIB_OBJS) $(I_OBJ) --post-js $(I_IMPL_JS) -O3 -s FORCE_FILESYSTEM=1 -s ALIASING_FUNCTION_POINTERS=0 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=3 -s BINARYEN_ASYNC_COMPILATION=0 -sWASM=0 -o $@ 40 36 41 37 $(I_IMPL_SRC) $(I_IMPL_JS): $(I_IDL) 42 python $(EMSCRIPTEN)/tools/webidl_binder.py $(I_IDL) $(I_PATH)/js_interface_impl38 python3 $(EMSCRIPTEN)/tools/webidl_binder.py $(I_IDL) $(I_PATH)/js_interface_impl 43 39 44 40 ############################################# 45 41 42 include common/Makefile-maintain 46 43 47 full_clean: 48 ifeq ($(OS),Windows_NT) 49 del /s /q WebIDLGrammar.pkl parser.out *.o 50 rmdir /s /q $(CACHE_DIR) 51 else 52 rm -f WebIDLGrammar.pkl parser.out $(SDK_LIB_OBJS) 53 rm -rf $(CACHE_DIR) 54 endif 44 full_clean: clean 45 rm -f WebIDLGrammar.pkl parser.out $(I_OBJ) $(I_IMPL_SRC) $(I_IMPL_JS) $(SDK_BIN) $(SDK_JS)
Note: See TracChangeset
for help on using the changeset viewer.