Skip to content

Commit

Permalink
add make example
Browse files Browse the repository at this point in the history
  • Loading branch information
bates64 committed May 31, 2024
1 parent 0485e6a commit 682ce42
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/cmake/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Minimal Cheerp CMake example
# Cheerp + CMake

[![Discord server](https://img.shields.io/discord/988743885121548329?color=%237289DA&logo=discord&logoColor=ffffff)](https://discord.gg/3UfTSbWdYy)

Expand Down
2 changes: 2 additions & 0 deletions examples/make/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js
*.wasm
15 changes: 15 additions & 0 deletions examples/make/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ifeq ($(OS),Windows_NT)
CHEERP ?= C:/cheerp
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CHEERP ?= /opt/cheerp
else ifeq ($(UNAME_S),Darwin)
CHEERP ?= /Applications/cheerp
endif
endif

%.js: %.cpp
${CHEERP}/bin/clang++ $< -o $@

main.js:
9 changes: 9 additions & 0 deletions examples/make/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Cheerp + Make

This example shows how to use Make and Cheerp together.

## Usage

```sh
$ make
```
3 changes: 3 additions & 0 deletions examples/make/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
void webMain() {
// ...
}

0 comments on commit 682ce42

Please sign in to comment.