Skip to content

Commit 6fa9070

Browse files
authored
Merge pull request #66 from FoenixRetro/fix/release-makefiles
fix: bring build/release Makefiles up-to-date with repo changes etc.
2 parents 0566d5f + 5a5c7ec commit 6fa9070

11 files changed

Lines changed: 73 additions & 79 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ SuperBASIC is fully intended to work with the _latest_ Kernel/DOS.
1616
```
1717
git clone git@github.com:FoenixRetro/f256-superbasic.git
1818
git clone git@github.com:WartyMN/Foenix-F256JR-bootscreens.git
19-
git clone git@github.com:ghackwrench/F256_Jr_Kernel_DOS.git
19+
git clone git@github.com:FoenixRetro/f256-microkernel
20+
git clone git@github.com:FoenixRetro/FoenixMgr
2021
cd f256-superbasic/source
2122
2223
# this will build everything against/including latest kernel
@@ -92,7 +93,6 @@ Attempting to program sector 0x01 with sb01.bin
9293
- [F256 Documentation Wiki](https://wiki.f256foenix.com)
9394
- [More information on flashing SuperBASIC to your machine](https://wiki.f256foenix.com/index.php?title=Kernel_%26_SuperBASIC_Updates)
9495
- [More information on MAME for F256](https://wiki.f256foenix.com/index.php?title=Emulation#MAME)
95-
- [F256 emulator](https://github.com/FoenixRetro/junior-emulator)
96-
- [F256 Kernel and DOS](https://github.com/ghackwrench/F256_Jr_Kernel_DOS)
96+
- [F256 MicroKernel](https://github.com/FoenixRetro/f256-microkernel)
97+
- [F256 Boot Screens](https://github.com/WartyMN/Foenix-F256JR-bootscreens)
9798
- [F256 Command Line USB upload tool](https://github.com/pweingar/FoenixMgr)
98-
- [Foenix BootScreens](https://github.com/WartyMN/Foenix-F256JR-bootscreens)

documents/common.make

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ***********************************************************************************
22
#
3-
# Common Build
3+
# Common Build
44
#
55
# ***********************************************************************************
66
#
@@ -15,33 +15,49 @@ APPSTEM = .exe
1515
S = \\
1616
SDLDIR = C:\\sdl2
1717
CXXFLAGS = -I$(SDLDIR)$(S)include$(S)SDL2 -I . -fno-stack-protector -w -Wl,-subsystem,windows -DSDL_MAIN_HANDLED
18-
LDFLAGS = -lmingw32
18+
LDFLAGS = -lmingw32
1919
SDL_LDFLAGS = -L$(SDLDIR)$(S)lib -lSDL2 -lSDL2main -static-libstdc++ -static-libgcc
2020
OSNAME = windows
2121
EXTRAFILES = libwinpthread-1.dll SDL2.dll
2222
PYTHON = python
2323
else
2424
CCOPY = cp
2525
CDEL = rm -f
26-
CDELQ =
26+
CDELQ =
2727
CMAKE = make
2828
APPSTEM =
2929
S = /
3030
SDL_CFLAGS = $(shell sdl2-config --cflags)
3131
SDL_LDFLAGS = $(shell sdl2-config --libs)
32-
CXXFLAGS = $(SDL_CFLAGS) -O2 -DLINUX -fmax-errors=5 -I.
33-
LDFLAGS =
32+
CXXFLAGS = $(SDL_CFLAGS) -O2 -DLINUX -fmax-errors=5 -I.
33+
LDFLAGS =
3434
OSNAME = linux
35-
EXTRAFILES =
35+
EXTRAFILES =
3636
PYTHON = python3
3737
endif
3838
#
39-
# Root directory
39+
# Root and parent dirs
4040
#
41-
ROOTDIR = ..$(S)
41+
SELFDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
42+
ROOTDIR := $(abspath $(SELFDIR)..$(S))$(S)
43+
PARENTDIR := $(abspath $(ROOTDIR)..$(S))$(S)
44+
#
45+
# External repositories
46+
#
47+
KRN_REPO = $(PARENTDIR)f256-microkernel
48+
EMU_REPO = $(PARENTDIR)junior-emulator
49+
LDR_REPO = $(PARENTDIR)FoenixMgr
50+
#
51+
# Binaries dir
52+
#
53+
BINDIR = $(ROOTDIR)bin$(S)
54+
#
55+
# Emulator executable
56+
#
57+
EMULATOR = $(BINDIR)jr256$(APPSTEM)
4258
#
4359
# Current assembler
44-
#
60+
#
4561
ASM = 64tass
4662
#
4763
# Load Addresses

games/demo/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ else
1515
include ../../documents/common.make
1616
endif
1717

18-
BINDIR = ..$(S)..$(S)bin$(S)
19-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
2018
LANGUAGE = en
2119
SOURCE = main.bas
2220

@@ -47,12 +45,12 @@ program:
4745
# Run program (if built autorunning BASIC)
4846
#
4947
run: sprites program
50-
$(START)
48+
$(START)
5149
#
5250
# Run on kernel hardware
5351
#
54-
fgo: sprites program
55-
$(CCOPY) $(BINDIR)foenixmgr.ini .
52+
fgo: sprites program
53+
$(CCOPY) $(BINDIR)foenixmgr.ini .
5654
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary graphics.bin --address $(LSPRITES)
5755
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary storage$(S)load.dat --address $(LSOURCE)
5856
#
@@ -63,4 +61,3 @@ sdcard:
6361
$(CCOPY) foenixmgr.ini upload
6462
make -n -s fgo >upload$(S)files.lst
6563
make -C upload
66-

games/demo2/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ else
1515
include ../../documents/common.make
1616
endif
1717

18-
BINDIR = ..$(S)..$(S)bin$(S)
19-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
2018
LANGUAGE = en
2119
SOURCE = main.bas
2220

@@ -47,12 +45,12 @@ program:
4745
# Run program (if built autorunning BASIC)
4846
#
4947
run: sprites program
50-
$(START)
48+
$(START)
5149
#
5250
# Run on kernel hardware
5351
#
54-
fgo: sprites program
55-
$(CCOPY) $(BINDIR)foenixmgr.ini .
52+
fgo: sprites program
53+
$(CCOPY) $(BINDIR)foenixmgr.ini .
5654
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary graphics.bin --address $(LSPRITES)
5755
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary storage$(S)load.dat --address $(LSOURCE)
5856
#

games/invaders/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ else
1515
include ../../documents/common.make
1616
endif
1717

18-
BINDIR = ..$(S)..$(S)bin$(S)
19-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
2018
LANGUAGE = en
2119
SOURCE = main.bas ..$(S)common$(S)title.bas
2220

@@ -47,12 +45,12 @@ program:
4745
# Run program (if built autorunning BASIC)
4846
#
4947
run: sprites program
50-
$(START)
48+
$(START)
5149
#
5250
# Run on kernel hardware
5351
#
54-
fgo: sprites program
55-
$(CCOPY) $(BINDIR)foenixmgr.ini .
52+
fgo: sprites program
53+
$(CCOPY) $(BINDIR)foenixmgr.ini .
5654
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary graphics.bin --address $(LSPRITES)
5755
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary storage$(S)load.dat --address $(LSOURCE)
5856
#

games/solarfox/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ else
1515
include ../../documents/common.make
1616
endif
1717

18-
BINDIR = ..$(S)..$(S)bin$(S)
19-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
2018
LANGUAGE = en
2119
SOURCE = main.bas levels.bas ..$(S)common$(S)title.bas
2220

@@ -47,12 +45,12 @@ program:
4745
# Run program (if built autorunning BASIC)
4846
#
4947
run: sprites program
50-
$(START)
48+
$(START)
5149
#
5250
# Run on kernel hardware
5351
#
54-
fgo: sprites program
55-
$(CCOPY) $(BINDIR)foenixmgr.ini .
52+
fgo: sprites program
53+
$(CCOPY) $(BINDIR)foenixmgr.ini .
5654
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary graphics.bin --address $(LSPRITES)
5755
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary storage$(S)load.dat --address $(LSOURCE)
5856
#
@@ -64,4 +62,3 @@ sdcard:
6462
make -n -s fgo >upload$(S)files.lst
6563
make -C upload
6664

67-

games/squash/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ else
1515
include ../../documents/common.make
1616
endif
1717

18-
BINDIR = ..$(S)..$(S)bin$(S)
19-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
20-
TTYPORT = /dev/ttyUSB0
2118
LANGUAGE = en
2219

2320
START = $(EMULATOR) $(BINDIR)basic.rom@b storage$(S)load.dat@x graphics.bin@s
@@ -42,4 +39,4 @@ program:
4239
# Run program (if built autorunning BASIC)
4340
#
4441
run: sprites program
45-
$(START)
42+
$(START)

javascript/Makefile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,40 @@ else
1515
include ../documents/common.make
1616
endif
1717

18-
BINDIR = $(ROOTDIR)bin$(S)
19-
ASMOPTS = -q -b -Wall -c -L output$(S)basic.lst -l output$(S)basic.lbl -Wall
18+
ASMOPTS = -q -b -Wall -c -L output$(S)basic.lst -l output$(S)basic.lbl -Wall
2019
APPNAME = basic.rom
2120
SCRIPTDIR = scripts$(S)
22-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
23-
TTYPORT = /dev/ttyUSB0
2421
LANGUAGE = en
2522

26-
EMU_REPO= ..$(S)..$(S)junior-emulator
27-
UTL_REPO= ..$(S)..$(S)junior-utilities
28-
KRN_REPO= ..$(S)..$(S)junior-tinykernel
29-
3023
EMSRC = $(EMU_REPO)$(S)emulator
3124
EMUCODE = $(EMSRC)$(S)src $(EMSRC)$(S)include $(EMSRC)$(S)framework $(EMSRC)$(S)6502 $(EMSRC)$(S)roms
3225

3326
SOURCES = emulator/framework/main.cpp emulator/framework/gfx.cpp emulator/framework/debugger.cpp \
3427
emulator/src/sys_processor.cpp emulator/src/sys_debug_uk101.cpp emulator/src/hardware.cpp emulator/src/hw_fifo.cpp
35-
DEFINES = -D EMSCRIPTEN -D LINUX -D NO_DEBUGGER -DINCLUDE_OS_SUPPORT
28+
DEFINES = -D EMSCRIPTEN -D LINUX -D NO_DEBUGGER -DINCLUDE_OS_SUPPORT
3629
EMFLAGS = -I. -I emulator/framework -I emulator//cpu -I emulator/include -I emulator -O2 -s USE_SDL=2 -s WASM=1 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]'
3730
COMPILE = emcc $(SOURCES) $(DEFINES) $(CADDRESSES) $(EMFLAGS) -o f256.html
3831
LOADERS = python makeloader.py $(CADDRESSES)
3932

40-
all: build
33+
all: build
4134

42-
build: build1
43-
make -C ../source basic
35+
build: pull build1
36+
make -C ../source basic
4437
$(CCOPY) utility$(S)dummy* loading
4538
make -C ../source basic
4639
$(CCOPY) ../source/build/basic.rom loading/basic.basic
4740
$(LOADERS)
4841
$(COMPILE)
4942

43+
pull:
44+
cd $(EMU_REPO) && git diff --quiet || (echo "Error: Emulator repository has uncommitted changes" && exit 1)
45+
cd $(EMU_REPO) && git diff --cached --quiet || (echo "Error: Emulator repository has staged changes" && exit 1)
46+
cd $(EMU_REPO) && git switch main
47+
cd $(EMU_REPO) && git pull
48+
5049
build1:
51-
$(CCOPY) -R $(EMUCODE) emulator
50+
$(CCOPY) -R $(EMUCODE) emulator
5251
$(CDEL) loading$(S)*.*
5352

5453
server:
5554
python -m http.server 8000
56-

source/Makefile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,11 @@ VERSION = 1
2121

2222
HARDWARE = 0 # 0 = F256
2323
HARDWARE_GEN ?= 1 # 1 = J/K, 2 = J2/K2
24-
BINDIR = $(ROOTDIR)bin$(S)
2524
ASMOPTS = -q -b -Wall -c -C -D HARDWARE="$(HARDWARE)" -D HARDWARE_GEN=$(HARDWARE_GEN) -L output$(S)basic.lst -l output$(S)basic.lbl -Wall
2625
APPNAME = build$(S)basic.rom
2726
SCRIPTDIR = scripts$(S)
28-
EMULATOR = $(BINDIR)jr256$(APPSTEM)
2927
LANGUAGE = en
3028

31-
EMU_REPO= ..$(S)..$(S)junior-emulator
32-
LDR_FILE= ..$(S)..$(S)FoenixMgr
33-
KRN_REPO= ..$(S)..$(S)F256_Jr_Kernel_DOS
34-
3529
MODULES= +hardware +graphics +tokeniser +sound +kernel
3630

3731
START = $(EMULATOR) $(APPNAME)@b storage$(S)load.dat@x $(BINDIR)graphics.bin@s $(BINDIR)tile_map.bin@24000 $(BINDIR)tile_images.bin@26000
@@ -53,15 +47,16 @@ trun: testbasic
5347
$(START)
5448

5549
#
56-
# Build & update Kernel & api.asm
50+
# Pull & update Kernel & api.asm
5751
#
5852
pullkernel:
59-
cd $(KRN_REPO) && git reset --hard
53+
cd $(KRN_REPO) && git diff --quiet || (echo "Error: MicroKernel repository has uncommitted changes" && exit 1)
54+
cd $(KRN_REPO) && git diff --cached --quiet || (echo "Error: MicroKernel repository has staged changes" && exit 1)
55+
cd $(KRN_REPO) && git switch master
6056
cd $(KRN_REPO) && git pull
6157

6258
updatekernel:
63-
make -B -C $(KRN_REPO)
64-
$(CCOPY) $(KRN_REPO)$(S)kernel$(S)*.bin build
59+
$(CCOPY) $(KRN_REPO)$(S)bin$(S)*.bin build
6560
$(CCOPY) $(KRN_REPO)$(S)kernel$(S)api.asm common$(S)api
6661

6762
#
@@ -127,7 +122,7 @@ shim:
127122

128123
fnxmgr:
129124
$(CDEL) temp$(S)*.*
130-
$(CCOPY) $(LDR_FILE)$(S)FoenixMgr$(S)*.* temp
125+
$(CCOPY) $(LDR_REPO)$(S)FoenixMgr$(S)*.* temp
131126
$(CCOPY) temp$(S)fnxmgr.py temp$(S)__main__.py
132127
zip temp$(S)fnxmgr.zip -j temp$(S)__main__.py temp$(S)constants.py temp$(S)foenix_config.py temp$(S)intelhex.py \
133128
temp$(S)pgx.py temp$(S)srec.py temp$(S)foenix.py temp$(S)pgz.py temp$(S)wdc.py

test/iec_gadget/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ endif
77

88
all : ramkernel
99

10-
BINDIR = ..$(S)..$(S)bin$(S)
11-
ASMOPTS = -q -b -Wall -c -L output$(S)testcode.lst -l output$(S)testcode.lbl -Wall
12-
KRN_REPO= ..$(S)..$(S)..$(S)F256_Jr_Kernel_DOS
10+
ASMOPTS = -q -b -Wall -c -L output$(S)testcode.lst -l output$(S)testcode.lbl -Wall
11+
1312
#
1413
# Switch to Flash-Boot or RAM-Boot
15-
#
14+
#
1615
flashboot:
17-
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --boot flash
18-
ramboot:
16+
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --boot flash
17+
ramboot:
1918
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --boot ram
2019
#
2120
# Build & update Kernel & api.asm
@@ -29,7 +28,7 @@ updatekernel:
2928
# Build RAM based kernel / test ROM combo and boot.
3029
#
3130
ramkernel: testcode.bin ramboot
32-
cat 3f.bin 3e.bin 01.bin testcode.bin >kernel.ram
31+
cat 3f.bin 3e.bin 01.bin testcode.bin >kernel.ram
3332
cat kernel.ram $(BINDIR)$(S)basic.rom >ramkernel.bin
3433
python $(BINDIR)fnxmgr.zip --port $(TTYPORT) --binary ramkernel.bin --address E000
3534
#

0 commit comments

Comments
 (0)