Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. CC = /opt/wasi-sdk/bin/clang
  4. APP_DIR = ${shell pwd}
  5. IWASM_DIR = ../../../../core/iwasm
  6. APP_FRAMEWORK_DIR = ../../../../core/app-framework
  7. DEPS_DIR = ../../../../core/deps
  8. CFLAGS += -O3 \
  9. -Wno-int-conversion \
  10. -I$(APP_DIR)/src \
  11. -I$(APP_FRAMEWORK_DIR)/base/app \
  12. -I$(APP_FRAMEWORK_DIR)/app-native-shared \
  13. -I$(APP_FRAMEWORK_DIR)/sensor/app \
  14. -I$(APP_FRAMEWORK_DIR)/wgl/app \
  15. -I$(APP_FRAMEWORK_DIR)/connection/app \
  16. -I${DEPS_DIR}
  17. SRCS += $(APP_DIR)/src/main.c
  18. # For app size consideration, not all but necessary app libs are included
  19. SRCS += $(APP_FRAMEWORK_DIR)/base/app/timer.c
  20. SRCS += $(APP_FRAMEWORK_DIR)/wgl/app/src/*.c
  21. all:
  22. @$(CC) $(CFLAGS) $(SRCS) \
  23. --target=wasm32 -O3 -z stack-size=2048 -Wl,--initial-memory=65536 \
  24. -Wl,--allow-undefined \
  25. -Wl,--no-threads,--strip-all,--no-entry -nostdlib \
  26. -Wl,--export=on_init -Wl,--export=on_timer_callback \
  27. -Wl,--export=on_widget_event \
  28. -Wl,--export=__heap_base,--export=__data_end \
  29. -o ui_app.wasm