#/bin/sh

# To create the MinFORTH Plus binary 'mfp' and the image file 'mfp.i' , open a
# terminal emulator in the MINFORTH Plus directory '~/mfp1.5-w.4.0.2/mfp1.5'
# and enter
#
#   ./make-mfp [Enter]
#
# on the command line.
#

if [ -n "$1" ]; then
   gcc $1.c -o $1  -w -O2 -lm -ldl
 # gcc $1.c -o $1  -Wall -O2 -lm -ldl
   # MM-100101 -ldl added for dlopen ...
   strip $1
else
   echo
   echo "Creating MINFORTH Plus for Linux"
   echo "================================"
   ( echo "making the metacomp binary"        ; ./make-mfp metacomp) && \
     chmod go-wx ./metacomp && \
#  ( echo "making the decomp binary"          ; ./make-mfp decomp) && \
   ( echo "making the mfp binary"             ; ./make-mfp mfp) && \
   ( echo "making the kernel image: kernel.i" ; ./metacomp)  #  && \
   ( echo "making the mfp image: mfp.i"       ; ./extend)
fi

# MM-170227 decomp:64 is still buggy
