Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reintroduce bin/ directory and continue cleanup

  • Loading branch information...
commit 2cb7e56ec40a487d4b08407a4cb9d3ab1843d216 1 parent 9668925
@kerneis kerneis authored
View
3  .gitignore
@@ -84,6 +84,9 @@
/cilly/Cilly.pm
/cilly/*.patch2.i*
+# /bin/
+/bin/cilly.*
+
# /_build/
/_build/*
View
68 Makefile.in
@@ -3,10 +3,12 @@
# Makefile for the cil wrapper
# @do_not_edit@ Makefile.in
#
-# author: George Necula
+# authors: George Necula, Gabriel Kerneis
+
+CILLY := cilly
.PHONY: all
-all: cillib cilly
+all: cillib $(CILLY)
# Now add the defines for the CIL features
include Makefile.features
@@ -46,10 +48,10 @@ else
MACHDEPCC=gcc -D_GNUCC
endif
-# Put here all the byproducts of make
# We have to use _build because of OCaml's bug #0004502
OBJDIR := _build
BINDIR := bin
+CILLYDIR := lib
OCAMLBEST := @OCAMLBEST@
CILLIB_FILES = $(OBJDIR)/src/cil.cma
@@ -82,16 +84,16 @@ $(OBJDIR)/doc/%: .FORCE
cillib: $(CILLIB_FILES)
# cilly main executable
-$(OBJDIR)/cilly$(EXE): $(OBJDIR)/src/main$(EXEMODE)
+$(BINDIR)/$(CILLY)$(EXE): $(OBJDIR)/src/main$(EXEMODE)
cp $< $@
# cilly perl wrapper
-cilly/Makefile: cilly/Makefile.PL cilly/App/Cilly.pm
- cd cilly; perl Makefile.PL
+$(CILLYDIR)/Makefile: $(CILLYDIR)/Makefile.PL $(CILLYDIR)/App/Cilly.pm
+ cd $(CILLYDIR); perl Makefile.PL
.PHONY: cilly
-cilly: $(OBJDIR)/cilly$(EXE) cilly/Makefile
- $(MAKE) -C cilly
+$(CILLY): $(BINDIR)/$(CILLY)$(EXE) $(CILLYDIR)/Makefile
+ $(MAKE) -C $(CILLYDIR)
# Create the machine dependency module
# If the cl command cannot be run then the MSVC part will be identical to GCC
@@ -157,17 +159,17 @@ $(OBJDIR)/machdep.ml : src/machdep-ml.c configure.ac Makefile.in
;fi
@echo "let theMachine : mach ref = ref gcc" >>$@
-cilly/App/Cilly.pm: cilly/App/Cilly.pm.in src/machdep-ml.c configure.ac Makefile.in
- cp cilly/App/Cilly.pm.in cilly/App/Cilly.pm
- sed -e "s|CIL_VERSION|@CIL_VERSION@|" cilly/App/Cilly.pm > cilly/App/Cilly.pm.tmp; \
- mv cilly/App/Cilly.pm.tmp cilly/App/Cilly.pm; \
+$(CILLYDIR)/App/Cilly.pm: $(CILLYDIR)/App/Cilly.pm.in src/machdep-ml.c configure.ac Makefile.in
+ cp $(CILLYDIR)/App/Cilly.pm.in $(CILLYDIR)/App/Cilly.pm
+ sed -e "s|CIL_VERSION|@CIL_VERSION@|" $(CILLYDIR)/App/Cilly.pm > $(CILLYDIR)/App/Cilly.pm.tmp; \
+ mv $(CILLYDIR)/App/Cilly.pm.tmp $(CILLYDIR)/App/Cilly.pm; \
if $(MACHDEPCC) -m32 src/machdep-ml.c -o $(OBJDIR)/machdep-ml32.exe ;then \
- sed -e "s|nogcc32model|`$(EMUL) $(OBJDIR)/machdep-ml32.exe --env`|" cilly/App/Cilly.pm > cilly/App/Cilly.pm.tmp; \
- mv cilly/App/Cilly.pm.tmp cilly/App/Cilly.pm; \
+ sed -e "s|nogcc32model|`$(EMUL) $(OBJDIR)/machdep-ml32.exe --env`|" $(CILLYDIR)/App/Cilly.pm > $(CILLYDIR)/App/Cilly.pm.tmp; \
+ mv $(CILLYDIR)/App/Cilly.pm.tmp $(CILLYDIR)/App/Cilly.pm; \
fi
if $(MACHDEPCC) -m64 src/machdep-ml.c -o $(OBJDIR)/machdep-ml64.exe ;then \
- sed -e "s|nogcc64model|`$(EMUL) $(OBJDIR)/machdep-ml64.exe --env`|" cilly/App/Cilly.pm > cilly/App/Cilly.pm.tmp; \
- mv cilly/App/Cilly.pm.tmp cilly/App/Cilly.pm; \
+ sed -e "s|nogcc64model|`$(EMUL) $(OBJDIR)/machdep-ml64.exe --env`|" $(CILLYDIR)/App/Cilly.pm > $(CILLYDIR)/App/Cilly.pm.tmp; \
+ mv $(CILLYDIR)/App/Cilly.pm.tmp $(CILLYDIR)/App/Cilly.pm; \
fi
.PHONY: cilversion
@@ -220,7 +222,7 @@ odoc: $(OBJDIR)/doc/cil.docdir/index.html
-mkdir -p doc/html/cil/
-cp -r $(dir $<) doc/html/cil/api
-doc/cilpp.tex: doc/cilcode.pl doc/cil.tex cilly/App/Cilly.pm
+doc/cilpp.tex: doc/cilcode.pl doc/cil.tex $(CILLYDIR)/App/Cilly.pm
-rm -rf doc/html/cil
-mkdir -p doc/html/cil
-mkdir -p doc/html/cil/examples
@@ -245,7 +247,7 @@ pdfdoc: doc/cilpp.tex
.PHONY: distclean cleandoc cleancilly clean
distclean: clean
rm -f Makefile
- rm -f cilly/App/Cilly/CilConfig.pm
+ rm -f $(CILLYDIR)/App/Cilly/CilConfig.pm
rm -f config.h
rm -f config.log
rm -f config.mk
@@ -260,16 +262,17 @@ cleandoc:
cleancilly:
-clean: cilly/Makefile
+clean: $(CILLYDIR)/Makefile
rm -rf $(OBJDIR)
+ rm -f $(BINDIR)/$(CILLY).*
rm -rf doc/html/
- $(MAKE) -C cilly clean
- rm -f cilly/App/Cilly.pm
- rm -f cilly/Makefile.old
+ $(MAKE) -C $(CILLYDIR) clean
+ rm -f $(CILLYDIR)/App/Cilly.pm
+ rm -f $(CILLYDIR)/Makefile.old
rm -f Makefile.features
-.PHONY: regtest
-regtest:
+.PHONY: test
+test:
cd test; ./testcil -r --regrtest
########################################################################
@@ -282,24 +285,19 @@ exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
libdir = @libdir@
pkglibdir = $(libdir)/cil
-libexecdir = @libexecdir@
-pkglibexecdir = $(libexecdir)/cil
bindir = @bindir@
-install: install-findlib cilly/Makefile
- $(MAKE) -C cilly install CILBINDIR="$(pkglibexecdir)"
- $(INSTALL) -d $(DESTDIR)$(pkglibexecdir)
- $(INSTALL) -m 0755 $(OBJDIR)/cilly.*.exe $(DESTDIR)$(pkglibexecdir)
+install: install-findlib $(CILLYDIR)/Makefile
+ $(MAKE) -C $(CILLYDIR) install
+ $(INSTALL) -m 0755 $(OBJDIR)/$(CILLY).* $(DESTDIR)$(bindir)
# FIXME
-uninstall: uninstall-findlib cilly/Makefile
- -rm -rf $(DESTDIR)$(pkglibexecdir)
- $(MAKE) -C cilly uninstall
+uninstall: uninstall-findlib $(CILLYDIR)/Makefile
+ -rm -f $(DESTDIR)$(bindir)/$(CILLY).*
+ $(MAKE) -C $(CILLYDIR) uninstall
.PHONY: install-findlib uninstall-findlib
-SOURCEDIRS = src src/frontc src/ext src/ext/pta ocamlutil @EXTRASRCDIRS@
-
install-findlib: $(OBJDIR)/src/cil.libfiles cillib uninstall-findlib
$(OCAMLFIND) install -patch-version @CIL_VERSION@ cil META $(CILLIB_FILES) `cat $<`
View
18 cilly/cilly → bin/cilly
@@ -39,7 +39,7 @@
use strict;
use Data::Dumper;
use FindBin;
-use lib "$FindBin::RealBin";
+use lib "$FindBin::RealBin/../lib";
# Read the configuration script
use App::Cilly::CilConfig;
@@ -61,17 +61,21 @@ use File::Basename;
use strict;
BEGIN {
@App::Cilly::CilCompiler::ISA = qw(App::Cilly);
- $App::Cilly::CilCompiler::base = "$::cilbindir/cilly";
+ $App::Cilly::CilCompiler::base =
+ "$FindBin::RealBin/$FindBin::$RealScript";
# Use the most recent version of cilly
- $App::Cilly::CilCompiler::mtime_native = int((stat("$App::Cilly::CilCompiler::base.native.exe"))[9]);
- $App::Cilly::CilCompiler::mtime_byte = int((stat("$App::Cilly::CilCompiler::base.byte.exe"))[9]);
+ $App::Cilly::CilCompiler::mtime_native =
+ int((stat("$App::Cilly::CilCompiler::base.native" . $::exeext))[9]);
+ $App::Cilly::CilCompiler::mtime_byte =
+ int((stat("$App::Cilly::CilCompiler::base.byte" . $::exeext))[9]);
$App::Cilly::CilCompiler::use_debug =
grep(/--bytecode/, @ARGV) ||
grep(/--ocamldebug/, @ARGV) ||
($App::Cilly::CilCompiler::mtime_native < $App::Cilly::CilCompiler::mtime_byte);
$App::Cilly::CilCompiler::compiler =
$App::Cilly::CilCompiler::base .
- ($App::Cilly::CilCompiler::use_debug ? ".byte" : ".native") . ".exe";
+ ($App::Cilly::CilCompiler::use_debug ? ".byte" : ".native") .
+ $::exeext;
if($App::Cilly::CilCompiler::use_debug) {
$ENV{"OCAMLRUNPARAM"} = "b" . $ENV{"OCAMLRUNPARAM"};
}
@@ -94,7 +98,7 @@ sub collectOneArgument {
}
sub usage {
- print "Usage: cilly [options] [gcc_or_mscl arguments]\n";
+ print "Usage: $FindBin::Script [options] [gcc_or_mscl arguments]\n";
}
sub helpMessage {
@@ -123,7 +127,7 @@ sub CillyCommand {
my @idirs = (".", "src", "src/frontc", "src/ext",
"ocamlutil",
"obj/");
- my @iflags = map { ('-I', "$::cilbindir/../$_") } @idirs;
+ my @iflags = map { ('-I', "$FindBin::RealBin/../$_") } @idirs;
unshift @cmd, 'ocamldebug', '-emacs', @iflags;
}
if($::docxx) {
View
2  config.mk.in
@@ -1,5 +1,3 @@
# A bunch of variables -*- Mode: makefile -*-
-export ARCHOS=@ARCHOS@
export HAS_MSVC=@HAS_MSVC@
-export CILHOME=@CILHOME@
export @DEFAULT_COMPILER@=1
View
26 configure
@@ -632,7 +632,6 @@ CIL_VERSION_MAJOR
DEFAULT_CIL_MODE
DEFAULT_COMPILER
HAS_MSVC
-CILHOME
EMUL
LIBOBJS
EGREP
@@ -3269,10 +3268,6 @@ binaryExists() {
# -------------- portable configuration ----------------
-# this specifies the root of the source tree; it's just the
-# directory where ./configure runs, except on cygwin, which
-# overrides this below
-CILHOME=`pwd`
DEFAULT_COMPILER=_GNUCC
DEFAULT_CIL_MODE=GNUCC
@@ -5992,13 +5987,6 @@ case "$target" in
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring for Cygwin on win32/x86" >&5
$as_echo "configuring for Cygwin on win32/x86" >&6; }
- # override CILHOME; even on cygwin we want forward slashes
- # sm: I folded this into what I hope will be the only
- # case-analysis of machine type
- #CILHOME=`cygpath -wa "$CILHOME" | sed -e "s/\\\\\/\\//g"`
- # Try to use the Unix paths even on cygwin. The newest versions of make
- # do not like colons in file names
- CILHOME=`cygpath -u "$CILHOME"`
CC=`which $CC`
CC=`cygpath -wa "$CC" | sed -e "s/\\\\\/\\//g"`
;;
@@ -6177,8 +6165,7 @@ chmod -w Makefile.features
# ----------------- finish up -------------------
# names of the variables that get substituted in files; for example,
-# write @CILHOME@ somewhere in a written file to get it substituted
-
+# write @CIL_VERSION@ somewhere in a written file to get it substituted
@@ -6233,12 +6220,12 @@ chmod -w Makefile.features
fi
}
{
- if test -f cilly/App/Cilly/CilConfig.pm.in; then
- ac_config_files="$ac_config_files cilly/App/Cilly/CilConfig.pm"
+ if test -f lib/App/Cilly/CilConfig.pm.in; then
+ ac_config_files="$ac_config_files lib/App/Cilly/CilConfig.pm"
else
true
- #echo "skipping [cilly/App/Cilly/CilConfig.pm] because it's not in this distribution"
+ #echo "skipping [lib/App/Cilly/CilConfig.pm] because it's not in this distribution"
fi
}
{
@@ -6965,7 +6952,7 @@ do
"META") CONFIG_FILES="$CONFIG_FILES META" ;;
"config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;;
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
- "cilly/App/Cilly/CilConfig.pm") CONFIG_FILES="$CONFIG_FILES cilly/App/Cilly/CilConfig.pm" ;;
+ "lib/App/Cilly/CilConfig.pm") CONFIG_FILES="$CONFIG_FILES lib/App/Cilly/CilConfig.pm" ;;
"doc/index.html") CONFIG_FILES="$CONFIG_FILES doc/index.html" ;;
"doc/header.html") CONFIG_FILES="$CONFIG_FILES doc/header.html" ;;
"src/machdep-ml.c") CONFIG_FILES="$CONFIG_FILES src/machdep-ml.c" ;;
@@ -7526,7 +7513,7 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
"META":F) chmod a-w META ;;
"config.mk":F) chmod a-w config.mk ;;
"test/Makefile":F) chmod a-w test/Makefile ;;
- "cilly/App/Cilly/CilConfig.pm":F) chmod a-w cilly/App/Cilly/CilConfig.pm ;;
+ "lib/App/Cilly/CilConfig.pm":F) chmod a-w lib/App/Cilly/CilConfig.pm ;;
"doc/index.html":F) chmod a-w doc/index.html ;;
"doc/header.html":F) chmod a-w doc/header.html ;;
"src/machdep-ml.c":F) chmod a-w src/machdep-ml.c ;;
@@ -7573,7 +7560,6 @@ fi
cat <<EOF
CIL configuration:
- source tree root: CILHOME $CILHOME
(optional) cl.exe found: HAS_MSVC $HAS_MSVC
gcc to use CC $CC
default compiler DEFAULT_COMPILER $DEFAULT_COMPILER
View
17 configure.ac
@@ -81,10 +81,6 @@ binaryExists() {
# -------------- portable configuration ----------------
-# this specifies the root of the source tree; it's just the
-# directory where ./configure runs, except on cygwin, which
-# overrides this below
-CILHOME=`pwd`
DEFAULT_COMPILER=_GNUCC
DEFAULT_CIL_MODE=GNUCC
@@ -299,13 +295,6 @@ case "$target" in
*86*cygwin*)
AC_MSG_RESULT(configuring for Cygwin on win32/x86)
- # override CILHOME; even on cygwin we want forward slashes
- # sm: I folded this into what I hope will be the only
- # case-analysis of machine type
- #CILHOME=`cygpath -wa "$CILHOME" | sed -e "s/\\\\\/\\//g"`
- # Try to use the Unix paths even on cygwin. The newest versions of make
- # do not like colons in file names
- CILHOME=`cygpath -u "$CILHOME"`
CC=`which $CC`
CC=`cygpath -wa "$CC" | sed -e "s/\\\\\/\\//g"`
;;
@@ -389,9 +378,8 @@ chmod -w Makefile.features
# ----------------- finish up -------------------
# names of the variables that get substituted in files; for example,
-# write @CILHOME@ somewhere in a written file to get it substituted
+# write @CIL_VERSION@ somewhere in a written file to get it substituted
AC_SUBST(EMUL)
-AC_SUBST(CILHOME)
AC_SUBST(HAS_MSVC)
AC_SUBST(DEFAULT_COMPILER)
AC_SUBST(DEFAULT_CIL_MODE)
@@ -412,7 +400,7 @@ CIL_CONFIG_FILES(Makefile)
CIL_CONFIG_FILES(META)
CIL_CONFIG_FILES(config.mk)
CIL_CONFIG_FILES(test/Makefile)
-CIL_CONFIG_FILES(cilly/App/Cilly/CilConfig.pm)
+CIL_CONFIG_FILES(lib/App/Cilly/CilConfig.pm)
CIL_CONFIG_FILES(doc/index.html)
CIL_CONFIG_FILES(doc/header.html)
CIL_CONFIG_FILES(src/machdep-ml.c)
@@ -423,7 +411,6 @@ AC_OUTPUT
cat <<EOF
CIL configuration:
- source tree root: CILHOME $CILHOME
(optional) cl.exe found: HAS_MSVC $HAS_MSVC
gcc to use CC $CC
default compiler DEFAULT_COMPILER $DEFAULT_COMPILER
View
0  cilly/.gdbinit → lib/.gdbinit
File renamed without changes
View
0  cilly/App/Cilly.pm.in → lib/App/Cilly.pm.in
File renamed without changes
View
4 cilly/App/Cilly/CilConfig.pm.in → lib/App/Cilly/CilConfig.pm.in
@@ -1,5 +1,3 @@
-
$::cc = "@CC@";
-$::cilbindir = "@CILHOME@/obj";
+$::exeext = "@EXEEXT@";
$::default_mode = "@DEFAULT_CIL_MODE@";
-
View
0  cilly/App/Cilly/KeptFile.pm → lib/App/Cilly/KeptFile.pm
File renamed without changes
View
0  cilly/App/Cilly/OutputFile.pm → lib/App/Cilly/OutputFile.pm
File renamed without changes
View
0  cilly/App/Cilly/TempFile.pm → lib/App/Cilly/TempFile.pm
File renamed without changes
View
2  cilly/MANIFEST → lib/MANIFEST
@@ -1,4 +1,4 @@
-cilly
+../bin/cilly
patcher
MANIFEST
Makefile.PL
View
29 cilly/Makefile.PL → lib/Makefile.PL
@@ -13,7 +13,7 @@ WriteMakefile(
'App/Cilly/OutputFile.pm' => '$(INST_LIBDIR)/App/Cilly/OutputFile.pm',
'App/Cilly/TempFile.pm' => '$(INST_LIBDIR)/App/Cilly/TempFile.pm',
},
- EXE_FILES => [ 'cilly' ],
+ EXE_FILES => [ '../bin/cilly' ],
PREREQ_PM => {
'Carp' => 0,
'Data::Dumper' => 0,
@@ -30,30 +30,3 @@ WriteMakefile(
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => '' },
);
-
-package MY;
-
-sub MY::top_targets {
- my $str = shift->SUPER::top_targets(@_);
-
- $str =~ s/^pure_all.+/$& fix-cilbindir/m;
-
- return $str;
-}
-
-sub MY::postamble {
- my $postamble = <<'MAKE_FRAG';
-
-.PHONY: fix-cilbindir
-
-fix-cilbindir:
-ifdef CILBINDIR
- perl -p -i -e "s,^.*cilbindir.*$$,\\$$::cilbindir = \"$(CILBINDIR)\";," $(INST_LIBDIR)/App/Cilly/CilConfig.pm
-endif
-
-MAKE_FRAG
-
- return $postamble;
-}
-
-1;
View
0  cilly/patcher → lib/patcher
File renamed without changes
View
29 test/Makefile
@@ -39,25 +39,8 @@ clean:
-find . -name '*.browser' -exec rm -rf {} \;
-ifndef CILHOME
- $(error You have not defined the CILHOME variable)
-endif
-
-CILLY := $(CILHOME)/cilly/cilly
-
-# Now do the user-specific customization
-# It is Ok if this file does not exist
--include $(CILHOME)/.cilrc
-
-# Now include the compiler specific stuff
-ifdef _MSVC
- include ../Makefile.msvc
-else
- ifdef _GNUCC
- include ../Makefile.gcc
- endif
-endif
-
+CILHOME := $(CURDIR)/..
+CILLY := $(CILHOME)/bin/cilly
CILLY += --mode=$(COMPILERNAME) --decil
@@ -272,7 +255,7 @@ combine%: $(SMALL1)/combine%_1.c
arcombine: mustbegcc
cd $(SMALL1); $(CILLY) -c array1.c array2.c
- cd $(SMALL1); $(CILHOME)/cilly/cilly \
+ cd $(SMALL1); $(CILHOME)/bin/cilly \
--mode=AR --merge --verbose crv array.a array1.o array2.o
cd $(SMALL1); $(CILLY) -o matrix.exe array.a matrix.c
cd $(SMALL1); ./matrix.exe
@@ -386,9 +369,9 @@ testdir/% :
merge-ar:
- cd small2; $(CILHOME)/cilly/cilly --merge -c merge-ar.c merge-twice-1.c
- cd small2; $(CILHOME)/cilly/cilly --merge --mode=AR cr libmerge.a merge-ar.o merge-twice-1.o
- cd small2; $(CILHOME)/cilly/cilly --merge libmerge.a -o merge-ar
+ cd small2; $(CILHOME)/bin/cilly --merge -c merge-ar.c merge-twice-1.c
+ cd small2; $(CILHOME)/bin/cilly --merge --mode=AR cr libmerge.a merge-ar.o merge-twice-1.o
+ cd small2; $(CILHOME)/bin/cilly --merge libmerge.a -o merge-ar
Please sign in to comment.
Something went wrong with that request. Please try again.