Move build output from src/build/ to ./build (repo root)

The build directory was under src/, which is unusual for a project
with a separate source tree. Moving it to the repo root's build/
directory follows the conventional project layout:

  ./build/           # build output (gitignored)
  ./src/             # source code only
  ./oscar64/         # compiler (submodule)

Changes:
- src/build.sh: BUILD_DIR changed from $SCRIPT_DIR/build to
  $ROOT/build
- .gitignore: replaced src/build/ with build/
- README.md: updated layout tree, build commands, and output path
- src/AGENT_CONTEXT.md: updated gitignore reference
- tasks.md: replaced all src/build/ with build/
This commit is contained in:
ballz
2026-07-18 15:42:20 +02:00
parent 31cbe00486
commit 0bf6818a3c
5 changed files with 17 additions and 13 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# build artifacts
src/build/
build/
*.prg
*.asm
*.map
+7 -3
View File
@@ -9,6 +9,7 @@ as the cross-compiler. Oscar64 is checked in as a git submodule under
```
.
├── oscar64/ # Oscar64 cross-compiler (git submodule)
├── build/ # Build output (gitignored)
├── docs/c64/ # Low-level C64 reference (memory map, VIC, CIA, SID, …)
├── src/ # Your C code
│ ├── helloworld.c
@@ -31,11 +32,14 @@ git submodule update --init --recursive
```sh
cd src
./build.sh # compile helloworld.c → src/build/helloworld.prg
./build.sh # compile main.c → build/whack_hare.prg (-O1)
./build.sh -e # run in oscar64's built-in emulator (headless, fast)
./build.sh -v # run in VICE x64 (interactive, needs a real display)
./build.sh -V # run in VICE x64sc (interactive, cycle-exact)
./build.sh -p # PLAY: launch VICE in background (see build.sh --help)
./build.sh -v # run in VICE x64 (foreground, blocks terminal)
./build.sh -V # run in VICE x64sc (cycle-exact, foreground)
./build.sh --kill # kill any detached VICE process
./build.sh -c # just compile
./build.sh -O3 # release build (auto-ZP, outliner, aggressive inlining)
```
`build.sh` will build the oscar64 compiler automatically the first time
+1 -1
View File
@@ -155,7 +155,7 @@ $21-$24) goes to $D800-$DBE7.
## Commit conventions
- One commit per phase, with a clear `Phase N: <summary>` prefix.
- Don't commit generated build artifacts in `src/build/` (gitignored).
- Don't commit generated build artifacts in `build/` (gitignored).
- Generated data files (e.g. `src/data/processed/*.bin`) are checked
in so the build doesn't depend on Python being installed.
+2 -2
View File
@@ -16,7 +16,7 @@
# ./build.sh -Os # compile with -Os (optimize for size)
# ./build.sh -g # compile with -g (adds source-level debug info)
#
# Output (in ./build/):
# Output (in <repo>/build/):
# whack_hare.prg — loadable C64 program (run with x64, VICE, or real hw)
# whack_hare.asm — full 6502 listing
# whack_hare.map — region/section/object placement
@@ -47,7 +47,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
OSCAR64_DIR="$ROOT/oscar64"
OSCAR64_BIN="$OSCAR64_DIR/bin/oscar64"
BUILD_DIR="$SCRIPT_DIR/build"
BUILD_DIR="$ROOT/build"
PRG="$BUILD_DIR/whack_hare.prg"
D64="$BUILD_DIR/whack.d64"
+6 -6
View File
@@ -65,15 +65,15 @@ runs.
- [x] ✅ Repo initialized, oscar64 is a submodule at `./oscar64/`.
- [x]`src/helloworld.c` + `src/build.sh` produce
`src/build/helloworld.prg`.
`build/helloworld.prg`.
- [x]`GAME.md` written.
- [x] ✅ Source artwork in `./source_images/`.
- [ ]**Verify:** `cd src && ./build.sh -e` runs the hello-world
program in the oscar64 built-in emulator. (Optional: launch
`x64 src/build/helloworld.prg` in a real terminal session
`x64 build/helloworld.prg` in a real terminal session
to see the screen.)
**Done means:** `src/build/helloworld.prg` exists and the
**Done means:** `build/helloworld.prg` exists and the
emulator prints "Hello World" then exits cleanly.
---
@@ -171,7 +171,7 @@ state.
- `cd src && ./build.sh -e` displays the title screen in the
oscar64 built-in emulator for 5 seconds (or until fire is pressed)
then exits.
- (Optional, interactive) `x64 src/build/whack_hare.prg` in a real
- (Optional, interactive) `x64 build/whack_hare.prg` in a real
terminal session displays the title screen on real timings.
Compare visually to `source_images/screen_title.png`.
- The .map file shows our code is in $0900-$1100-ish, well within
@@ -304,7 +304,7 @@ random source.
**Verify:**
- The game still works in the oscar64 built-in emulator
(`build.sh -e`).
- (Optional, interactive) Launch `x64sc src/build/whack_hare.prg`
- (Optional, interactive) Launch `x64sc build/whack_hare.prg`
in a real terminal to confirm the game runs at cycle-exact PAL
timing (50.125 Hz). The state transitions happen on the right
raster lines. The 50 Hz tick is rock-solid.
@@ -363,7 +363,7 @@ becomes audible.
- GAMEOVER: longer fanfare.
- The cues are recognizable and feel right (timing, volume).
- (Optional, interactive) Run the audio cues under `x64sc
src/build/whack_hare.prg` in a real terminal to confirm the
build/whack_hare.prg` in a real terminal to confirm the
SID envelope generator timings are right; the oscar64 emulator
is fast but not always bit-accurate on SID timing, and the
`x64sc` cycle-exact path is the one that matches real hardware.