Browse Source

Sol Part 70: If I Had a Dollar for Every Time Sol Worked When It Shouldn't Have...

...I'd probably be able to afford a pretty fancy dinner right about now.

Credit to Robert Newman (@xperia64) for finding and fixing these
problems on another platform.
master
Graham Northup 3 years ago
parent
commit
f42f57d663
Signed by: grissess GPG Key ID: 5D000E6F539376FB
  1. 18
      Makefile
  2. 2
      RECIPES
  3. 2
      programs/interp.sol
  4. 2
      solrun.c

18
Makefile

@ -1,6 +1,6 @@
_CFLAGS= -g $(BUILD_DEFINES) $(CFLAGS)
_LDFLAGS= -lfl -lm -ldl -lreadline $(LDFLAGS)
OBJ= lex.yy.o parser.tab.o dsl/seq.o dsl/list.o dsl/array.o dsl/generic.o astprint.o runtime.o gc.o object.o state.o builtins.o solrun.o ser.o
OBJ= lex.yy.o parser.tab.o dsl/seq.o dsl/list.o dsl/array.o dsl/generic.o astprint.o runtime.o gc.o object.o state.o builtins.o solrun.o ser.o sol_help.o
ifndef CC
CC:= gcc
@ -18,16 +18,18 @@ ifndef DESTDIR
DESTDIR:= /usr/local/
endif
ifdef NO_HELP
_CFLAGS+= -DNO_HELP
else
OBJ+= sol_help.o
endif
ifndef STDOUT_FILENAME
STDOUT_FILENAME:=/dev/fd/1
endif
ifneq (,$(findstring -DNO_READLINE,$(_CFLAGS)))
_LDFLAGS := $(filter-out -lreadline,$(_LDFLAGS))
endif
ifneq (,$(findstring -DNO_HELP,$(_CFLAGS)))
OBJ := $(filter-out sol_help.o,$(OBJ))
endif
include VERSION_INFO
include ARCH_INFO
@ -67,7 +69,7 @@ $(LINKED_VERS): sol$(SOL_VER)
rm $@; ln -s $? $@
sol$(SOL_VER): $(OBJ)
$(CC) $(_CFLAGS) $^ $(_LDFLAGS) -o $@
$(CC) $(_CFLAGS) $(_LDFLAGS) $^ -o $@
libsol.a: $(OBJ)
$(AR) rcs $@ $^

2
RECIPES

@ -1,5 +1,5 @@
WASM/asm.js:
make CC=emcc CFLAGS=-DNO_READLINE NO_HELP=1
make CC=emcc CFLAGS="-DNO_READLINE -DNO_HELP"
clang for profiling:
make CC=clang CFLAGS="-fprofile-instr-generate -fcoverage-mapping"

2
programs/interp.sol

@ -27,6 +27,8 @@ while __interp.running do
__interp.line = readline.readline(__interp.prompt)
if #__interp.line then readline.add_history(__interp.line) end
else
io.stdout:write(__interp.prompt)
io.stdout:flush()
__interp.line = io.stdin:read(io.LINE):sub(0, -1)
end
7

2
solrun.c

@ -99,7 +99,7 @@ int main(int argc, char **argv) {
} else {
if(html) {
sol_write_html(prgstream);
return;
return 0;
}
program = sol_compile_file(prgstream);
}

Loading…
Cancel
Save