mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-28 15:54:18 +00:00
37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#! /bin/sh
|
|
# @configure_input@
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 1995 University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#---------------------------------------------------------------------------#
|
|
|
|
# C2INIT - Convert *.c to *_init.c
|
|
#
|
|
# This script outputs an appropriate init.c, given the .c files.
|
|
#
|
|
# Usage: c2init [-w<entry-point>] [-c<maxcalls>] modules...
|
|
#
|
|
# Environment variables: MERCURY_MOD_LIB_DIR, MERCURY_MOD_LIB_MODS,
|
|
# MERCURY_MKINIT.
|
|
|
|
MERCURY_MOD_LIB_DIR=${MERCURY_MOD_LIB_DIR=@LIBDIR@/modules}
|
|
MERCURY_MOD_LIB_MODS=${MERCURY_MOD_LIB_MODS=$MERCURY_MOD_LIB_DIR/*}
|
|
MKINIT=${MERCURY_MKINIT=mkinit}
|
|
|
|
# maximum number of calls to put in a single function
|
|
maxcalls=40
|
|
defentry=mercury__io__run_0_0
|
|
while getopts "w:c:" c
|
|
do
|
|
case $c in
|
|
c) maxcalls="$OPTARG"; shift 2;;
|
|
w) defentry="$OPTARG"; shift 2;;
|
|
\?) echo "Usage: c2init [-w<entry-point>] [-c<maxcalls>]" \
|
|
"modules ..."
|
|
exit 1;;
|
|
esac
|
|
done
|
|
|
|
exec $MKINIT -w"$defentry" -c"$maxcalls" "$@" $MERCURY_MOD_LIB_MODS
|