Commit Graph
6 Commits
Author SHA1 Message Date
Paul Woolcock 2fd0d2faf5 fix: add -g flag to DEBUG_CFLAGS for debug symbol generation in Makefile
This change appends the -g flag to the DEBUG_CFLAGS variable, enabling debug symbols when compiling with DEBUG mode. This improves debugging experience under GDB and LLDB by providing source-level information such as variable names, line numbers, and function signatures.
2015-01-12 15:01:34 +00:00
Paul Woolcock be1ceaa6d0 chore: add Paul Woolcock to AUTHORS list with email address
Append Paul Woolcock's name and email (paul@woolcock.us) to the end of the AUTHORS file, following the existing entry for Robert Nystrom.
2015-01-05 16:02:52 +00:00
Paul Woolcock 820faaa6b5 feat: separate library and binary builds with static archive targets
Add `libwren.a` and `libwrend.a` static library targets that exclude `main.o`, compile all objects with `-fPIC`, and link the interpreter binaries against the archives instead of individual objects.
2015-01-02 19:59:52 +00:00
Paul Woolcock bdede9cd32 feat: implement IO.read method with stdin input buffer and prompt support
Add static `IO.read(prompt)` method to the IO class that writes the prompt to stdout
and reads a line from stdin into a 1024-byte buffer. The C implementation uses
`fgets` for input and returns the string via `wrenReturnString`. The Wren wrapper
calls `IO.write` for the prompt before delegating to the native `IO.read` method.
2015-01-02 16:07:43 +00:00
Paul Woolcock 361e911897 fix: move -lm linker flag after object files in Makefile
Reorder the `-lm` flag from before the output file to after the object file list
in both debug (`wrend`) and release (`wren`) linker commands. This fixes linking
errors with `gcc` which requires libraries to follow the objects that reference
them, while `clang` is unaffected by the flag position.
2015-01-02 13:10:46 +00:00
Paul Woolcock 7c25b4e187 fix: check getline return value to suppress gcc warning and fix build failure
The getline function's return value was previously ignored, causing gcc to emit a
warning that was treated as an error during build. This commit captures the return
value in a ssize_t variable and adds a check for -1 (indicating read failure) to
the existing feof(stdin) condition, ensuring both EOF and error conditions are
properly handled.
2015-01-02 13:10:03 +00:00