all repos — hex @ 5077128912159f0edf98194cce44ae7e2c215e17

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

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
CC = gcc
CFLAGS = -Wall -Wextra -g
LDFLAGS =

.PHONY: wasm, playground, clean, test, web

hex: src/hex.c
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o hex

src/hex.c:
	bash scripts/amalgamate.sh

web/assets/hex.wasm: src/hex.c
	 emcc -O2 -sASYNCIFY -DBROWSER -sEXPORTED_RUNTIME_METHODS=stringToUTF8 src/hex.c -o web/assets/hex.js --pre-js web/assets/hex-playground.js

hex.wasm: src/hex.c
	 emcc -O2 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=stringToUTF8 src/hex.c -o hex.js --pre-js src/hex.node.js

ape: src/hex.c
	cosmocc $(CFLAGS) $(LDFLAGS) $< -o hex

wasm: hex.wasm

playground: web/assets/hex.wasm

clean:
	rm -f src/hex.c
	rm -f hex
	rm -f hex.exe
	rm -f hex.js
	rm -f hex.wasm

test:
	./hex scripts/test.hex

web: playground
	./hex scripts/web.hex