Permalink
Browse files

Deprecate staticlib, compile rock from .use

  • Loading branch information...
1 parent 76096b1 commit 8291ed03add536d0671b4f8c15c0c771e28856bd @nddrylliog nddrylliog committed Feb 20, 2013
Showing with 9 additions and 14 deletions.
  1. +3 −3 Makefile
  2. +2 −0 rock.use
  3. +2 −9 source/rock/frontend/CommandLine.ooc
  4. +2 −2 source/rock/middle/Module.ooc
View
@@ -2,7 +2,7 @@
PARSER_GEN=greg
NQ_PATH=source/rock/frontend/NagaQueen.c
OOC_WARN_FLAGS?=+-w
-OOC_OWN_FLAGS=--sourcepath=source -v +-O2 -g ${OOC_WARN_FLAGS}
+OOC_OWN_FLAGS=-v +-O2 -g ${OOC_WARN_FLAGS}
# used to be CC?=gcc, but that breaks on mingw where CC is set to 'cc' apparently
CC=gcc
@@ -31,7 +31,7 @@ grammar:
prepare_bootstrap:
@echo "Preparing boostrap (in build/ directory)"
rm -rf build/
- ${OOC} -driver=make --sourcepath=source --outpath=c-source rock/rock -o=../bin/c_rock -v -g +-w
+ ${OOC} -driver=make rock.use --outpath=c-source -o=../bin/c_rock -v -g +-w
@echo "Done!"
boehmgc:
@@ -76,7 +76,7 @@ man:
# Compile rock with itself
self:
mkdir -p bin/
- ${OOC_CMD} rock/rock -o=bin/rock
+ ${OOC_CMD} rock.use -o=bin/rock
# Save your rock binary under bin/safe_rock
backup:
View
@@ -4,5 +4,7 @@ Origin: git://github.com/nddrylliog/rock.git
Description: ooc compiler written in ooc
SourcePath: source
+Main: rock/rock.ooc
+
# greg-generated grammar
Additionals: ./source/rock/frontend/NagaQueen.c
@@ -48,15 +48,8 @@ CommandLine: class {
}
if (option startsWith?("sourcepath=")) {
-
- if(!longOption) warnUseLong("sourcepath")
- sourcePathOption := arg substring(arg indexOf('=') + 1)
- tokens := sourcePathOption split(File pathDelimiter, false)
- for (token in tokens) {
- // rock allows '/' instead of '\' on Win32
- params sourcePath add(token replaceAll('/', File separator))
- }
-
+ "[ERROR] Specifying sourcepath by hand is deprecated.\nInstead, create a .use file and specify the sourcepath from there." println()
+ hardDeprecation("staticlib", params)
} else if (option startsWith?("outpath=")) {
if(!longOption) warnUseLong("outpath")
@@ -81,8 +81,8 @@ Module: class extends Node {
getUseDef: func -> UseDef {
uze := params sourcePathTable get(pathElement)
if (!uze) {
- message := "Module that has no corresponding use! pathElement = %s" format(pathElement)
- params errorHandler onError(InternalError new(token, message))
+ message := "Module %s has no corresponding use! pathElement = %s" format(fullName, pathElement)
+ Exception new(message) throw()
}
uze
}

0 comments on commit 8291ed0

Please sign in to comment.