-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
57 lines (42 loc) · 1.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.PHONY: quickbuild quickrun run clean
RACKS_FLAGS = --enable-self-tail --enable-flatten-if --js-beautify
RACKS_APP_FLAGS = --skip-arity-checks
RACKS_EXAMPLE_FLAGS = --skip-arity-checks
DOCKER_BUILD_DEBUG_FLAGS = --progress plain --no-cache
### Run playground
run: build
node ./build/server/modules/app.rkt.js
run-forever: build
while true; do make run; sleep 1; done
quickrun: quickbuild
node ./build/server/modules/app.rkt.js
### Docker
docker-build:
docker build $(DOCKER_BUILD_DEBUG_FLAGS) -t racketscript/racketscript-playground .
docker-run:
docker run -dp 8080:80 -e PORT=80 -t racketscript/racketscript-playground
docker-push:
docker push racketscript/racketscript-playground:latest
#### Build
quickbuild: RACKS_ARGS = -n
quickbuild: build
build: build/client build/server
build/server: app.rkt | node_modules
@echo "Compiling the server..."
racks $(RACKS_FLAGS) $(RACKS_ARGS) $(RACKS_APP_FLAGS) -d build/server app.rkt
node_modules: package.json package-lock.json
npm install && touch node_modules
build/client: client.rkt | build/runtime build/examples
@echo "Compiling the client..."
racks $(RACKS_FLAGS) $(RACKS_ARGS) $(RACKS_APP_FLAGS) -d build/client --target webpack client.rkt
./build/client/node_modules/.bin/webpack --config ./build/client/webpack.config.js --entry ./build/client/modules/client.rkt.js --output-path ./build/client/dist
build/runtime: stub.rkt
@echo "Compiling the runtime..."
racks $(RACKS_FLAGS) $(RACKS_EXAMPLE_FLAGS) -d build/runtime stub.rkt
build/examples: $(addsuffix .js,$(wildcard examples/*.rkt))
examples/%.rkt.js: examples/%.rkt
@echo "Compiling $<..."
racks $(RACKS_FLAGS) $(RACKS_ARGS) $(RACKS_EXAMPLE_FLAGS) -d build/examples $<
cp build/examples/modules/$*.rkt.js examples/
clean:
rm -rf build/ examples/*.rkt.js