Last active
December 30, 2024 12:15
-
-
Save ao-kenji/8c63825e44789b10a0fcb0e598360d88 to your computer and use it in GitHub Desktop.
Patch for building FUZIX on OpenBSD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Kernel/platform/platform-z80pack/Makefile b/Kernel/platform/platform-z80pack/Makefile | |
index 5616e636a..b6d1b9eb6 100644 | |
--- a/Kernel/platform/platform-z80pack/Makefile | |
+++ b/Kernel/platform/platform-z80pack/Makefile | |
@@ -30,6 +30,7 @@ clean: | |
image: | |
$(CROSS_LD) -b -C 0x0088 -S 0xF400 -X 0xE900 -f CLDBbXSs -o fuzix.bin \ | |
+ -m fuzix.tmpmap \ | |
crt0.o commonmem.o z80pack.o main.o \ | |
../../start.o ../../version.o \ | |
../../cpu-z80u/lowlevel-z80u.o ../../cpu-z80u/usermem_std-z80u.o \ | |
@@ -41,7 +42,7 @@ image: | |
../../tty.o ../../mm.o ../../mm/memalloc_none.o ../../mm/bankfixed.o \ | |
../../swap.o ../../devsys.o ../../dev/z80pack/devlpr.o \ | |
../../dev/z80pack/devtty.o ../../dev/z80pack/devrtc.o \ | |
- /opt/fcc/lib/z80/libz80.a -m fuzix.tmpmap | |
+ /opt/fcc/lib/z80/libz80.a | |
perl -lpe '$$_=hex' fuzix.tmpmap | paste -d" " - fuzix.tmpmap | sort -n | cut -d" " -f 2- >../../fuzix.map | |
../../tools/pack85 <../../fuzix.map fuzix.bin ../../fuzix.bin | |
asz80 bootblock.S -o bootblock.o | |
diff --git a/Library/libs/Makefile.z80 b/Library/libs/Makefile.z80 | |
index aaa44a898..3b182b055 100644 | |
--- a/Library/libs/Makefile.z80 | |
+++ b/Library/libs/Makefile.z80 | |
@@ -104,7 +104,7 @@ libc.l:%.l:$(OBJ_C) $(OBJ_ASM) | |
syscall.l: fuzix$(PLATFORM)/syslib.l | |
../tools/syscall_$(PLATFORM) | |
- (cd fuzix$(PLATFORM); make) | |
+ (cd fuzix$(PLATFORM); $(MAKE)) | |
cat fuzix$(PLATFORM)/syslib.l | tr " " "\\n" | sed -e "s/^/fuzix$(PLATFORM)\//" >syscall.l | |
syslib$(PLATFORM).lib: syscall.l libc.l | |
@@ -118,16 +118,16 @@ crt0.o: crt0_$(PLATFORM).o | |
fuzix$(PLATFORM)/syslib.l: ../tools/syscall_$(PLATFORM) | |
$< | |
- make -C fuzix$(PLATFORM) | |
+ $(MAKE) -C fuzix$(PLATFORM) | |
../tools/syscall_$(PLATFORM): ../tools/syscall_$(PLATFORM).c | |
- make -C .. tools/syscall_$(PLATFORM) | |
+ $(MAKE) -C .. tools/syscall_$(PLATFORM) | |
liberror.txt: ../tools/liberror | |
$< > $@ | |
../tools/liberror: ../tools/liberror.c | |
- make -C .. tools/liberror | |
+ $(MAKE) -C .. tools/liberror | |
curses$(PLATFORM).lib: $(OBJ_CURS) | |
$(AR) rc curses$(PLATFORM).lib `lorder$(PLATBIN) $(OBJ_CURS) | tsort` | |
@@ -173,7 +173,7 @@ $(OBJ_RL):%.o: %.c | |
clean: | |
rm -rf *.o *.lib *~ syscall.l libc.l syslib.l \ | |
lib*.a liberror.txt | |
- -cd fuzix$(PLATFORM) && make clean | |
+ -cd fuzix$(PLATFORM) && $(MAKE) clean | |
rm -rf fuzix$(PLATFORM)/Makefile | |
rm -f $(KRN_HEADERS_COPY) | |
-cd curses && rm -rf *.o *~ | |
diff --git a/Library/link/ldz80 b/Library/link/ldz80 | |
index d28006bf9..a64823178 100755 | |
--- a/Library/link/ldz80 | |
+++ b/Library/link/ldz80 | |
@@ -1,4 +1,4 @@ | |
-#!/bin/bash | |
+#!/usr/local/bin/bash | |
# | |
TARGET=a.out | |
# TODO; stack option | |
diff --git a/Makefile b/Makefile | |
index f357f61d2..290ce731c 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -90,7 +90,7 @@ | |
# zxdiv: ZX Spectrum 128K with DivIDE/DivMMC interface | |
# zxuno: ZX Uno FPGA system | |
-TARGET ?= zrc | |
+TARGET ?= lunaxp | |
include version.mk | |
@@ -110,7 +110,7 @@ PATH := /opt/fcc/bin:$(PATH) | |
PATH := $(FUZIX_ROOT)/Build/tools/:$(PATH) | |
# Use Berkeley yacc always (Bison output is too large) | |
-YACC = byacc | |
+YACC = yacc | |
# TARGET is what we are building | |
# CPU is the CPU type for the kernel | |
diff --git a/Standalone/Makefile b/Standalone/Makefile | |
index ff5f34078..e67df4923 100644 | |
--- a/Standalone/Makefile | |
+++ b/Standalone/Makefile | |
@@ -1,4 +1,4 @@ | |
-CC=gcc | |
+CC=cc | |
#Use this for playing with the experimental libdsk support | |
#CCOPTS=-O2 -DLIBDSK -ldsk -g -Wall -pedantic -Wno-char-subscripts -Wno-deprecated-declarations | |
CCOPTS=-O2 -g -Wall -pedantic -Wno-char-subscripts -Wno-deprecated-declarations | |
diff --git a/Standalone/mkftl.c b/Standalone/mkftl.c | |
index a1825eb14..83afe4a67 100644 | |
--- a/Standalone/mkftl.c | |
+++ b/Standalone/mkftl.c | |
@@ -11,6 +11,10 @@ | |
#include "../Kernel/lib/dhara/map.h" | |
#include "../Kernel/lib/dhara/nand.h" | |
+#if defined(__clang__) | |
+#define ffsl __builtin_ffsl | |
+#endif | |
+ | |
static uint32_t pagesize = 512; | |
static uint32_t erasesize = 4096; | |
static uint32_t flashsize = 1024*1024; /* bytes */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment