Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (52 loc) · 2.68 KB
/
Copy pathMakefile
File metadata and controls
60 lines (52 loc) · 2.68 KB
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
58
59
60
# Japi Base Computer -- host build.
#
# Builds the whole computer (platform + editor + Japi Basic) on the desktop,
# against the Japi Base host simulator, so it can be run and tested without Pico
# hardware. The three components are this repo's submodules; the application
# glue -- the editor wired to the BASIC Run command (Alt+R, Enter) -- lives in
# app/jbb_app.c.
#
# If you cloned without --recursive, run `git submodule update --init` first.
CC = gcc
BIN = build
# Per the Japi workflow (see /home/jan/Japi/JAPI-CONTEXT.md): the LOCAL build
# sources the sibling MODULE folders on David (../JapiBase etc.) -- "build the
# computer from the local modules", tested in the sim and on the Pico before any
# push. The submodule copies under this repo are ONLY the published-from-GitHub
# release mirror; build from those (step 3/4) by overriding on the command line:
# make JAPIBASE=JapiBase EDITOR=JapiBaseEditor JBB=JapiBaseBasic/Source
JAPIBASE = ../JapiBase
EDITOR = ../JapiBaseEditor
JBB = ../JapiBaseBasic/Source
CALC = ../JapiBaseCalc/src
APP = app
# Same platform/sim flags as the standalone components (no -Werror here: this
# links third-party editor + simulator source too).
APPFLAGS = -std=c11 -Wall -Wextra -O2 -DJBB_RUN -DJAPI_SIM \
-I"$(JAPIBASE)/Japi Base Pico 2" -I"$(JAPIBASE)/sim/shim" \
-I"$(EDITOR)/editor" -I"$(JBB)" -I"$(CALC)" -I"$(APP)"
# The Japi Basic interpreter -- the platform-free engine, from the JapiBaseBasic
# submodule. jbb_console.c is the console-ops backend; jbb_app.c (in app/) is the
# glue between the editor, the interpreter and the platform.
APP_CORE = $(addprefix $(JBB)/, jbb_value.c jbb_lex.c jbb_expr.c jbb_cexpr.c jbb_labels.c jbb_parse.c \
jbb_exec.c jbb_arrays.c jbb_builtins.c jbb_gosub.c jbb_data.c jbb_split.c \
jbb_trace.c jbb_timer.c jbb_graphics.c jbb_math.c)
.PHONY: jbb jbb-demo clean
jbb: $(BIN)/jbb
$(BIN)/jbb: $(APP)/jbb_app.c $(JBB)/jbb_console.c $(JBB)/jbb.h
@mkdir -p $(BIN)
$(CC) $(APPFLAGS) -o $@ \
"$(JAPIBASE)/sim/japi_sim.c" \
"$(EDITOR)/editor/jbe.c" "$(EDITOR)/editor/ui_filelist.c" \
"$(CALC)/calc.c" "$(CALC)/calc_engine.c" "$(CALC)/calc_ui.c" \
"$(CALC)/calc_eval.c" "$(CALC)/calc_classic.c" \
"$(APP)/jbb_app.c" "$(JBB)/jbb_console.c" $(APP_CORE) -lm
@echo "Built $(BIN)/jbb -- run it with: ./$(BIN)/jbb A:hello.bas"
# Drop a sample program on the sim's A: floppy and open it; press Alt+R, Enter
# (Run) inside the editor to run it.
jbb-demo: jbb
@mkdir -p simdisk_A
@printf 'REM Welcome to Japi Base BASIC\nPRINT "Hello from JBB!"\nFOR i AS INTEGER = 1 TO 5\nPRINT "i = "; i\nNEXT i\nPRINT "Done."\n' > simdisk_A/hello.bas
./$(BIN)/jbb A:hello.bas
clean:
rm -rf $(BIN)