From: Jean Privat Date: Sat, 16 Nov 2013 14:49:05 +0000 (-0500) Subject: cleanup some remaining nitc X-Git-Tag: v0.6.4~51^2~20 X-Git-Url: http://nitlanguage.org cleanup some remaining nitc Signed-off-by: Jean Privat --- diff --git a/.gitignore b/.gitignore index 379e787..06197ac 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ EIFGENs *.orig bin/nit* doc/stdlib -doc/nitc doc/newmodel *.aux @@ -18,8 +17,6 @@ doc/newmodel *.toc doc/nit_version.sty -src/nitc -src/nitc_? src/parser/.nit.sablecc3 src/parser/.nit.sablecc3.dump src/parser/.parser-nofact.nit @@ -34,7 +31,7 @@ src/*.bin c_src/*.o c_src/*.cksum -c_src/nitc +c_src/nitg csrc2/ diff --git a/Makefile b/Makefile index a84f28f..66eeea6 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ NITCOPT= all: tools doc/stdlib/index.html -docs: doc/stdlib/index.html doc/nitc/index.html doc/newmodel/index.html +docs: doc/stdlib/index.html doc/newmodel/index.html #cd doc; make tools: @@ -38,14 +38,6 @@ doc/stdlib/index.html: bin/nitdoc --custom-footer-text "Nit standard library. Version $$(git describe)." \ --source "https://github.com/privat/nit/blob/$$(git rev-parse HEAD)/%f#L%l-%L" -doc/nitc/index.html: bin/nitdoc - bin/nitdoc src/nitc.nit src/nitdoc.nit src/nits.nit -d doc/nitc \ - --custom-title "Nit Compiler and Tools" \ - --custom-menu-items "
  • Nitlanguage.org
  • " \ - --custom-overview-text "

    Documentation for the Nit compiler and tools
    Version $$(git describe)
    Date: $$(git show --format="%cd" | head -1)

    " \ - --custom-footer-text "Nit compiler. Version $$(git describe)." \ - --source "https://github.com/privat/nit/blob/$$(git rev-parse HEAD)/%f#L%l-%L" - doc/newmodel/index.html: bin/nitdoc bin/nitdoc src/nit.nit src/nitmetrics.nit src/nitg.nit src/nitx.nit src/nitunit.nit src/nitlight.nit src/dbgcli.nit src/netdbg.nit -d doc/newmodel \ --private \ @@ -66,7 +58,7 @@ clean: cd tests; make clean distclean: clean - rm -rf -- bin/nitc bin/nitdoc bin/nits doc/stdlib doc/nitc/ 2> /dev/null || true + rm -rf -- bin/nitdoc bin/nits doc/stdlib 2> /dev/null || true cd c_src; make distclean cd src/parser; make distclean cd doc; make distclean diff --git a/bin/gccx b/bin/gccx deleted file mode 100755 index 7fe6717..0000000 --- a/bin/gccx +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/sh -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Copyright 2008 Jean Privat -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Separately recompile a bunch of c files then link them - -OPTS="-g" # option for compiler call -objs="" # List of .o files -libs="" -CC="cc" # Default compiler call -ext="_savo _sav" # Default flavor to reuse -out="a.out" # Default output binary filename -dir="" # Default tmp dir -nolibgc="false" # Disable boehm libgc? -CKSUM="cksum" # Tool that perfors checksum. cksum seems to be very portable -recompile="false" - -usage() -{ - e=`basename "$0"` - cat< .tmp.c < -#include -int main(void) { - void *r = GC_malloc(1); - return r == NULL; - } -END -gcc .tmp.c -lgc -o .tmp.bin 2> /dev/null -res=$? -rm .tmp.c -if [ $res = 0 ]; then - ./.tmp.bin - res=$? - rm .tmp.bin -fi -return $res -} - -cache=true -if ( ccache -V ) 2>/dev/null >/dev/null; then - cache=ccache -fi - -stop=false -verbose=false -vverbose=false -while [ $stop = false ]; do - case $1 in - -R) recompile=true; shift;; - -O) OPTS="$OPTS -O2" ext="_savo"; shift;; - -i) CC="/opt/intel/cc/10.1.015/bin/icc -O2" ext="_savi"; shift;; - -l) libs="$libs -l$2"; shift; shift;; - -ll) CC="clang --ansi --pedantic -O3"; ext="_savll"; shift;; - -I) OPTS="$OPTS -I $2"; shift; shift;; - -o) out="$2"; shift; shift;; - -d) dir="$2/"; shift; shift;; - --nolibgc) nolibgc=true; shift;; - -x) OPTS="$OPTS $2"; shift; shift;; - -vv) vverbose=true; verbose=true; shift;; - -v) verbose=true; shift;; - -h|"") usage; exit;; - *) stop=true - esac -done - -if [ $nolibgc != true ] && test_libgc; then - OPTS="$OPTS -DWITH_LIBGC" - libs="$libs -lgc" -fi - -if [ $cache = "ccache" ]; then - CC="ccache $CC" -fi - -for i in "$@"; do - j=`basename "$i" .c` - transformed=`echo "$i" | sed " - /\.nit_compile\/.*_sep\.c/s/\.nit_compile\/\(.*\)\._sep\.c/Module \1/ - /\.nit_compile\/.*_glob\.c/s/\.nit_compile\/\(.*\)\._glob\.c/Module \1/ - /\.nit_compile[1-9]\/.*_sep\.c/s/\.nit_compile[1-9]\/\(.*\)\._sep\.c/Module \1/ - /\.nit_compile[1-9]\/.*_glob\.c/s/\.nit_compile[1-9]\/\(.*\)\._glob\.c/Module \1/ - /\/nit_main\.c/s/.*\/nit_main\.c/Main/ - /\.nit_compile\/.*\._tables\.c/s/.*/Tables/ - /\.nit_compile[1-9]\/.*\._tables\.c/s/.*/Tables/ - /\/\/.*_nit\.c/s/.*\/\/\(.*\)_nit.c/Native \1/ - s/.*\/gc.c/Garbage Collector/ - s/.*\/gc_static_objects_list.c/Garbage Collector object list/ - "` - - found="false" - if [ $cache != true ]; then - o="$dir$j.o" - if [ $vverbose = true ] ; then - echo "* $CC $OPTS -c $i -o $o" >&2 - fi - $CC $OPTS -c $i -o $o || exit 1 - else - # We remove starting # to be path independent (after preprocess, there are the only # remainings) - cksum=`gcc -E $OPTS $i 2> /dev/null | grep -v "^#" | $CKSUM` - for e in $ext; do - o="$dir$j.$e.o" - cksumfile="$dir$j.$e.cksum" - if [ -f "$cksumfile" -a -f "$o" -a "x$recompile" != "xtrue" ]; then - cksumtry=`cat $cksumfile` - if [ "x$cksum" = "x$cksumtry" ]; then - if [ $vverbose = true ] ; then - echo "* $transformed up-to-date" - fi - found=true - break - fi - fi - done - if [ $found = false ]; then - if [ $verbose = true ] ; then - if [ $vverbose = true ] ; then - echo "* $CC $OPTS -c $i -o $o" >&2 - else - echo "* $transformed" - fi - fi - if $CC $OPTS -c $i -o $o; then - echo "$cksum" > "$cksumfile" - else - exit 1 - fi - fi -fi - objs="$objs $o" -done - -if [ $vverbose = true ] ; then - echo "* $CC $OPTS $objs -lm $libs -o $out" >&2 -fi -$CC $OPTS $objs -lm $libs -o "$out" diff --git a/src/mkcsrc b/src/mkcsrc deleted file mode 100755 index 7be3152..0000000 --- a/src/mkcsrc +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Copyright 2008 Jean Privat -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NAME -# mkcsrc - generate a new c_src directory from a current nitc bootstrap -# SYNOPSIS -# ./mkcsrc [number] -# DESCRIPTION -# transform a bootstrap result (generated by the nc tool) into a new -# c_src in the current directory (previous one will be errased). -# One c_src generated, you can replace the old one in the root. -# Before commiting, do not forget to: -# * verify any regression -# * add/remove files in c_src -# OPTION -# number is the bootstrap level to use. It corresponds to the nc -# level. By default, the lastest generated nitc is used. - -# prefix -p=$1 - -if [ "x$p" = "x" ]; then - p=`ls .nit_compile*/nitc._build.sh -t | head -1 | sed 's!\.nit_compile\(.*\)/nitc\._build\.sh!\1!'` - if [ "x$p" = "x" ]; then - echo "No generated nitc" - exit 1 - fi - echo "Lastest generated nitc is bootstrap level $p" -fi - -rm -r c_src 2> /dev/null -mkdir c_src - -# Copy sources -sed -n '/^ /{s!\\$!!;p}' .nit_compile${p}/nitc._build.sh | while read -r file; do - [ -f $file ] || continue - cp $file c_src - [ -r ${file%.c}.h ] && cp ${file%.c}.h c_src - # Copy included files - sed -ne 's|^#include "\(.*\)".*|\1|p' $file | while read -r subfile; do - cp "$(dirname "$file")/$subfile" c_src - done -done -sed -i -e 's|include ".*/|include "|' c_src/*[ch] # Cleanup includes - -# Prepare the build script -cp .nit_compile${p}/nitc._build.sh c_src/nitc._build.sh -chmod +x c_src/nitc._build.sh -sed -i -e "s|^ [^$].*/| |g" c_src/nitc._build.sh # Cleanup file paths -sed -i -e "s|.nit_compile${p}|.|g" c_src/nitc._build.sh # Cleanup remaining work dirs -sed -i -e "s|nitc_${p}|nitc|" c_src/nitc._build.sh # Cleanup exec name -sed -i -e 's/^CLIBDIR=.*/CLIBDIR="clib"/' c_src/nitc._build.sh # Cleanup CLIB PATH - -# Copy remaining files -cp -r ../c_src/Makefile ../c_src/README ../clib c_src - diff --git a/src/nc b/src/nc deleted file mode 100755 index a05d74e..0000000 --- a/src/nc +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Copyright 2008 Jean Privat -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -NITC="../c_src/nitc" -NITCOPTS="-v -W" -CSRC=$` (cd ../c_src; pwd) ` - -name=`basename $0` -case $name in - nc) opts="--clibdir ../c_src/clib";; - nc2) opts="-p 2"; NITC="./nitc";; - nc3) opts="-p 3"; NITC="./nitc_2";; - nc4) opts="-p 4"; NITC="./nitc_3";; - nc5) opts="-p 5"; NITC="./nitc_4";; - *) echo "unknown mode $name"; exit 1;; -esac - -./git-gen-version.sh "$name" - -echo ${NITC} ${NITCOPTS} ${opts} "$@" -${NITC} ${NITCOPTS} ${opts} "$@" diff --git a/src/ncall.sh b/src/ncall.sh deleted file mode 100755 index 8f93ee0..0000000 --- a/src/ncall.sh +++ /dev/null @@ -1 +0,0 @@ -time make -C parser && time ./nc nitc && time ./nc2 "$@" nitc && time ./nc3 "$@" nitc && ./nc4 "$@" ../examples/hello_world.nit && ./hello_world_4 diff --git a/src/ngall.sh b/src/ngall.sh index 424832f..1dff25f 100755 --- a/src/ngall.sh +++ b/src/ngall.sh @@ -1,9 +1,8 @@ #!/bin/bash rm nitg nitg.bin hello_world.bin 2>/dev/null -#test -f nitc_3 || { ./nitc_3 ; exit } set -x set -e -time ../bin/nitc -O nitg.nit -v -o nitg +time ../bin/nitg nitg.nit -v -o nitg time ./nitg nitg.nit -v "$@" -o nitg_2 time ./nitg_2 nitg.nit -v "$@" -o nitg_3 time ./nitg_3 nitg.nit -v "$@" -o nitg_4