clib: move files to the clib directory
authorJean Privat <jean@pryen.org>
Mon, 17 Aug 2009 16:09:57 +0000 (12:09 -0400)
committerJean Privat <jean@pryen.org>
Mon, 17 Aug 2009 19:06:13 +0000 (15:06 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

README
clib/README [new file with mode: 0644]
clib/nit_common.h [moved from lib/nit_common.h with 100% similarity]
clib/nit_main.c [moved from lib/nit_main.c with 100% similarity]
src/mkcsrc
src/nitc.nit

diff --git a/README b/README
index 0147369..3c91315 100644 (file)
--- a/README
+++ b/README
@@ -25,6 +25,7 @@ Important files and directory:
        bin/nitdoc      The Nit autodoc
        BUGS            Known big usability bugs
        c_src/          C code of nitc (needed to bootstrap)
+       clib/           C code needed by nitc to compile programs
        Changelog       List of change between versions
        doc/            Documentation
        examples/       Program examples written in Nit
diff --git a/clib/README b/clib/README
new file mode 100644 (file)
index 0000000..958f084
--- /dev/null
@@ -0,0 +1 @@
+This directory contains C code needed by nitc to compile programs.
similarity index 100%
rename from lib/nit_common.h
rename to clib/nit_common.h
similarity index 100%
rename from lib/nit_main.c
rename to clib/nit_main.c
index 269eee8..f1b7a6d 100755 (executable)
@@ -49,7 +49,7 @@ sed -n '/^ *.nit_compile/{s!\\$!!;p}' .nit_compile3/nitc._build.sh | while read
        cp $file c_src
        [ -r ${file%.c}.h ] && cp ${file%.c}.h c_src
 done
-sed "s|.nit_compile${p}|.|g;s|/\[a-z\]+/../|/|g;s|nitc_${p}|nitc|" .nit_compile${p}/nitc._build.sh > c_src/nitc._build.sh 
+sed -e "s|.nit_compile${p}|.|g;s|/\[a-z\]+/../|/|g;s|nitc_${p}|nitc|" -e 's/^CLIBDIR=.*/CLIBDIR="clib"/' .nit_compile${p}/nitc._build.sh > c_src/nitc._build.sh
 chmod +x c_src/nitc._build.sh
-cp ../c_src/Makefile ../c_src/README c_src
+cp -r ../c_src/Makefile ../c_src/README ../clib c_src
 
index faf8d03..debc63e 100644 (file)
@@ -66,10 +66,10 @@ special AbstractCompiler
                if clibdir == null then
                        var dir = once ("NIT_DIR".to_symbol).environ
                        if dir.is_empty then 
-                               dir = "{sys.program_name.dirname}/../lib"
+                               dir = "{sys.program_name.dirname}/../clib"
                                if dir.file_exists then clibdir = dir
                        else
-                               dir = "{dir}/lib"
+                               dir = "{dir}/clib"
                                if dir.file_exists then clibdir = dir
                        end
                        if clibdir == null then