Create `bin/` if it doesn't exist

85c59be10c20a7ea439084fbf7188565a15ebde14aa55f2cb83f00e3b54c7adc
Alexis Sellier committed ago 1 parent c2b37032
Makefile +6 -2
6 6
# Full standard library with test modules.
7 7
STD_TEST := $(STD) $(patsubst %,-mod %,$(shell cat std.lib.test))
8 8
9 9
# Source files.
10 10
STD_LIB := $(shell find lib -name '*.rad')
11 -
RAD_BIN := bin/radiance.rv64.dev
11 +
BIN_DIR := bin
12 +
RAD_BIN := $(BIN_DIR)/radiance.rv64.dev
12 13
13 14
# Emulator command used to invoke the self-hosted compiler.
14 15
EMU       := $(or $(RAD_EMULATOR),emulator)
15 16
EMU_FLAGS := -memory-size=385024 \
16 17
			 -data-size=348160 \
34 35
# Compiler build
35 36
36 37
SEED      := seed/radiance.rv64
37 38
SEED_OPTS := $(STD) -pkg radiance -mod compiler/radiance.rad -entry radiance
38 39
39 -
$(RAD_BIN): $(STD_LIB) compiler/radiance.rad
40 +
$(RAD_BIN): $(STD_LIB) compiler/radiance.rad | $(BIN_DIR)
40 41
	@echo "radiance $(SEED) => $@"
41 42
	@$(EMU) $(EMU_FLAGS) -run $(SEED) $(SEED_OPTS) -o $@
42 43
44 +
$(BIN_DIR):
45 +
	@mkdir -p $@
46 +
43 47
# Standard Library Tests
44 48
45 49
STD_LIB_TEST := lib/std.test.rv64
46 50
47 51
std-test: $(STD_LIB_TEST)