Home

Awesome

deno.mk

Cross-platform Makefile for installing and running Deno.

Why should I use this?

How do I use it?

1. Download the Makefile

curl -O https://raw.githubusercontent.com/MarkTiedemann/deno.mk/master/deno.mk

2. Include it in your Makefile

There are two variables that can be set to configure the installation:

How to use the Makefile:

<!--begin-example-->
DENO_VERSION := 1.6.0
DENO_INSTALL := third_party
include deno.mk

.PHONY: all
all: $(DENO_BIN)
	$(call deno,run https://deno.land/std/examples/welcome.ts)
<!--end-example-->

3. Test your Makefile

MacOS & Linux:

<!--begin-macos-linux-->
$ make
mkdir -p third_party/deno-1.6.0/bin
curl -Lo third_party/deno-1.6.0/bin/deno.zip https://github.com/denoland/deno/releases/download/v1.6.0/deno-x86_64-apple-darwin.zip
tar xf third_party/deno-1.6.0/bin/deno.zip -C third_party/deno-1.6.0/bin
chmod +x third_party/deno-1.6.0/bin/deno
rm third_party/deno-1.6.0/bin/deno.zip
DENO_DIR=third_party/deno-1.6.0 third_party/deno-1.6.0/bin/deno run https://deno.land/std/examples/welcome.ts
Download https://deno.land/std/examples/welcome.ts
Check https://deno.land/std/examples/welcome.ts
Welcome to Deno!
$ make
DENO_DIR=third_party/deno-1.6.0 third_party/deno-1.6.0/bin/deno run https://deno.land/std/examples/welcome.ts
Welcome to Deno!
<!--end-macos-linux-->
$ tree
.
├── deno.mk
├── Makefile
└── third_party
    └── deno-$version
        ├── bin
        │   └── deno
        ├── deps
        │   └── ...
        └── gen
            └── ...

Windows:

<!--begin-windows-->
> make
md third_party\deno-1.6.0\bin
curl -Lo third_party\deno-1.6.0\bin\deno.zip https://github.com/denoland/deno/releases/download/v1.6.0/deno-x86_64-pc-windows-msvc.zip
tar xf third_party\deno-1.6.0\bin\deno.zip -C third_party\deno-1.6.0\bin
del /q third_party\deno-1.6.0\bin\deno.zip
set DENO_DIR=third_party\deno-1.6.0& third_party\deno-1.6.0\bin\deno.exe run https://deno.land/std/examples/welcome.ts
Download https://deno.land/std/examples/welcome.ts
Check https://deno.land/std/examples/welcome.ts
Welcome to Deno!
> make
set DENO_DIR=third_party\deno-1.6.0& third_party\deno-1.6.0\bin\deno.exe run https://deno.land/std/examples/welcome.ts
Welcome to Deno!
<!--end-windows-->

License

Blue Oak