From: Phil Burk Date: Sun, 21 Feb 2021 20:18:05 +0000 (-0800) Subject: move build folder to platforms X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=dd36defa0a2b8210295d52fdd0bc0768974b0991;p=debian%2Fpforth move build folder to platforms Update Travis and README --- diff --git a/.gitignore b/.gitignore index c526f1b..0ea33dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ -build/unix/*.eo -build/unix/*.o -build/unix/pfdicdat.h -build/unix/pforth -build/unix/pforth.dic -build/unix/pforth_standalone -build/win32/**/.vs -build/win32/**/Debug -build/win32/**/Release +platforms/unix/*.eo +platforms/unix/*.o +platforms/unix/pfdicdat.h +platforms/unix/pforth +platforms/unix/pforth.dic +platforms/unix/pforth_standalone +platforms/win32/**/.vs +platforms/win32/**/Debug +platforms/win32/**/Release fth/fatest1.txt fth/pforth.dic **/.DS_Store diff --git a/.travis.yml b/.travis.yml index c349606..08652c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,4 @@ before_install: | sudo apt-get install -y gcc-multilib fi script: # CC is exported by travis - - make WIDTHOPT=$WIDTHOPT -C build/unix/ test + - make WIDTHOPT=$WIDTHOPT -C platforms/unix/ test diff --git a/build/linux-crossbuild-amiga/Makefile b/build/linux-crossbuild-amiga/Makefile deleted file mode 100644 index 55698f6..0000000 --- a/build/linux-crossbuild-amiga/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# This Makefile can be used to cross-compile pForth on a Linux host to -# an Amiga target. GCC is used as host-compiler and VBCC as -# cross-compiler. - -# makefile for pForth -# Portable Forth written in 'C' -# by Phil Burk -# For more info visit http://www.softsynth.com/pforth/ -# -# See "help" target below. - -# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG -# See "docs/pf_ref.htm" file for more info. - -# We are going to use VBCC as cross compiler. I've installed VBCC -# under /opt/m68k-amigaos. It's configured to generate Motorola 680x0 code in -# "Amiga Hunk" object format. -VBCC := /opt/m68k-amigaos -PATH := $(VBCC)/bin:$(PATH) -XCC = vc # The VBCC compiler - -SRCDIR = ../.. -PFORTHDIR = $(SRCDIR) -CSRCDIR = $(PFORTHDIR)/csrc -FTHDIR = $(PFORTHDIR)/fth - -PFDICAPP = pforth -PFORTHDIC = pforth.dic -PFDICDAT = pfdicdat.h -PFORTHAPP = amiga_pforth_standalone - -# We need to create a 32-bit dictionary -WIDTHOPT= -m32 -DEBUGOPTS = -g -FULL_WARNINGS = \ - --std=c89 \ - -pedantic \ - -Wcast-qual \ - -Wall \ - -Wwrite-strings \ - -Winline \ - -Wmissing-prototypes \ - -Wmissing-declarations -CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) - -#IO_SOURCE = pf_io_posix.c -IO_SOURCE = pf_io_stdio.c pf_fileio_stdio.c -#IO_SOURCE = pf_io_win32_console.c - -EMBCCOPTS = -DPF_STATIC_DIC - -####################################### -PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ - pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ - pf_text.h pf_types.h pf_words.h pfcompfp.h \ - pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h -PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ - pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ - pf_text.c pf_words.c pfcompil.c pfcustom.c -PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) - -VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio - - -CPPFLAGS = -I. -DPF_BIG_ENDIAN_DIC -DPF_SUPPORT_FP -CFLAGS = $(CCOPTS) -LDFLAGS = $(WIDTHOPT) -lm - -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) - -# Cross compiler flags (for VBCC not gcc) -XCFLAGS = -c99 -O3 -#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 -XCPPFLAGS = -I. -DAMIGA -DPF_SUPPORT_FP -XLDFLAGS = -lmieee -lm881 - -XCOMPILE = $(XCC) $(XCFLAGS) $(XCPPFLAGS) -XLINK = $(XCC) $(XLDFLAGS) - -.SUFFIXES: .c .o .eo - -PFOBJS = $(PFSOURCE:.c=.o) -PFEMBOBJS = $(PFSOURCE:.c=.eo) - -.c.o: $(PFINCLUDES) - $(COMPILE) -c -o $@ $< - -.c.eo: $(PFINCLUDES) pfdicdat.h - $(XCOMPILE) $(EMBCCOPTS) -c -o $@ $< - -.PHONY: all clean test -.PHONY: help pffiles pfdicapp pfdicdat pforthapp - -all: $(PFORTHAPP) - -pffiles: - @echo "INCLUDE FILES -----------------" - @echo ${PFINCLUDES} - @echo "'C' FILES ---------------------" - @echo ${PFSOURCE} - @echo "OBJECT FILES ------------------" - @echo ${PFOBJS} - @echo "EMBEDDED OBJECT FILES ------------------" - @echo ${PFEMBOBJS} - -# Build pforth by compiling 'C' source. -$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) - $(CC) -o $@ $(PFOBJS) $(LDADD) $(LDFLAGS) - -# Build basic dictionary image by running newly built pforth and including "system.fth". -$(PFORTHDIC): $(PFDICAPP) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) - (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ - -$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) - echo 'include $(FTHDIR)/savedicd.fth SDAD'>load-dict-tmp.fth&& ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth - -$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) - $(XLINK) -o $@ $(PFEMBOBJS) $(XLDADD) - @echo "" - @echo "Standalone pForth executable written to $(PFORTHAPP)" - - -# target aliases -pfdicapp: $(PFDICAPP) - -pfdicdat: $(PFDICDAT) - -pforthapp: $(PFORTHAPP) - -help: - @echo "Use 'make all' to build standalone pForth executable." - @echo "PForth can be built in several stages using these targets:" - @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." - @echo " pfdicdat = image of full dictionary build by compiling Forth code." - @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." - @echo "" - @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." - @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." - -test: $(PFORTHAPP) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) - -clean: - rm -f $(PFOBJS) $(PFEMBOBJS) - rm -f $(PFORTHAPP) - rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) - rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) - rm -f $(PFDICAPP) diff --git a/build/linux-crossbuild-atari/Makefile b/build/linux-crossbuild-atari/Makefile deleted file mode 100644 index 7327163..0000000 --- a/build/linux-crossbuild-atari/Makefile +++ /dev/null @@ -1,152 +0,0 @@ -# This Makefile can be used to cross-compile pForth on a Linux host to -# an Atari ST target. GCC is used as host-compiler and VBCC as -# cross-compiler. - -# makefile for pForth -# Portable Forth written in 'C' -# by Phil Burk -# For more info visit http://www.softsynth.com/pforth/ -# -# See "help" target below. - -# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG -# See "docs/pf_ref.htm" file for more info. - -# We are going to use VBCC as cross compiler. I've installed VBCC -# under /opt/vbcc. It's configured to generate Motorola 680x0 code. -VBCC := /opt/vbcc -PATH := $(VBCC)/bin:$(PATH) -XCC = vc # The VBCC compiler - -SRCDIR = ../.. -PFORTHDIR = $(SRCDIR) -CSRCDIR = $(PFORTHDIR)/csrc -FTHDIR = $(PFORTHDIR)/fth - -PFDICAPP = pforth -PFORTHDIC = pforth.dic -PFDICDAT = pfdicdat.h -PFORTHAPP = pforth.ttp - -# We need to create a 32-bit dictionary -WIDTHOPT= -m32 -DEBUGOPTS = -g -FULL_WARNINGS = \ - --std=c89 \ - -pedantic \ - -Wcast-qual \ - -Wall \ - -Wwrite-strings \ - -Winline \ - -Wmissing-prototypes \ - -Wmissing-declarations -CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) - -#IO_SOURCE = pf_io_posix.c -IO_SOURCE = pf_io_stdio.c pf_fileio_stdio.c -#IO_SOURCE = pf_io_win32_console.c - -EMBCCOPTS = -DPF_STATIC_DIC - -####################################### -PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ - pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ - pf_text.h pf_types.h pf_words.h pfcompfp.h \ - pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h -PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ - pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ - pf_text.c pf_words.c pfcompil.c pfcustom.c -PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) - -VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio - - -CPPFLAGS = -I. -DPF_BIG_ENDIAN_DIC -DPF_SUPPORT_FP -CFLAGS = $(CCOPTS) -LDFLAGS = $(WIDTHOPT) -lm - -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) - -# Cross compiler flags (for VBCC not gcc) -XCFLAGS = +tos -c99 -O3 -#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 -XCPPFLAGS = -I. -DATARI -DPF_SUPPORT_FP -XLDFLAGS = +tos -lm -lm881 - -XCOMPILE = $(XCC) $(XCFLAGS) $(XCPPFLAGS) -XLINK = $(XCC) $(XLDFLAGS) - -.SUFFIXES: .c .o .eo - -PFOBJS = $(PFSOURCE:.c=.o) -PFEMBOBJS = $(PFSOURCE:.c=.eo) - -.c.o: $(PFINCLUDES) - $(COMPILE) -c -o $@ $< - -.c.eo: $(PFINCLUDES) pfdicdat.h - $(XCOMPILE) $(EMBCCOPTS) -c -o $@ $< - -.PHONY: all clean test -.PHONY: help pffiles pfdicapp pfdicdat pforthapp - -all: $(PFORTHAPP) - -pffiles: - @echo "INCLUDE FILES -----------------" - @echo ${PFINCLUDES} - @echo "'C' FILES ---------------------" - @echo ${PFSOURCE} - @echo "OBJECT FILES ------------------" - @echo ${PFOBJS} - @echo "EMBEDDED OBJECT FILES ------------------" - @echo ${PFEMBOBJS} - -# Build pforth by compiling 'C' source. -$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) - $(CC) -o $@ $(PFOBJS) $(LDADD) $(LDFLAGS) - -# Build basic dictionary image by running newly built pforth and including "system.fth". -$(PFORTHDIC): $(PFDICAPP) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) - (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ - -$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) - echo 'include $(FTHDIR)/savedicd.fth SDAD'>load-dict-tmp.fth&& ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth - -$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) - $(XLINK) -o $@ $(PFEMBOBJS) $(XLDADD) - @echo "" - @echo "Standalone pForth executable written to $(PFORTHAPP)" - - -# target aliases -pfdicapp: $(PFDICAPP) - -pfdicdat: $(PFDICDAT) - -pforthapp: $(PFORTHAPP) - -help: - @echo "Use 'make all' to build standalone pForth executable." - @echo "PForth can be built in several stages using these targets:" - @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." - @echo " pfdicdat = image of full dictionary build by compiling Forth code." - @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." - @echo "" - @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." - @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." - -test: $(PFORTHAPP) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) - -clean: - rm -f $(PFOBJS) $(PFEMBOBJS) - rm -f $(PFORTHAPP) - rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) - rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) - rm -f $(PFDICAPP) diff --git a/build/mingw-crossbuild-linux/Makefile b/build/mingw-crossbuild-linux/Makefile deleted file mode 100644 index a6d3161..0000000 --- a/build/mingw-crossbuild-linux/Makefile +++ /dev/null @@ -1,150 +0,0 @@ -# makefile for pForth -# Portable Forth written in 'C' -# by Phil Burk -# For more info visit http://www.softsynth.com/pforth/ -# -# See "help" target below. - -.POSIX: - -# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG -# See "docs/pf_ref.htm" file for more info. - -CC = x86_64-w64-mingw32-gcc -WINE = wineconsole -SRCDIR = ../.. -PFORTHDIR = $(SRCDIR) -CSRCDIR = $(PFORTHDIR)/csrc -FTHDIR = $(PFORTHDIR)/fth - -PFDICAPP = pforth.exe -PFORTHDIC = pforth.dic -PFDICDAT = pfdicdat.h -PFORTHAPP = pforth_standalone.exe - -# This is needed to get pForth to build on Snow Leopard and other 64 bit platforms. -WIDTHOPT= - -FULL_WARNINGS = \ - --std=c89 \ - -fsigned-char \ - -fno-builtin \ - -fno-unroll-loops \ - -fpeephole \ - -fno-keep-inline-functions \ - -pedantic \ - -Wcast-qual \ - -Wall \ - -Wwrite-strings \ - -Winline \ - -Wmissing-prototypes \ - -Wmissing-declarations - -DEBUGOPTS = -g -CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) - -#IO_SOURCE = pf_io_posix.c -#IO_SOURCE = pf_io_stdio.c -IO_SOURCE = pf_io_win32_console.c pf_fileio_stdio.c - -EMBCCOPTS = -DPF_STATIC_DIC - -####################################### -PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ - pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ - pf_text.h pf_types.h pf_win32.h pf_words.h pfcompfp.h \ - pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h -PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ - pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ - pf_text.c pf_words.c pfcompil.c pfcustom.c -PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) - -VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32 - -XCFLAGS = $(CCOPTS) -#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 -XCPPFLAGS = -DWIN32 -XLDFLAGS = $(WIDTHOPT) - -CPPFLAGS = -I. $(XCPPFLAGS) -CFLAGS = $(XCFLAGS) -LDFLAGS = $(XLDFLAGS) - -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -LINK = $(CC) $(LDFLAGS) - -.SUFFIXES: .c .o .eo - -PFOBJS = $(PFSOURCE:.c=.o) -PFEMBOBJS = $(PFSOURCE:.c=.eo) - -.c.o: $(PFINCLUDES) - $(COMPILE) -c -o $@ $< - -.c.eo: $(PFINCLUDES) pfdicdat.h - $(COMPILE) $(EMBCCOPTS) -c -o $@ $< - -.PHONY: all clean test -.PHONY: help pffiles pfdicapp pfdicdat pforthapp - -all: $(PFORTHAPP) - -pffiles: - @echo "INCLUDE FILES -----------------" - @echo ${PFINCLUDES} - @echo "'C' FILES ---------------------" - @echo ${PFSOURCE} - @echo "OBJECT FILES ------------------" - @echo ${PFOBJS} - @echo "EMBEDDED OBJECT FILES ------------------" - @echo ${PFEMBOBJS} - -# Build pforth by compiling 'C' source. -$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) - $(LINK) -o $@ $(PFOBJS) $(LDADD) -lm - -# Build basic dictionary image by running newly built pforth and including "system.fth". -$(PFORTHDIC): $(PFDICAPP) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFDICAPP) -i system.fth) - (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ - -$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) - echo 'include $(FTHDIR)/savedicd.fth SDAD BYE'>load-dict-tmp.fth&& $(WINE) ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth - -$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) - $(LINK) -o $@ $(PFEMBOBJS) $(LDADD) -lm - @echo "" - @echo "Standalone pForth executable written to $(PFORTHAPP)" - - -# target aliases -pfdicapp: $(PFDICAPP) - -pfdicdat: $(PFDICDAT) - -pforthapp: $(PFORTHAPP) - -help: - @echo "Use 'make all' to build standalone pForth executable." - @echo "PForth can be built in several stages using these targets:" - @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." - @echo " pfdicdat = image of full dictionary build by compiling Forth code." - @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." - @echo "" - @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." - @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." - -test: $(PFORTHAPP) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) - wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_file.fth) - -clean: - rm -f $(PFOBJS) $(PFEMBOBJS) - rm -f $(PFORTHAPP) - rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) - rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) - rm -f $(PFDICAPP) diff --git a/build/unix/Makefile b/build/unix/Makefile deleted file mode 100644 index 626d0ce..0000000 --- a/build/unix/Makefile +++ /dev/null @@ -1,145 +0,0 @@ -# makefile for pForth -# Portable Forth written in 'C' -# by Phil Burk -# For more info visit http://www.softsynth.com/pforth/ -# -# See "help" target below. - -.POSIX: - -# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG -# See "docs/pf_ref.htm" file for more info. - -SRCDIR = ../.. -PFORTHDIR = $(SRCDIR) -CSRCDIR = $(PFORTHDIR)/csrc -FTHDIR = $(PFORTHDIR)/fth - -PFDICAPP = pforth -PFORTHDIC = pforth.dic -PFDICDAT = pfdicdat.h -PFORTHAPP = pforth_standalone - -# This is needed to get pForth to build on Snow Leopard and other 64 bit platforms. -WIDTHOPT= - -FULL_WARNINGS = \ - --std=c89 \ - -fsigned-char \ - -fno-builtin \ - -fno-unroll-loops \ - -fno-keep-inline-functions \ - -pedantic \ - -Wcast-qual \ - -Wall \ - -Wwrite-strings \ - -Winline \ - -Wmissing-prototypes \ - -Wmissing-declarations - -DEBUGOPTS = -g -CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) - -IO_SOURCE = pf_io_posix.c pf_fileio_stdio.c -#IO_SOURCE = pf_io_stdio.c - -EMBCCOPTS = -DPF_STATIC_DIC #-DPF_NO_FILEIO - -####################################### -PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ - pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ - pf_text.h pf_types.h pf_win32.h pf_words.h pfcompfp.h \ - pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h -PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ - pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ - pf_text.c pf_words.c pfcompil.c pfcustom.c -PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) - -VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32 - -XCFLAGS = $(CCOPTS) -XCPPFLAGS = -DPF_SUPPORT_FP -D_DEFAULT_SOURCE -D_GNU_SOURCE -XLDFLAGS = $(WIDTHOPT) - -CPPFLAGS = -I. $(XCPPFLAGS) -CFLAGS = $(XCFLAGS) -LDFLAGS = $(XLDFLAGS) - -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -LINK = $(CC) $(LDFLAGS) - -.SUFFIXES: .c .o .eo - -PFOBJS = $(PFSOURCE:.c=.o) -PFEMBOBJS = $(PFSOURCE:.c=.eo) - -%.o: %.c $(PFINCLUDES) - $(COMPILE) -c -o $@ $< - -%.eo: %.c $(PFINCLUDES) pfdicdat.h - $(COMPILE) $(EMBCCOPTS) -c -o $@ $< - -.PHONY: all clean test -.PHONY: help pffiles pfdicapp pfdicdat pforthapp - -all: $(PFORTHAPP) - -pffiles: - @echo "INCLUDE FILES -----------------" - @echo ${PFINCLUDES} - @echo "'C' FILES ---------------------" - @echo ${PFSOURCE} - @echo "OBJECT FILES ------------------" - @echo ${PFOBJS} - @echo "EMBEDDED OBJECT FILES ------------------" - @echo ${PFEMBOBJS} - -# Build pforth by compiling 'C' source. -$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) - $(LINK) -o $@ $(PFOBJS) $(LDADD) -lm - -# Build basic dictionary image by running newly built pforth and including "system.fth". -$(PFORTHDIC): $(PFDICAPP) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) - (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ - -$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) - echo 'include $(FTHDIR)/savedicd.fth SDAD BYE' | ./$(PFDICAPP) -d $(PFORTHDIC) - -$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) - $(LINK) -o $@ $(PFEMBOBJS) $(LDADD) -lm - @echo "" - @echo "Standalone pForth executable written to $(PFORTHAPP)" - - -# target aliases -pfdicapp: $(PFDICAPP) - -pfdicdat: $(PFDICDAT) - -pforthapp: $(PFORTHAPP) - -help: - @echo "Use 'make all' to build standalone pForth executable." - @echo "PForth can be built in several stages using these targets:" - @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." - @echo " pfdicdat = image of full dictionary build by compiling Forth code." - @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." - @echo "" - @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." - @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." - -test: $(PFORTHAPP) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_corex.fth) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_strings.fth) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_locals.fth) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_alloc.fth) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_floats.fth) - wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_file.fth) - -clean: - rm -f $(PFOBJS) $(PFEMBOBJS) - rm -f $(PFORTHAPP) - rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) - rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) - rm -f $(PFDICAPP) diff --git a/build/win32/vs2017/pforth.sln b/build/win32/vs2017/pforth.sln deleted file mode 100644 index b35fd9c..0000000 --- a/build/win32/vs2017/pforth.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2010 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pforth_main", "pforth_main.vcxproj", "{58B76DB8-1985-4B8A-8E71-C012D8F0C518}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.ActiveCfg = Debug|Win32 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.Build.0 = Debug|Win32 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.ActiveCfg = Debug|x64 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.Build.0 = Debug|x64 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.ActiveCfg = Release|Win32 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.Build.0 = Release|Win32 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.ActiveCfg = Release|x64 - {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4FCA3FD0-0EBB-4534-9A49-51A638D09B2F} - EndGlobalSection -EndGlobal diff --git a/build/win32/vs2017/pforth_main.vcxproj b/build/win32/vs2017/pforth_main.vcxproj deleted file mode 100644 index 0b6ab8b..0000000 --- a/build/win32/vs2017/pforth_main.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {58B76DB8-1985-4B8A-8E71-C012D8F0C518} - pforth_main - Win32Proj - pforth - - - - Application - v141 - NotSet - true - - - Application - v141 - NotSet - true - - - Application - v141 - Unicode - - - Application - v141 - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>15.0.27130.2010 - - - $(SolutionDir)..\..\..\fth\ - $(Configuration)\ - true - - - true - - - $(SolutionDir)..\..\..\fth\ - $(Configuration)\ - false - - - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - EditAndContinue - - - true - Console - MachineX86 - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Console - - - - - WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - - Level3 - ProgramDatabase - - - true - Console - true - true - MachineX86 - - - - - WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - true - Console - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/win32/vs2017/pforth_main.vcxproj.filters b/build/win32/vs2017/pforth_main.vcxproj.filters deleted file mode 100644 index 2f6b984..0000000 --- a/build/win32/vs2017/pforth_main.vcxproj.filters +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - Include - - - - - {6711f4b0-6d8c-4641-8260-e6d2c953bd3b} - - - {298706eb-f166-4f0b-8404-a52c3fdf5d21} - - - \ No newline at end of file diff --git a/platforms/linux-crossbuild-amiga/Makefile b/platforms/linux-crossbuild-amiga/Makefile new file mode 100644 index 0000000..55698f6 --- /dev/null +++ b/platforms/linux-crossbuild-amiga/Makefile @@ -0,0 +1,153 @@ +# This Makefile can be used to cross-compile pForth on a Linux host to +# an Amiga target. GCC is used as host-compiler and VBCC as +# cross-compiler. + +# makefile for pForth +# Portable Forth written in 'C' +# by Phil Burk +# For more info visit http://www.softsynth.com/pforth/ +# +# See "help" target below. + +# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG +# See "docs/pf_ref.htm" file for more info. + +# We are going to use VBCC as cross compiler. I've installed VBCC +# under /opt/m68k-amigaos. It's configured to generate Motorola 680x0 code in +# "Amiga Hunk" object format. +VBCC := /opt/m68k-amigaos +PATH := $(VBCC)/bin:$(PATH) +XCC = vc # The VBCC compiler + +SRCDIR = ../.. +PFORTHDIR = $(SRCDIR) +CSRCDIR = $(PFORTHDIR)/csrc +FTHDIR = $(PFORTHDIR)/fth + +PFDICAPP = pforth +PFORTHDIC = pforth.dic +PFDICDAT = pfdicdat.h +PFORTHAPP = amiga_pforth_standalone + +# We need to create a 32-bit dictionary +WIDTHOPT= -m32 +DEBUGOPTS = -g +FULL_WARNINGS = \ + --std=c89 \ + -pedantic \ + -Wcast-qual \ + -Wall \ + -Wwrite-strings \ + -Winline \ + -Wmissing-prototypes \ + -Wmissing-declarations +CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) + +#IO_SOURCE = pf_io_posix.c +IO_SOURCE = pf_io_stdio.c pf_fileio_stdio.c +#IO_SOURCE = pf_io_win32_console.c + +EMBCCOPTS = -DPF_STATIC_DIC + +####################################### +PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ + pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ + pf_text.h pf_types.h pf_words.h pfcompfp.h \ + pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h +PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ + pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ + pf_text.c pf_words.c pfcompil.c pfcustom.c +PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) + +VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio + + +CPPFLAGS = -I. -DPF_BIG_ENDIAN_DIC -DPF_SUPPORT_FP +CFLAGS = $(CCOPTS) +LDFLAGS = $(WIDTHOPT) -lm + +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) + +# Cross compiler flags (for VBCC not gcc) +XCFLAGS = -c99 -O3 +#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 +XCPPFLAGS = -I. -DAMIGA -DPF_SUPPORT_FP +XLDFLAGS = -lmieee -lm881 + +XCOMPILE = $(XCC) $(XCFLAGS) $(XCPPFLAGS) +XLINK = $(XCC) $(XLDFLAGS) + +.SUFFIXES: .c .o .eo + +PFOBJS = $(PFSOURCE:.c=.o) +PFEMBOBJS = $(PFSOURCE:.c=.eo) + +.c.o: $(PFINCLUDES) + $(COMPILE) -c -o $@ $< + +.c.eo: $(PFINCLUDES) pfdicdat.h + $(XCOMPILE) $(EMBCCOPTS) -c -o $@ $< + +.PHONY: all clean test +.PHONY: help pffiles pfdicapp pfdicdat pforthapp + +all: $(PFORTHAPP) + +pffiles: + @echo "INCLUDE FILES -----------------" + @echo ${PFINCLUDES} + @echo "'C' FILES ---------------------" + @echo ${PFSOURCE} + @echo "OBJECT FILES ------------------" + @echo ${PFOBJS} + @echo "EMBEDDED OBJECT FILES ------------------" + @echo ${PFEMBOBJS} + +# Build pforth by compiling 'C' source. +$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) + $(CC) -o $@ $(PFOBJS) $(LDADD) $(LDFLAGS) + +# Build basic dictionary image by running newly built pforth and including "system.fth". +$(PFORTHDIC): $(PFDICAPP) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) + (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ + +$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) + echo 'include $(FTHDIR)/savedicd.fth SDAD'>load-dict-tmp.fth&& ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth + +$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) + $(XLINK) -o $@ $(PFEMBOBJS) $(XLDADD) + @echo "" + @echo "Standalone pForth executable written to $(PFORTHAPP)" + + +# target aliases +pfdicapp: $(PFDICAPP) + +pfdicdat: $(PFDICDAT) + +pforthapp: $(PFORTHAPP) + +help: + @echo "Use 'make all' to build standalone pForth executable." + @echo "PForth can be built in several stages using these targets:" + @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." + @echo " pfdicdat = image of full dictionary build by compiling Forth code." + @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." + @echo "" + @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." + @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." + +test: $(PFORTHAPP) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) + +clean: + rm -f $(PFOBJS) $(PFEMBOBJS) + rm -f $(PFORTHAPP) + rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) + rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) + rm -f $(PFDICAPP) diff --git a/platforms/linux-crossbuild-atari/Makefile b/platforms/linux-crossbuild-atari/Makefile new file mode 100644 index 0000000..7327163 --- /dev/null +++ b/platforms/linux-crossbuild-atari/Makefile @@ -0,0 +1,152 @@ +# This Makefile can be used to cross-compile pForth on a Linux host to +# an Atari ST target. GCC is used as host-compiler and VBCC as +# cross-compiler. + +# makefile for pForth +# Portable Forth written in 'C' +# by Phil Burk +# For more info visit http://www.softsynth.com/pforth/ +# +# See "help" target below. + +# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG +# See "docs/pf_ref.htm" file for more info. + +# We are going to use VBCC as cross compiler. I've installed VBCC +# under /opt/vbcc. It's configured to generate Motorola 680x0 code. +VBCC := /opt/vbcc +PATH := $(VBCC)/bin:$(PATH) +XCC = vc # The VBCC compiler + +SRCDIR = ../.. +PFORTHDIR = $(SRCDIR) +CSRCDIR = $(PFORTHDIR)/csrc +FTHDIR = $(PFORTHDIR)/fth + +PFDICAPP = pforth +PFORTHDIC = pforth.dic +PFDICDAT = pfdicdat.h +PFORTHAPP = pforth.ttp + +# We need to create a 32-bit dictionary +WIDTHOPT= -m32 +DEBUGOPTS = -g +FULL_WARNINGS = \ + --std=c89 \ + -pedantic \ + -Wcast-qual \ + -Wall \ + -Wwrite-strings \ + -Winline \ + -Wmissing-prototypes \ + -Wmissing-declarations +CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) + +#IO_SOURCE = pf_io_posix.c +IO_SOURCE = pf_io_stdio.c pf_fileio_stdio.c +#IO_SOURCE = pf_io_win32_console.c + +EMBCCOPTS = -DPF_STATIC_DIC + +####################################### +PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ + pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ + pf_text.h pf_types.h pf_words.h pfcompfp.h \ + pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h +PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ + pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ + pf_text.c pf_words.c pfcompil.c pfcustom.c +PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) + +VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio + + +CPPFLAGS = -I. -DPF_BIG_ENDIAN_DIC -DPF_SUPPORT_FP +CFLAGS = $(CCOPTS) +LDFLAGS = $(WIDTHOPT) -lm + +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) + +# Cross compiler flags (for VBCC not gcc) +XCFLAGS = +tos -c99 -O3 +#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 +XCPPFLAGS = -I. -DATARI -DPF_SUPPORT_FP +XLDFLAGS = +tos -lm -lm881 + +XCOMPILE = $(XCC) $(XCFLAGS) $(XCPPFLAGS) +XLINK = $(XCC) $(XLDFLAGS) + +.SUFFIXES: .c .o .eo + +PFOBJS = $(PFSOURCE:.c=.o) +PFEMBOBJS = $(PFSOURCE:.c=.eo) + +.c.o: $(PFINCLUDES) + $(COMPILE) -c -o $@ $< + +.c.eo: $(PFINCLUDES) pfdicdat.h + $(XCOMPILE) $(EMBCCOPTS) -c -o $@ $< + +.PHONY: all clean test +.PHONY: help pffiles pfdicapp pfdicdat pforthapp + +all: $(PFORTHAPP) + +pffiles: + @echo "INCLUDE FILES -----------------" + @echo ${PFINCLUDES} + @echo "'C' FILES ---------------------" + @echo ${PFSOURCE} + @echo "OBJECT FILES ------------------" + @echo ${PFOBJS} + @echo "EMBEDDED OBJECT FILES ------------------" + @echo ${PFEMBOBJS} + +# Build pforth by compiling 'C' source. +$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) + $(CC) -o $@ $(PFOBJS) $(LDADD) $(LDFLAGS) + +# Build basic dictionary image by running newly built pforth and including "system.fth". +$(PFORTHDIC): $(PFDICAPP) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) + (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ + +$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) + echo 'include $(FTHDIR)/savedicd.fth SDAD'>load-dict-tmp.fth&& ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth + +$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) + $(XLINK) -o $@ $(PFEMBOBJS) $(XLDADD) + @echo "" + @echo "Standalone pForth executable written to $(PFORTHAPP)" + + +# target aliases +pfdicapp: $(PFDICAPP) + +pfdicdat: $(PFDICDAT) + +pforthapp: $(PFORTHAPP) + +help: + @echo "Use 'make all' to build standalone pForth executable." + @echo "PForth can be built in several stages using these targets:" + @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." + @echo " pfdicdat = image of full dictionary build by compiling Forth code." + @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." + @echo "" + @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." + @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." + +test: $(PFORTHAPP) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) + +clean: + rm -f $(PFOBJS) $(PFEMBOBJS) + rm -f $(PFORTHAPP) + rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) + rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) + rm -f $(PFDICAPP) diff --git a/platforms/mingw-crossbuild-linux/Makefile b/platforms/mingw-crossbuild-linux/Makefile new file mode 100644 index 0000000..a6d3161 --- /dev/null +++ b/platforms/mingw-crossbuild-linux/Makefile @@ -0,0 +1,150 @@ +# makefile for pForth +# Portable Forth written in 'C' +# by Phil Burk +# For more info visit http://www.softsynth.com/pforth/ +# +# See "help" target below. + +.POSIX: + +# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG +# See "docs/pf_ref.htm" file for more info. + +CC = x86_64-w64-mingw32-gcc +WINE = wineconsole +SRCDIR = ../.. +PFORTHDIR = $(SRCDIR) +CSRCDIR = $(PFORTHDIR)/csrc +FTHDIR = $(PFORTHDIR)/fth + +PFDICAPP = pforth.exe +PFORTHDIC = pforth.dic +PFDICDAT = pfdicdat.h +PFORTHAPP = pforth_standalone.exe + +# This is needed to get pForth to build on Snow Leopard and other 64 bit platforms. +WIDTHOPT= + +FULL_WARNINGS = \ + --std=c89 \ + -fsigned-char \ + -fno-builtin \ + -fno-unroll-loops \ + -fpeephole \ + -fno-keep-inline-functions \ + -pedantic \ + -Wcast-qual \ + -Wall \ + -Wwrite-strings \ + -Winline \ + -Wmissing-prototypes \ + -Wmissing-declarations + +DEBUGOPTS = -g +CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) + +#IO_SOURCE = pf_io_posix.c +#IO_SOURCE = pf_io_stdio.c +IO_SOURCE = pf_io_win32_console.c pf_fileio_stdio.c + +EMBCCOPTS = -DPF_STATIC_DIC + +####################################### +PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ + pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ + pf_text.h pf_types.h pf_win32.h pf_words.h pfcompfp.h \ + pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h +PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ + pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ + pf_text.c pf_words.c pfcompil.c pfcustom.c +PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) + +VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32 + +XCFLAGS = $(CCOPTS) +#XCPPFLAGS = -DPF_SUPPORT_FP -DWIN32 +XCPPFLAGS = -DWIN32 +XLDFLAGS = $(WIDTHOPT) + +CPPFLAGS = -I. $(XCPPFLAGS) +CFLAGS = $(XCFLAGS) +LDFLAGS = $(XLDFLAGS) + +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) +LINK = $(CC) $(LDFLAGS) + +.SUFFIXES: .c .o .eo + +PFOBJS = $(PFSOURCE:.c=.o) +PFEMBOBJS = $(PFSOURCE:.c=.eo) + +.c.o: $(PFINCLUDES) + $(COMPILE) -c -o $@ $< + +.c.eo: $(PFINCLUDES) pfdicdat.h + $(COMPILE) $(EMBCCOPTS) -c -o $@ $< + +.PHONY: all clean test +.PHONY: help pffiles pfdicapp pfdicdat pforthapp + +all: $(PFORTHAPP) + +pffiles: + @echo "INCLUDE FILES -----------------" + @echo ${PFINCLUDES} + @echo "'C' FILES ---------------------" + @echo ${PFSOURCE} + @echo "OBJECT FILES ------------------" + @echo ${PFOBJS} + @echo "EMBEDDED OBJECT FILES ------------------" + @echo ${PFEMBOBJS} + +# Build pforth by compiling 'C' source. +$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) + $(LINK) -o $@ $(PFOBJS) $(LDADD) -lm + +# Build basic dictionary image by running newly built pforth and including "system.fth". +$(PFORTHDIC): $(PFDICAPP) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFDICAPP) -i system.fth) + (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ + +$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) + echo 'include $(FTHDIR)/savedicd.fth SDAD BYE'>load-dict-tmp.fth&& $(WINE) ./$(PFDICAPP) -d $(PFORTHDIC) load-dict-tmp.fth; rm -f load-dict-tmp.fth + +$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) + $(LINK) -o $@ $(PFEMBOBJS) $(LDADD) -lm + @echo "" + @echo "Standalone pForth executable written to $(PFORTHAPP)" + + +# target aliases +pfdicapp: $(PFDICAPP) + +pfdicdat: $(PFDICDAT) + +pforthapp: $(PFORTHAPP) + +help: + @echo "Use 'make all' to build standalone pForth executable." + @echo "PForth can be built in several stages using these targets:" + @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." + @echo " pfdicdat = image of full dictionary build by compiling Forth code." + @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." + @echo "" + @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." + @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." + +test: $(PFORTHAPP) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_corex.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_strings.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_locals.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_alloc.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_floats.fth) + wd=$$(pwd); (cd $(FTHDIR); $(WINE) $${wd}/$(PFORTHAPP) -q t_file.fth) + +clean: + rm -f $(PFOBJS) $(PFEMBOBJS) + rm -f $(PFORTHAPP) + rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) + rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) + rm -f $(PFDICAPP) diff --git a/platforms/unix/Makefile b/platforms/unix/Makefile new file mode 100644 index 0000000..626d0ce --- /dev/null +++ b/platforms/unix/Makefile @@ -0,0 +1,145 @@ +# makefile for pForth +# Portable Forth written in 'C' +# by Phil Burk +# For more info visit http://www.softsynth.com/pforth/ +# +# See "help" target below. + +.POSIX: + +# Options include: PF_SUPPORT_FP PF_NO_MALLOC PF_NO_INIT PF_DEBUG +# See "docs/pf_ref.htm" file for more info. + +SRCDIR = ../.. +PFORTHDIR = $(SRCDIR) +CSRCDIR = $(PFORTHDIR)/csrc +FTHDIR = $(PFORTHDIR)/fth + +PFDICAPP = pforth +PFORTHDIC = pforth.dic +PFDICDAT = pfdicdat.h +PFORTHAPP = pforth_standalone + +# This is needed to get pForth to build on Snow Leopard and other 64 bit platforms. +WIDTHOPT= + +FULL_WARNINGS = \ + --std=c89 \ + -fsigned-char \ + -fno-builtin \ + -fno-unroll-loops \ + -fno-keep-inline-functions \ + -pedantic \ + -Wcast-qual \ + -Wall \ + -Wwrite-strings \ + -Winline \ + -Wmissing-prototypes \ + -Wmissing-declarations + +DEBUGOPTS = -g +CCOPTS = $(WIDTHOPT) -x c -O2 $(FULL_WARNINGS) $(EXTRA_CCOPTS) $(DEBUGOPTS) + +IO_SOURCE = pf_io_posix.c pf_fileio_stdio.c +#IO_SOURCE = pf_io_stdio.c + +EMBCCOPTS = -DPF_STATIC_DIC #-DPF_NO_FILEIO + +####################################### +PFINCLUDES = pf_all.h pf_cglue.h pf_clib.h pf_core.h pf_float.h \ + pf_guts.h pf_host.h pf_inc1.h pf_io.h pf_mem.h pf_save.h \ + pf_text.h pf_types.h pf_win32.h pf_words.h pfcompfp.h \ + pfcompil.h pfdicdat_arm.h pfinnrfp.h pforth.h +PFBASESOURCE = pf_cglue.c pf_clib.c pf_core.c pf_inner.c \ + pf_io.c pf_io_none.c pf_main.c pf_mem.c pf_save.c \ + pf_text.c pf_words.c pfcompil.c pfcustom.c +PFSOURCE = $(PFBASESOURCE) $(IO_SOURCE) + +VPATH = .:$(CSRCDIR):$(CSRCDIR)/posix:$(CSRCDIR)/stdio:$(CSRCDIR)/win32_console:$(CSRCDIR)/win32 + +XCFLAGS = $(CCOPTS) +XCPPFLAGS = -DPF_SUPPORT_FP -D_DEFAULT_SOURCE -D_GNU_SOURCE +XLDFLAGS = $(WIDTHOPT) + +CPPFLAGS = -I. $(XCPPFLAGS) +CFLAGS = $(XCFLAGS) +LDFLAGS = $(XLDFLAGS) + +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) +LINK = $(CC) $(LDFLAGS) + +.SUFFIXES: .c .o .eo + +PFOBJS = $(PFSOURCE:.c=.o) +PFEMBOBJS = $(PFSOURCE:.c=.eo) + +%.o: %.c $(PFINCLUDES) + $(COMPILE) -c -o $@ $< + +%.eo: %.c $(PFINCLUDES) pfdicdat.h + $(COMPILE) $(EMBCCOPTS) -c -o $@ $< + +.PHONY: all clean test +.PHONY: help pffiles pfdicapp pfdicdat pforthapp + +all: $(PFORTHAPP) + +pffiles: + @echo "INCLUDE FILES -----------------" + @echo ${PFINCLUDES} + @echo "'C' FILES ---------------------" + @echo ${PFSOURCE} + @echo "OBJECT FILES ------------------" + @echo ${PFOBJS} + @echo "EMBEDDED OBJECT FILES ------------------" + @echo ${PFEMBOBJS} + +# Build pforth by compiling 'C' source. +$(PFDICAPP): $(PFINCLUDES) $(PFOBJS) + $(LINK) -o $@ $(PFOBJS) $(LDADD) -lm + +# Build basic dictionary image by running newly built pforth and including "system.fth". +$(PFORTHDIC): $(PFDICAPP) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFDICAPP) -i system.fth) + (cd $(FTHDIR); cat pforth.dic; rm -f pforth.dic) > $@ + +$(PFDICDAT): $(PFORTHDIC) $(PFDICAPP) + echo 'include $(FTHDIR)/savedicd.fth SDAD BYE' | ./$(PFDICAPP) -d $(PFORTHDIC) + +$(PFORTHAPP): $(PFDICDAT) $(PFEMBOBJS) + $(LINK) -o $@ $(PFEMBOBJS) $(LDADD) -lm + @echo "" + @echo "Standalone pForth executable written to $(PFORTHAPP)" + + +# target aliases +pfdicapp: $(PFDICAPP) + +pfdicdat: $(PFDICDAT) + +pforthapp: $(PFORTHAPP) + +help: + @echo "Use 'make all' to build standalone pForth executable." + @echo "PForth can be built in several stages using these targets:" + @echo " pfdicapp = executable pForth with minimal dictionary. All from 'C'." + @echo " pfdicdat = image of full dictionary build by compiling Forth code." + @echo " pforthapp = executable with embedded dictionary image. DEFAULT 'all' target." + @echo "" + @echo " The file 'fth/pfdicdat.h' is generated by pForth. It contains a binary image of the Forth dictionary." + @echo " It allows pForth to work as a standalone image that does not need to load a dictionary file." + +test: $(PFORTHAPP) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_corex.fth) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_strings.fth) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_locals.fth) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_alloc.fth) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_floats.fth) + wd=$$(pwd); (cd $(FTHDIR); $${wd}/$(PFORTHAPP) -q t_file.fth) + +clean: + rm -f $(PFOBJS) $(PFEMBOBJS) + rm -f $(PFORTHAPP) + rm -f $(PFDICDAT) $(FTHDIR)/$(PFDICDAT) + rm -f $(PFORTHDIC) $(FTHDIR)/$(PFORTHDIC) + rm -f $(PFDICAPP) diff --git a/platforms/win32/vs2017/pforth.sln b/platforms/win32/vs2017/pforth.sln new file mode 100644 index 0000000..b35fd9c --- /dev/null +++ b/platforms/win32/vs2017/pforth.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pforth_main", "pforth_main.vcxproj", "{58B76DB8-1985-4B8A-8E71-C012D8F0C518}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.ActiveCfg = Debug|Win32 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|Win32.Build.0 = Debug|Win32 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.ActiveCfg = Debug|x64 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Debug|x64.Build.0 = Debug|x64 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.ActiveCfg = Release|Win32 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|Win32.Build.0 = Release|Win32 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.ActiveCfg = Release|x64 + {58B76DB8-1985-4B8A-8E71-C012D8F0C518}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4FCA3FD0-0EBB-4534-9A49-51A638D09B2F} + EndGlobalSection +EndGlobal diff --git a/platforms/win32/vs2017/pforth_main.vcxproj b/platforms/win32/vs2017/pforth_main.vcxproj new file mode 100644 index 0000000..0b6ab8b --- /dev/null +++ b/platforms/win32/vs2017/pforth_main.vcxproj @@ -0,0 +1,193 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {58B76DB8-1985-4B8A-8E71-C012D8F0C518} + pforth_main + Win32Proj + pforth + + + + Application + v141 + NotSet + true + + + Application + v141 + NotSet + true + + + Application + v141 + Unicode + + + Application + v141 + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.27130.2010 + + + $(SolutionDir)..\..\..\fth\ + $(Configuration)\ + true + + + true + + + $(SolutionDir)..\..\..\fth\ + $(Configuration)\ + false + + + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + EditAndContinue + + + true + Console + MachineX86 + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + true + Console + + + + + WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + Level3 + ProgramDatabase + + + true + Console + true + true + MachineX86 + + + + + WIN32;NDEBUG;_CONSOLE;PF_SUPPORT_FP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platforms/win32/vs2017/pforth_main.vcxproj.filters b/platforms/win32/vs2017/pforth_main.vcxproj.filters new file mode 100644 index 0000000..2f6b984 --- /dev/null +++ b/platforms/win32/vs2017/pforth_main.vcxproj.filters @@ -0,0 +1,123 @@ + + + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + Source + + + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + + + {6711f4b0-6d8c-4641-8260-e6d2c953bd3b} + + + {298706eb-f166-4f0b-8404-a52c3fdf5d21} + + + \ No newline at end of file diff --git a/readme.txt b/readme.txt index e77c40b..c515ff3 100644 --- a/readme.txt +++ b/readme.txt @@ -8,13 +8,13 @@ Last updated: April 24, 2018 V28 Code for pForth is maintained on GitHub at: https://github.com/philburk/pforth - + Documentation for pForth at: http://www.softsynth.com/pforth/ For technical support please use the pForth forum at: http://groups.google.com/group/pforthdev - + -- LEGAL NOTICE ----------------------------------------- Permission to use, copy, modify, and/or distribute this @@ -31,16 +31,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- Contents of SDK -------------------------------------- - build - tools for building pForth on various platforms - build/unix - Makefile for unix - + platforms - tools for building pForth on various platforms + platforms/unix - Makefile for unix + csrc - pForth kernel in ANSI 'C' csrc/pf_main.c - main() application for a standalone Forth csrc/stdio - I/O code using basic stdio for generic platforms csrc/posix - I/O code for Posix platform csrc/win32 - I/O code for basic WIN32 platform csrc/win32_console - I/O code for WIN32 console that supports command line history - + fth - Forth code fth/util - utility functions @@ -49,7 +49,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. See pForth reference manual at: http://www.softsynth.com/pforth/pf_ref.php - + -- How to run pForth ------------------------------------ Once you have compiled and built the dictionary, just enter: @@ -90,5 +90,5 @@ To run the other tests, enter: pforth t_strings.fth pforth t_locals.fth pforth t_alloc.fth - + They will report the number of tests that pass or fail.