Skip to content
Snippets Groups Projects
Commit 2963660e authored by sof's avatar sof
Browse files

[project @ 1997-03-13 09:10:17 by sof]

make perl5 friendly plus new Makefile setup
parent b7e04827
No related merge requests found
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.2 1996/11/21 16:49:10 simonm Exp $
# $Id: Makefile,v 1.3 1997/03/13 09:10:17 sof Exp $
TOP=../../..
include $(TOP)/ghc/mk/ghc.mk
TOP=../..
include $(TOP)/mk/boilerplate.mk
DYN_LOADABLE_BITS = \
parse-gcstats.prl \
process-gcstats.prl
PROG=stat2resid
SRC=stat2resid.prl
SCRIPT_PROG=stat2resid
SCRIPT_OBJS=stat2resid.prl
#
# Could be overridden from the cmd line (see install rule below).
#
INSTALLING=0
SCRIPT_SUBST_VARS=TMPDIR SCRIPT_PATH
INTERP=$(PERL)
DESTDIR=$(INSTBINDIR_GHC)
CLEAN_FILES += $(SCRIPT_PROG)
#
# The stat2resid script is configured with a different
# path to the supporting perl scripts, depending on whether it
# is to be installed or not.
#
ifeq "$(INSTALLING)" "1"
SCRIPT_PATH:=$(libdir)
else
SCRIPT_PATH:=$(FPTOOLS_TOP_ABS)/ghc/utils/stat2resid
endif
#
# install setup
#
INSTALL_LIBS += $(DYN_LOADABLE_BITS)
INSTALL_PROGS += $(SCRIPT_PROG)
#
# Before really installing the script, we have to
# reconfigure it such that the paths it refers to,
# point to the installed utils.
#
install ::
$(INSTALL) $(INSTDATAFLAGS) $(DYN_LOADABLE_BITS) $(INSTLIBDIR_GHC)
$(RM) $(SCRIPT_PROG)
$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
include $(TOP)/mk/script.mk
include $(TOP)/mk/target.mk
# Hack to re-create the in-situ build tree script after
# having just installed it.
#
install ::
@$(RM) $(SCRIPT_PROG)
@$(MAKE) $(MFLAGS) $(SCRIPT_PROG)
......@@ -36,9 +36,10 @@ sub parse_stats {
local($statsfile, $line, $row, $col, $val);
local(@stats, @hdr1, @hdr2, @line_vals);
local(%the_stats);
local(*STATS);
open($statsfile, $filename) || die "Cant open $filename \n";
@stats = <$statsfile>;
open(STATS, $filename) || die "Cant open $filename \n";
@stats = <STATS>;
do {$line = shift(@stats);} until ($line !~ /^$/);
chop($line);
......@@ -181,7 +182,7 @@ arg: while($_ = $stats[0]) {
print STDERR "Unmatched line: $_";
}
close($statsfile);
close(STATS);
%the_stats;
}
......
#
# (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
#
# *** MSUB does some substitutions here ***
# *** grep for $( ***
# Perl script expect bindings for the following variables to be prepended
#
# TMPDIR SCRIPT_PATH
#
$debug = 0;
......@@ -11,12 +12,11 @@ $outsuffix = ".resid.ps"; # change as appropriate
if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
$tmpfile = $ENV{'TMPDIR'} . "/$$.resid.data";
} else {
$tmpfile ="$(TMPDIR)/$$.resid.data";
$ENV{'TMPDIR'} = '$(TMPDIR)'; # set the env var as well
$tmpfile ="${TMPDIR}/$$.resid.data";
$ENV{'TMPDIR'} = ${TMPDIR}; # set the env var as well
}
@INC = ( ( $(INSTALLING) ) ? '$(INSTLIBDIR_GHC)'
: '$(TOP_PWD)/$(CURRENT_DIR)' );
@INC = ( ${SCRIPT_PATH} );
require('parse-gcstats.prl') || die "Can't load parse-gcstats.prl!\n";
require('process-gcstats.prl') || die "Can't load process-gcstats.prl!\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment