~crc_/retroforth

9834bf1de50133d46d031994573b176f60938e8e — crc a month ago 1071171
split configuration options out of Makefiles

FossilOrigin-Name: e604e200a0554ed37385d347a2081d3fed857070739046caa3f3f05afcae6316
3 files changed, 86 insertions(+), 164 deletions(-)

A Configuration.mk
M GNUmakefile
M Makefile
A Configuration.mk => Configuration.mk +83 -0
@@ 0,0 1,83 @@
# -------------------------------------------------------------

# These are used when building and signing a release.

VERSION ?= 2023.9
KEYPAIR ?= 2023-09

# -------------------------------------------------------------

# Installation targets

PREFIX ?= /usr/local
DATADIR ?= $(PREFIX)/share/RETRO12
DOCSDIR ?= $(PREFIX)/share/doc/RETRO12
EXAMPLESDIR ?= $(PREFIX)/share/examples/RETRO12
MANDIR ?= $(PREFIX)/man/man1

# -------------------------------------------------------------

# Flags for adding in libraries we need to link to.

# If not using floating point, you can remove the `-lm` from
# LIBM.

LIBM ?= -lm
LIBDL ?=

# -------------------------------------------------------------

OPTIONS ?=
OPTIONS += -DBIT64

# The I/O devices can be enabled or disabled. Comment or
# uncomment the corresponding ENABLED and DEVICES lines and
# then run `make`. Of particular note here, sockets support
# is disabled by default and you may wish to enable it.

ENABLED ?=
ENABLED += -DENABLE_FLOATS
ENABLED += -DENABLE_FILES
ENABLED += -DENABLE_UNIX
ENABLED += -DENABLE_RNG
ENABLED += -DENABLE_CLOCK
ENABLED += -DENABLE_SCRIPTING
#ENABLED += -DENABLE_SOCKETS
ENABLED += -DENABLE_SIGNALS
ENABLED += -DENABLE_MULTICORE
ENABLED += -DENABLE_FFI
ENABLED += -DENABLE_UNSIGNED
ENABLED += -DENABLE_MALLOC
ENABLED += -DENABLE_BLOCKS

DEVICES ?=
DEVICES += interface/ll.retro
DEVICES += interface/dedup.retro
DEVICES += interface/sources.retro
DEVICES += interface/floatingpoint.retro
DEVICES += interface/filesystem.retro
DEVICES += interface/unix.retro
DEVICES += interface/rng.retro
DEVICES += interface/clock.retro
DEVICES += interface/scripting.retro
DEVICES += interface/sockets.retro
DEVICES += interface/multicore.retro
DEVICES += interface/ffi.retro
DEVICES += interface/unsigned.retro
DEVICES += interface/retro-napia.retro
DEVICES += interface/future.retro
DEVICES += interface/block.retro
DEVICES += interface/deprecated.retro
DEVICES += interface/double.retro
DEVICES += interface/malloc.retro
DEVICES += interface/final.retro

# -------------------------------------------------------------

GLOSSARY ?= ./bin/retro tools/glossary.retro
ASSEMBLE ?= ./bin/retro-muri
EXTEND   ?= ./bin/retro-extend
EXPORT   ?= ./bin/retro-embedimage
RETRO    ?= ./bin/retro

# -------------------------------------------------------------

M GNUmakefile => GNUmakefile +2 -85
@@ 2,92 2,9 @@
# using GNU Make. For BSD users, look at the Makefile instead.
# -------------------------------------------------------------

# These are used when building and signing a release.
include Configuration.mk

VERSION ?= 2023.9
KEYPAIR ?= 2023-09

# -------------------------------------------------------------

# Installation targets

PREFIX ?= /usr/local
DATADIR ?= $(PREFIX)/share/RETRO12
DOCSDIR ?= $(PREFIX)/share/doc/RETRO12
EXAMPLESDIR ?= $(PREFIX)/share/examples/RETRO12
MANDIR ?= $(PREFIX)/share/man/man1

# -------------------------------------------------------------

# Flags for adding in libraries we need to link to.

# If not using floating point, you can remove the `-lm` from
# LIBM.

LIBM ?= -lm

# You can comment out this if not enabling the FFI.

LIBDL ?=
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
  LIBDL += -ldl
endif

CFLAGS ?= -O2

# -------------------------------------------------------------

OPTIONS ?=
OPTIONS += -DBIT64

# The I/O devices can be enabled or disabled. Comment or
# uncomment the corresponding ENABLED and DEVICES lines and
# then run `make`. Of particular note here, sockets support
# is disabled by default and you may wish to enable it.
#
# Don't uncomment the line with -DNEEDS_STRL. I use the BSD
# strl* functions and provide a copy of them when needed. GNU
# libc does not include these.

ENABLED ?=
ENABLED += -DENABLE_FLOATS
ENABLED += -DENABLE_FILES
ENABLED += -DENABLE_UNIX
ENABLED += -DENABLE_RNG
ENABLED += -DENABLE_CLOCK
ENABLED += -DENABLE_SCRIPTING
# ENABLED += -DENABLE_SOCKETS
ENABLED += -DENABLE_SIGNALS
ENABLED += -DENABLE_MULTICORE
ENABLED += -DENABLE_FFI
ENABLED += -DENABLE_UNSIGNED
ENABLED += -DENABLE_MALLOC
ENABLED += -DENABLE_BLOCKS

ENABLED += -DNEEDS_STRL

DEVICES ?=
DEVICES += interface/ll.retro
DEVICES += interface/dedup.retro
DEVICES += interface/sources.retro
DEVICES += interface/floatingpoint.retro
DEVICES += interface/filesystem.retro
DEVICES += interface/unix.retro
DEVICES += interface/rng.retro
DEVICES += interface/clock.retro
DEVICES += interface/scripting.retro
DEVICES += interface/sockets.retro
DEVICES += interface/multicore.retro
DEVICES += interface/unsigned.retro
DEVICES += interface/ffi.retro
DEVICES += interface/retro-napia.retro
DEVICES += interface/future.retro
DEVICES += interface/block.retro
DEVICES += interface/deprecated.retro
DEVICES += interface/double.retro
DEVICES += interface/malloc.retro
DEVICES += interface/final.retro
LIBDL += -ldl

# -------------------------------------------------------------


M Makefile => Makefile +1 -79
@@ 2,85 2,7 @@
# on Linux or macOS), look at the GNUmakefile instead.
# -------------------------------------------------------------

# These are used when building and signing a release.

VERSION ?= 2023.9
KEYPAIR ?= 2023-09

# -------------------------------------------------------------

# Installation targets

PREFIX ?= /usr/local
DATADIR ?= $(PREFIX)/share/RETRO12
DOCSDIR ?= $(PREFIX)/share/doc/RETRO12
EXAMPLESDIR ?= $(PREFIX)/share/examples/RETRO12
MANDIR ?= $(PREFIX)/man/man1

# -------------------------------------------------------------

# Flags for adding in libraries we need to link to.

# If not using floating point, you can remove the `-lm` from
# LIBM.

LIBM ?= -lm
LIBDL ?=

# -------------------------------------------------------------

OPTIONS ?=
OPTIONS += -DBIT64

# The I/O devices can be enabled or disabled. Comment or
# uncomment the corresponding ENABLED and DEVICES lines and
# then run `make`. Of particular note here, sockets support
# is disabled by default and you may wish to enable it.

ENABLED ?=
ENABLED += -DENABLE_FLOATS
ENABLED += -DENABLE_FILES
ENABLED += -DENABLE_UNIX
ENABLED += -DENABLE_RNG
ENABLED += -DENABLE_CLOCK
ENABLED += -DENABLE_SCRIPTING
#ENABLED += -DENABLE_SOCKETS
ENABLED += -DENABLE_SIGNALS
ENABLED += -DENABLE_MULTICORE
ENABLED += -DENABLE_FFI
ENABLED += -DENABLE_UNSIGNED
ENABLED += -DENABLE_MALLOC
ENABLED += -DENABLE_BLOCKS

DEVICES ?=
DEVICES += interface/ll.retro
DEVICES += interface/dedup.retro
DEVICES += interface/sources.retro
DEVICES += interface/floatingpoint.retro
DEVICES += interface/filesystem.retro
DEVICES += interface/unix.retro
DEVICES += interface/rng.retro
DEVICES += interface/clock.retro
DEVICES += interface/scripting.retro
DEVICES += interface/sockets.retro
DEVICES += interface/multicore.retro
DEVICES += interface/ffi.retro
DEVICES += interface/unsigned.retro
DEVICES += interface/retro-napia.retro
DEVICES += interface/future.retro
DEVICES += interface/block.retro
DEVICES += interface/deprecated.retro
DEVICES += interface/double.retro
DEVICES += interface/malloc.retro
DEVICES += interface/final.retro

# -------------------------------------------------------------

GLOSSARY ?= ./bin/retro tools/glossary.retro
ASSEMBLE ?= ./bin/retro-muri
EXTEND   ?= ./bin/retro-extend
EXPORT   ?= ./bin/retro-embedimage
RETRO    ?= ./bin/retro
include Configuration.mk

# -------------------------------------------------------------