1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-18 07:42:55 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Larry Masinter
da4e06c697 update .gitignore for maiko as subproject 2026-03-10 14:08:11 -07:00
23 changed files with 247 additions and 142 deletions

View File

@@ -12,9 +12,7 @@ FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
USER root:root
# Install build tools
RUN apt-get update \
&& apt-get install -y build-essential gcc pkgconf make clang cmake \
&& apt-get install -y libx11-dev libbsd-dev libpcap-dev
RUN apt-get update && apt-get install -y make clang libx11-dev gcc
USER root
WORKDIR /root
ENTRYPOINT /bin/bash

26
.gitignore vendored
View File

@@ -1,9 +1,12 @@
# Object files
*.o
# Editor backups and recovery files
*~
\#*#
.DS_Store
# build directories
build/**
cmake-build-*/**
@@ -36,3 +39,26 @@ core
*.core
*.swp
# .gitignore for submodules
*.pdf
index.html
# manual cross-reference files
*.IMPTR
# (Accidentally) created sysouts at any level
*.sysout
*.SYSOUT
# older versions
*~
# emacs detritus
*\#
\.\#*
# Mac OS detritus
.DS_Store

View File

@@ -1,5 +1,6 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
PROJECT(maiko C)
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
SET(CMAKE_C_STANDARD 99)
@@ -36,12 +37,6 @@ IF(NEED_LIB_M)
SET(MAIKO_LIBRARIES m)
ENDIF()
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBBSD-OVERLAY REQUIRED IMPORTED_TARGET "libbsd-overlay")
SET(MAIKO_LIBRARIES ${MAIKO_LIBRARIES} PkgConfig::LIBBSD-OVERLAY)
ENDIF()
SET (MAIKO_RELEASE 351 CACHE STRING "Release version to build. Release: 115, 200, 201, 210, 300, 350, 351")
SET_PROPERTY(CACHE MAIKO_RELEASE PROPERTY STRINGS 115 200 201 210 300 350 351)
@@ -453,7 +448,6 @@ ADD_CUSTOM_COMMAND(OUTPUT vdate.c
ADD_EXECUTABLE(lde src/ldeboot.c src/unixfork.c)
TARGET_COMPILE_DEFINITIONS(lde PRIVATE ${MAIKO_DEFINITIONS})
TARGET_INCLUDE_DIRECTORIES(lde PRIVATE inc)
TARGET_LINK_LIBRARIES(lde ${MAIKO_LIBRARIES})
IF(MAIKO_DISPLAY_X11)
# Tell it that the X11 launcher is available.
TARGET_COMPILE_DEFINITIONS(lde PRIVATE ${MAIKO_DISPLAY_X11_DEFINITIONS})
@@ -534,21 +528,3 @@ TARGET_INCLUDE_DIRECTORIES(setsout PRIVATE inc)
ADD_EXECUTABLE(tstsout src/tstsout.c src/byteswap.c)
TARGET_COMPILE_DEFINITIONS(tstsout PRIVATE ${MAIKO_DEFINITIONS})
TARGET_INCLUDE_DIRECTORIES(tstsout PRIVATE inc)
# Installation Targets
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/../" CACHE PATH "Installation prefix" FORCE)
ENDIF()
execute_process(
COMMAND sh -c "echo $(../bin/osversion).$(../bin/machinetype)"
OUTPUT_VARIABLE release_dir
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE
)
INSTALL(TARGETS lde DESTINATION ${release_dir})
IF(MAIKO_DISPLAY_X11)
INSTALL(TARGETS ldex ldeinit DESTINATION ${release_dir})
ENDIF()
IF(MAIKO_DISPLAY_SDL)
INSTALL(TARGETS ldesdl DESTINATION ${release_dir})
ENDIF()

View File

@@ -1,15 +0,0 @@
# Common Options for All Linuxes
CC = gcc $(GCC_CFLAGS)
# CC = clang $(CLANG_CFLAGS)
include linux-libbsd.mk
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) $(BSD_CFLAGS) $(ADDITIONAL_DFLAGS)
LDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS)
LDELDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS)
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -1,24 +0,0 @@
# Check that pkg-config is available and that the libbsd-dev package is installed
# If one of these is missing, error out
# FGH 2026-03-08
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),cleanup)
CHK_PKG_CONFIG := $(shell command -v pkg-config)
ifeq ($(CHK_PKG_CONFIG),)
# pkg-config not found, print an error
$(error "pkg-config not found. Please install it to build this project.")
endif
CHK_LIBBSD_DEV := $(shell pkg-config --exists libbsd-overlay && echo true)
ifneq ($(CHK_LIBBSD_DEV),true)
$(error "libbsd-dev (or libbsd-devel) package not found. Please install it to build this project.")
endif
endif
endif
BSD_CFLAGS = $(shell pkg-config --cflags libbsd-overlay)
BSD_LDFLAGS = $(shell pkg-config --libs libbsd-overlay)

View File

@@ -1,14 +0,0 @@
# Common Options for Linux using SDL instead of X Windows
XFILES = $(OBJECTDIR)sdl.o
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
XLDFLAGS = -lSDL2

View File

@@ -1,17 +0,0 @@
# Common Options for Linux with X Windows
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
XFLAGS = -DXWINDOW
XLDFLAGS = -L/usr/X11/lib -lX11

View File

@@ -1,12 +1,29 @@
# Options for Linux, aarch64 processor, X windows, for INIT processing
include linux-x.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
DEBUGFLAGS =
ADDITIONAL_DFLAGS = $(DEBUGFLAGS) -DNOVERSION -DINIT
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
include linux-common.mk
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
OPTFLAGS = -O0 -g
DEBUGFLAGS =
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/ldeinit

View File

@@ -1,12 +1,29 @@
# Options for Linux, x86 processor, X windows, for INIT processing
include linux-x.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
DEBUGFLAGS =
ADDITIONAL_DFLAGS = $(DEBUGFLAGS) -DNOVERSION -DINIT
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
include linux-common.mk
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
OPTFLAGS = -O0 -g
DEBUGFLAGS =
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/ldeinit

View File

@@ -21,8 +21,8 @@ OPTFLAGS = -O0 -g
DEBUGFLAGS =
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT -D__wsl1__
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -21,8 +21,8 @@ OPTFLAGS = -O0 -g
DEBUGFLAGS =
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT -D__wsl1__
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -1,10 +1,25 @@
# Options for Linux, Intel 386/486 and SDL
GCC_CFLAGS := -m64 $(GCC_CFLAGS)
CLANG_CFLAGS := -m64 $(CLANG_CFLAGS)
CC = gcc -m32 $(GCC_CFLAGS)
# CC = clang $(CLANG_CFLAGS)
include linux-sdl.mk
XFILES = $(OBJECTDIR)sdl.o
include linux-common.mk
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -lm -lSDL2
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl

View File

@@ -1,10 +1,27 @@
# Options for Linux, Intel 386/486 and X-Window
GCC_CFLAGS := -m32 $(GCC_CFLAGS)
CLANG_CFLAGS := -m32 $(CLANG_CFLAGS)
CC = gcc -m32 $(GCC_CFLAGS)
# CC = clang -m32 $(CLANG_CFLAGS)
include linux-x.mk
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
include linux-common.mk
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex

View File

@@ -1,7 +1,25 @@
# Options for Linux, ARM64 and SDL
include linux-sdl.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
include linux-common.mk
XFILES = $(OBJECTDIR)sdl.o
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -lSDL2 -lm
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl

View File

@@ -1,7 +1,27 @@
# Options for Linux, aarch64 and X-Window
include linux-x.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
include linux-common.mk
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex

View File

@@ -1,7 +1,25 @@
# Options for Linux, ARMv7 and SDL
include linux-sdl.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
include linux-common.mk
XFILES = $(OBJECTDIR)sdl.o
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -lm -lSDL2
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl

View File

@@ -1,7 +1,27 @@
# Options for Linux, ARMv7 and X-Window
include linux-x.mk
CC = gcc $(GCC_CFLAGS)
#CC = clang $(CLANG_CFLAGS)
include linux-common.mk
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex

View File

@@ -1,10 +1,25 @@
# Options for Linux, Intel x86_64 and SDL
GCC_CFLAGS := -m64 $(GCC_CFLAGS)
CLANG_CFLAGS := -m64 $(CLANG_CFLAGS)
CC = gcc -m64 $(GCC_CFLAGS)
# CC = clang -m64 $(CLANG_CFLAGS)
include linux-sdl.mk
XFILES = $(OBJECTDIR)sdl.o
include linux-common.mk
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -lm -lSDL2
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl

View File

@@ -1,10 +1,28 @@
# Options for Linux, Intel x86_64 and X-Window
GCC_CFLAGS := -m64 $(GCC_CFLAGS)
CLANG_CFLAGS := -m64 $(CLANG_CFLAGS)
CC = gcc -m64 $(GCC_CFLAGS)
# CC = clang -m64 $(CLANG_CFLAGS)
include linux-x.mk
XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xbbt.o \
$(OBJECTDIR)dspif.o \
$(OBJECTDIR)xinit.o \
$(OBJECTDIR)xscroll.o \
$(OBJECTDIR)xcursor.o \
$(OBJECTDIR)xlspwin.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o
include linux-common.mk
XFLAGS = -DXWINDOW
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex

View File

@@ -17,8 +17,8 @@ SDLFLAGS = -DSDL=2
OPTFLAGS = -O2 -g3
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__
LDFLAGS = -lSDL2 -lm -lbsd
LDELDFLAGS = -lbsd
LDFLAGS = -lSDL2 -lm
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -19,8 +19,8 @@ XFLAGS = -DXWINDOW
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -17,8 +17,8 @@ XFLAGS = -DSDL=2
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__
LDFLAGS = -lm -lSDL2 -lbsd
LDELDFLAGS = -lbsd
LDFLAGS = -lm -lSDL2
LDELDFLAGS =
OBJECTDIR = ../$(RELEASENAME)/

View File

@@ -20,8 +20,8 @@ XFLAGS = -DXWINDOW
OPTFLAGS = -O2 -g3
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -D__wsl1__
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lbsd
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
OBJECTDIR = ../$(RELEASENAME)/