Make

How to use Make with Cheerp

To integrate Cheerp into a project that uses Make, you have two options.

Override CC and CXX

For well-behaved Make projects, you can override the CC and CXX variables to use Cheerp instead:

Terminal window
$ make CC=/opt/cheerp/bin/clang CXX=/opt/cheerp/bin/clang++

Makefile snippet

To permanently make a Makefile use Cheerp, add this snippet:

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 $@

Example

View full example
Was this page helpful?
Suggest changes