-
-
Save FrBrGeorge/a2fa6d8894f29c5d0e400e2593233519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DOSBOX=/usr/bin/dosbox | |
BCCDIR=${BCCDIR:-/home/george/.doses/BC} | |
BCCBAT="$BCCDIR/BCCRUN.BAT" | |
BCCP2M="" | |
case "$1" in | |
*.c|*.C|*.CPP|*.cpp|*.cxx|*.CXX|*.cc|*.CC) | |
SRCDIR=$(dirname $(realpath "$1")) | |
BCCBUILD="BCC `basename "$1"`" | |
shift;; | |
*.mak|*.MAK|makefile|MAKEFILE|Makefile) | |
SRCDIR=$(dirname $(realpath "$1")) | |
BCCBUILD="make -f`basename "$1"`" | |
shift;; | |
*.prj|*.PRJ) | |
SRCDIR=$(dirname $(realpath "$1")) | |
BCCP2M="prj2mak `basename "$1"` makefile. makefile" | |
BCCBUILD="make" | |
shift;; | |
*) test -r MAKEFILE -o -r Makefile -o -r makefile || { | |
echo "No MAKEFILE found" | |
exit 1; } | |
SRCDIR=`pwd` | |
BCCBUILD="make" | |
;; | |
esac | |
echo -E "@echo off | |
mount d $SRCDIR | |
PATH=C:\bc\bin | |
d: | |
$BCCP2M | |
$BCCBUILD > MAKEFILE.LOG" > "$BCCBAT" | |
$DOSBOX -exit "$BCCBAT" | |
cat "$SRCDIR/MAKEFILE.LOG" >&2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
BCC
in the directory with MAKEFILEBCC path-to-file.c
BCC path-to-makefile
BCC path-to-project.prj
in later case the progect will be converted to
MAKEFILE
/~MAKEFILE.CFG` pairCompiling result is stored to MAKEFLE.LOG file and printed to stderr