uCBQN/obj/subMakefile
2021-06-11 04:43:22 +03:00

66 lines
1.4 KiB
Plaintext

SHELL=/usr/bin/env bash
CC=clang
CCFLAGS=-Wno-microsoft-anon-tag
# CC=gcc
# CCFLAGS=-Wno-parentheses
CMD=$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions ${CCFLAGS} $(FLAGS) -fPIE -MMD -MP -MF
o3: FLAGS=-O3
o3: gen
o3n: FLAGS=-O3 -march=native
o3n: gen
o3g: FLAGS=-O3 -g
o3g: gen
debug: FLAGS=-g -DDEBUG
debug: gen
rtperf: FLAGS=-O3 -DRT_PERF
rtperf: gen
heapverify: FLAGS=-DDEBUG -g -DHEAP_VERIFY
heapverify: gen
rtverify: FLAGS=-DDEBUG -O3 -DRT_VERIFY
rtverify: gen
gen: builtins core base jit utils
@$(CC) -o BQN *.o -lm
@mv BQN ../../BQN
@echo
core: i32arr.o c32arr.o f64arr.o harr.o fillarr.o stuff.o derv.o mm.o heap.o
%.o: ../../src/core/%.c
@echo $< | cut -c 11-
@$(CMD) $@.d -c $<
../../src/gen/src:
@echo "no precompiled bytecode found; copying from the bytecode branch"
git checkout remotes/origin/bytecode ../../src/gen/{compiler,formatter,runtime0,runtime1,src}
git reset ../../src/gen/{compiler,formatter,runtime0,runtime1,src}
load.o: ../../src/gen/src
base: load.o main.o rtwrap.o vm.o ns.o nfns.o
%.o: ../../src/%.c
@echo $< | cut -c 11-
@$(CMD) $@.d -c $<
utils: utf.o hash.o file.o
%.o: ../../src/utils/%.c
@echo $< | cut -c 11-
@$(CMD) $@.d -c $<
jit: nvm.o
%.o: ../../src/jit/%.c
@echo $< | cut -c 11-
@$(CMD) $@.d -c $<
builtins: arithm.o arithd.o cmp.o sfns.o sort.o md1.o md2.o fns.o sysfn.o internal.o
%.o: ../../src/builtins/%.c
@echo $< | cut -c 11-
@$(CMD) $@.d -c $<
-include *.d
clean:
@rm -f *.o
@rm -f *.d