#! /bin/sh # Compile pfe object files for darwin in the current directory, # where the two source files are assumed to be $1-ext.c and # $1-dll.c. # --dnw 22Nov02 # A nonempty $2 is intended for code generated by the # ^Forth translator. TOSFLAG= FTOSFLAG= NOEXTRAFLAG= if test $2 && test $2 != tos && test $2 != ftos \ && test $2 != both && test $2 != none then echo "The second argument must be 'tos', 'ftos', 'both', 'none', or empty." exit 1 else case $2 in tos ) TOSFLAG=-DHF_TOSREG echo "TOS is in a register." ;; ftos ) FTOSFLAG=-DHF_FTOSREG echo "FTOS is in a register." ;; both ) TOSFLAG=-DHF_TOSREG FTOSFLAG=-DHF_FTOSREG echo "Both TOS and FTOS are in registers." ;; "" ) echo "Neither TOS nor FTOS is in a register." ;; none ) NOEXTRAFLAG=-DNO_EXTRA_REGS echo "Using no extra registers." ;; esac fi # Set this path for your build setup. The directory must # already exist. INCLUDEDIR=/usr/local/include # use pfe "make install" target # Make $1-ext object file. cc -I. -I$INCLUDEDIR \ -DHAVE_CONFIG_H $TOSFLAG $FTOSFLAG $NOEXTRAFLAG \ -DNDEBUG -O3 -fomit-frame-pointer -DUNROLL_NEXT \ -Wall -pipe -funsigned-char -Wno-char-subscripts -Wwrite-strings \ -no-cpp-precomp -fno-common \ -c -o $1-ext.o $1-ext.c # Make $1-dll object file. cc -I. -I$INCLUDEDIR -DHAVE_CONFIG_H \ -DNDEBUG -O3 -fomit-frame-pointer -DUNROLL_NEXT \ -Wall -pipe -funsigned-char -Wno-char-subscripts -Wwrite-strings \ -no-cpp-precomp -fno-common \ -c -o $1-dll.o $1-dll.c