summaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Icon refresh.Kaz Kylheku2017-03-151-1/+1
| | | | | | | | | | | | | | | | | I lost the original vector graphic inputs that went into the icon. This is a superior re-make. Better artwork, better post-processing quality, more sizes. * Makefile (win/%.res): Add win/*.ico as a pattern prerequisite, so that the resource file is regenerated when the icon changes. * win/txr.ico: Updated icon, now in sizes 16, 32, 48, 64, 96, 128, 192 and 256. * win/txr.xcf: Updated GIMP file. * win/txr.svg: New file.
* Drop the annoying need for - for standard input.Kaz Kylheku2017-03-081-1/+1
| | | | | | | | | | | | | * match.c (open_data_source): If there is nothing in the files array and data is t (indicating a request to open a data source), then use standard input. Subject to the compatibility option. * Makefile (txr-manpage.html): Drop use of the txr - argument in rule recipe. * txr.1: Document that - isn't necessary. Added to compatibility notes.
* Bump copyright year to 2017.Kaz Kylheku2017-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * LICENSE, LICENSE-CYG, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c, stream.h, struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, share/txr/stdlib/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl, share/txr/stdlib/conv.tl, share/txr/stdlib/except.tl, share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/package.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/socket.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/tagbody.tl, share/txr/stdlib/termios.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl: Add 2017 to all copyright headers and strings.
* bugfix: make clean not removing txr-win.exeKaz Kylheku2016-12-221-0/+1
| | | | | | | * Makefile (clean): Remove txr-win an txr-win-dbg executables if they exist. Because of this issue, stale txr-win executables got packaged in some Windows installer releases.
* configure: move Darwin check into Makefile.Kaz Kylheku2016-11-201-0/+6
| | | | | | * Makefile (conftest.darwin): New phony target. * configure: Always do Darwin check via make conftest.darwin.
* Conform to standard Makefile conventions.Kaz Kylheku2016-11-201-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | TXR's build should use the values of standard make variables: use the existing $(CC), $(CFLAGS), $(YACC), $(LDFLAGS) and such. * Makefile (TXR_CFLAGS): New variable. Initialized with the value of $(CFLAGS) and then customized. Used everywhere in place of CFLAGS. (CFLAGS): Now used only as the initial value of TXR_CFLAGS; no longer clobbered with the := assignment. Thus if a distribution of free software builds everything with certain CFLAGS, we incorporate those CFLAGS that it wants us to use. (TXR_LDFLAGS): New variable, initialized from $(LDFLAGS). Used in place of LDFLAGS. (LDFLAGS): Use only, do not modify. (NM): Replaced with TXR_NM. (YACC): Replaced with TXR_YACC. * configure (ccname): Default to $(CC) rather than gcc. (lex): Default name portion $(LEX) rather than flex; keep the optional prefixes. (gen_config_make): Generate TXR_CC, TXR_LEX, TXR_YACC and TXR_NM variables, rather than clobbering the standard ones CC, LEX and YACC. Also, in the rule that finds yacc, we now try '$(YACC)' first.
* New arithmetic tests.Kaz Kylheku2016-11-151-0/+1
| | | | | | | | | * Makefile (TXR_DBG_OPTS): Suppress for new directory tests/016. * tests/016/arith.tl: New file. * tests/016/arith.expected: New file.
* Synchronize license comments with LICENSE.Kaz Kylheku2016-10-011-16/+17
| | | | | | | | | | | | | | | | | | | | * Makefile, args.c, args.h, arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl, share/txr/stdlib/conv.tl, share/txr/stdlib/except.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/socket.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/termios.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, socket.c, socket.h, stream.c, stream.h, struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Revert to verbatim 2-Clause BSD.
* Adding tests for split-str.Kaz Kylheku2016-09-171-0/+1
| | | | | | | | * Makefile (TXR_DBG_OPTS): Disable for tst/tests/015. * tests/common.tl (mtest): New macro. * tests/015/split.tl: New file.
* Fix multi-arch build issue for txr.res.Kaz Kylheku2016-08-061-1/+1
| | | | | | | | | | | | | When building in a separate directory, we can't just symlink the win directory, because the txr.res output file is architecture dependent and cannot be shared between 32 and 64 bit builds. * Makefile (%.res): Convert .rc -> .res rule to use the top_srcdir pattern, so the prerequisite will be found without the aid of the win/ directory symlink. * configure: Do not create win -> $source_dir/win symlink in the build directory.
* Fix issue in make dependency generation.Kaz Kylheku2016-08-061-1/+2
| | | | | | | * Makefile (DEPGEN): We must fold the backslash continuations before trying to delete the first dependency element, because if the target name is long, that first element may be on the following line, and we delete the backslash.
* The cmdwrap sh.exe hack is no longer needed.Kaz Kylheku2016-06-301-5/+0
| | | | | | | | | | | The Cygnal library uses cmd.exe for popen: problem solved. * Makefile (sh.exe): Target removed. * cmdwrap.c: File removed. * inst.nsi: Do not install sh.exe.
* Fix command spawning on Cygwin-based standalone image.Kaz Kylheku2016-06-291-0/+5
| | | | | | | | | | | | | | | | In the standalone image, we need a /bin/sh interpreter for the sh and open-command functions to work. The / path resolves to the installation directory, thanks to some sysrooting logic in the Cygwin DLL. Thus, we just need a sh.exe program in the bin directory, side by side with txr.exe. This sh.exe program can translate the "sh -c command" invocation to "cmd.exe /c command". * Makefile (sh.exe): New target, built from cmdwrap.c. * cmdwrap.c: New file. * inst.nsi: Install sh.exe.
* Eliminating the ! $ and - file-opening hacks.Kaz Kylheku2016-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Going forward, the "!command" and "$dir" are no longer recognized, except with the backward-compatibility -C option. The "-" string denoting standard input is only recognized from the command line, not in the @(next) directive; and "-" cannot be used in @(output) to denote standard output. The main problem is that these are hacks which intrude into the namespace. (What if a file is named "-", or begins with "!" or "$"?) Secondly, they are possible security holes. These prefixes are recognized even in computed strings, like "@(next var)" where var contains "!command". * Makefile (tst/tests/002/%): Run tests in this directory with the -C 142 option in TXR_OPTS, because they use the ! mechanism. * match.c (complex_open): New argument, from_cmdline, indicating whether the file name came from the command line or is internal. Function now only treats "-" as denoting standard input, if that came from the command line. The "!" and "$" prefixes are only recognized in compatibility with 142 or earlier. (v_next): Suppress old strategy of handling string sources by pushing them to the file list to let match_files open them. This is now done only under 142 compatibility. Instead, open directly, produce the list, and recurse into match_files with ready data. This is not only simpler, but also prevents "-" from being recognized in @(next), because complex_open is invoked directly, and the from_cmdline argument is specified as nil. (v_output): Don't rely on "-" denoting standard output; rather use the stream directly, which can be passed to complex_open. Pass nil to the new from_cmdline parameter of complex_open, so "-" isn't recognized. (open_data_source): Pass t for the from_cmdline parameter of complex_open, to have "-" recognized as denoting standard input. * txr.1: Removed documentation referring to !, and use of - in the @(next) and @(output) directives. Added notes to COMPATIBILITY section.
* Adding termios support.Kaz Kylheku2016-05-181-0/+1
| | | | | | | | | | | | | | | | * Makefile (termios.o): New object file. * lib.c (init): Call termios_init. * lisplib.c (termios_set_entries, termios_instantiate): New functions. (lisplib_init): Register new functions in autoload table. * share/txr/stdlib/termios.tl: New file. * termios.c, termios.h: New files. * txr.1: Documented termios.
* Some recent versions of flex contain // comment.Kaz Kylheku2016-05-061-1/+6
| | | | | | Makefile (lex.yy.c): Crudely and shamelessly filter lex.yy.c through sed to remove // commments, even if // occurs in a string literal or a /*...*/ comment which ends on that line.
* Adding manual page checker.Kaz Kylheku2016-04-261-1/+2
| | | | | | | * Makefile (txr-manpage.pdf): Invoke checkman.txr on the man page source. * checkman.txr: New file.
* Check man page for errors when generating PDF.Kaz Kylheku2016-04-261-1/+1
| | | | | | * Makefile (txr-manpage.pdf): Add -ww option to pdfroff to report all errors, such as uses of undefined macros.
* Adding ftw function.Kaz Kylheku2016-04-151-0/+1
| | | | | | | | | | | | | | * Makefile (ftw.o): Add to OBJS-y conditionally. * configure (have_ftw): New variable. New configure test for nftw. (gen_config_make): Set up have_ftw make variable. * ftw.c, ftw.h: New files. * lib.c (init): Call ftw_init, if compiled in. * txr.1: Documented.
* Basic regression test case for sockets.Kaz Kylheku2016-03-071-0/+1
| | | | | | | | | | * Makefile: suppress --gc-debug for tst/tests/014 directory. * tests/014/socket-basic.tl: New file. * tests/014/socket-basic.expected: New file. * tests/sock-common.tl: New file.
* Adding socket support: unix, ipv4, ipv6.Kaz Kylheku2016-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * socket.c, socket.h: New files. * Makefile: include new socket.o among objects if have_objects variable is defined to 'y'. * configure (have_sockets): New variable. New configure test for socket-related functionality. (HAVE_SOCKETS, HAVE_GETADDRINFO): New configuration preprocessor symbols. Also, reordering the shell probing so that /usr/xpg4/bin/sh is the last fallback. On Solaris, it chokes on some code that is needed for Solaris. * lisplib.c (sock_set_entries, sock_instantiate): New static functions. (lisplib_init): Register new functions as autoload hooks. * share/txr/stdlib/socket.tl: New file. * stream.c (socket_error_s): New symbol variable. (struct stdio_handle): New members, family and type, helping stdio streams represent sockets too. (stdio_stream_mark): Mark new members of struct stdio_handle. (make_stdio_stream_common): Initialize new members. (make_sock_stream, stream_fd, sock_family, sock_type, open_socket, open_sockfd): New functions. (stream_init): Initialize socket_error_s variable. Register sock-family, sock-type and open-socket intrinsic functions. Register socket-error subtype. * stream.h (socket_error_s, make_sock_stream, stream_fd, sock_family, sock_type, open_socket, open_sockfd): Declared.
* Support extra linker flags.Kaz Kylheku2016-01-131-1/+1
| | | | | * Makefile (EXTRA_LDFLAGS): New variable, interpolated into LDFLAGS.
* Copyright year bump.Kaz Kylheku2015-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, stream.c, stream.h, struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright. * linenoise/LICENSE, linenoise/linenoise.c, linenoise/linenoise.h: Bump one principal author's copyright from 2014 to 2015. The code is based on a snapshot of 2015 upstream work.
* Increase stack size on Windows.Kaz Kylheku2015-11-291-1/+1
| | | | | | | | | * Makefile: include CONF_LDFLAGS in LDFLAGS. * configure (conf_ldflags): New variable. (gen_config_make): Generate CONF_LDFLAGS make variable. New test which sets up conf_ldflags for a 16Mb stack size if we are on Cygwin or MinGW.
* Stop using C library setjmp/longjmp.Kaz Kylheku2015-10-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TXR is moving to custom assembly-language routines. This is mainly motivated by a very dubious thing done in the GNU C Library setjmp and longjmp in the name of security. Evidently, glibc's setjmp "mangles" certain pointer values which are stored into the jmp_buf buffer. It's been that way since 2005, evidently. This means that, firstly, all along, the use of setjmp in gc.c to get registers into a buffer so they can be scanned has not actually worked properly. More importantly, this pointer mangling in setjmp and longjmp is very hostile to a stack copying implementation of delimited continuations. The reason is that continuations contain jmp_buf buffers, which get relocated in the process of capturing and reviving a continuation. Any pointers in a jmp_buf which point into the captured stack segment have to be fixed up to point into the relocated location. Mangled pointers make this difficult, requiring hacks which are specific to glibc and the machine architecture. We might as well implement a clean, well-behaved setjmp and longjmp. * Makefile (jmp.o): New object file. (dbg/%.o, opt/%.o): New rules for .S prerequisites. * args.c, arith.c, cadr.c, combi.c, cadr.c, combi.c, debug.c, eval.c, filter.c, glob.c, hash.c, lib.c, match.c, parser.c, rand.c, regex.c, signal.c, stream.c, struct.c, sysif.c, syslog.c, txr.c, unwind.c, utf8.c: Removed <setjmp.h> include. * gc.c: Switch to struct jmp and jmp_save, instead of jmp_buf and setjmp. * jmp.S: New source file. * signal.h (struct jmp): New struct type. (jmp_save, jmp_restore): New function declarations denoting assembly language routines in jmp.S. (extended_jmp_buf): Uses struct jmp instead of setjmp. (extended_setjmp): Use jmp_save instead of setjmp. (extended_longjmp): Use jmp_restore instead of longjmp.
* Reveal struct winsize on Solaris.Kaz Kylheku2015-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | On Solaris 10, we need __EXTENSIONS__ defined to make struct winsize appear out of <termios.h>. This commit adds detection for what preprocessor symbol needs to be defined for struct winsize to appear, if it appears at all. Then this symbol is defined on the compiler command line when compiling linenoise. * Makefile (CFLAGS): Add -D$(termios_define) for linenoise.o target. * configure (have_winsize, termios_define): New variables. Detect whether struct winsize is available, and what preprocessor symbol, if any, is required to reveal the feature. * linenoise/linenoise.c: Need to include TXR's "config.h" for HAVE_WINSIZE. (get_columns): Reorganized so that use of struct winsize is guarded by HAVE_WINSIZE and fallback code is used if either obtaining the size fails or the feature is completely unavailable.
* Basic REPL based on linenoise.Kaz Kylheku2015-09-051-1/+1
| | | | | | | | | | | | | | | | * Makefile (OBJS): Only include linenoise.o if have_termios is y. * configure: Adding test for termios. (have_termios): New configure and config.make variable. (gen_config_make): Generate have_termios variable. * parser.c (repl): New function. * parser.h (repl): Declared. * txr.c (help): Summarize new -i option. (txr_main): Implement -i repl.
* Compile and link linkenoise into txr; fix errors.Kaz Kylheku2015-09-041-0/+1
| | | | | | | | | | | * Makefile (OBJS): Add linenoise/linenoise.o. * linenoise/linenoise.c (linenoiseEditInsert, linenoiseEditMoveLeft, linenoiseEditMoveRight, linenoiseEditMoveEnd, linenoiseEditHistoryNext, linenoiseEditDelete, linenoiseEditBackspace, linenoiseEditDeletePrevWord): These de facto internal functions are switched from external to static.
* No need to point the compiler into the mpi directory.Kaz Kylheku2015-09-041-1/+0
| | | | | | * Makefile (CFLAGS): Remove -iquote $(top_srcdir)mpi * lib.h: include "mpi/mpi.h" instead of "mpi.h".
* Introducing structs.Kaz Kylheku2015-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * args.c (args_cat_zap): New function. * args.h: (args_cat_zap): Declared. * eval.c (struct_lit_s): New symbol variable. (eval_init): Initialize struct_lit_s. * eval.h (struct_lit_s): Declared. * gc.c (finalize): If a symbol has a struct slot hash attached to it, we must free it when the symbol is reclaimed. * lib.c (make_sym): Initialize symbol's slot_cache pointer to null. (copy): Copy structure objects. (init): Call struct_init to initialize struct module. * lib.h (SLOT_CACHE_SIZE): New preprocessor symbol (slot_cache_line_t, slot_cache_t): New typedefs. (struct sym): New member, slot_cache. * lisplib.c (struct_set_entries, struct_instantiate): New static functions. (liplib_init): Register new functions in dl_table. parser.y (HASH_S): New terminal symbol. (struct): New grammar rule. (n_expr): Derive struct. (yybadtoken): Map HASH_S to #S string. parser.l (grammar): Recognize #S and return HASH_S token. share/txr/stdlib/place.tl (slot): New defplace. share/txr/stdlib/struct.tl: New file. struct.c: New file. struct.h: New file. * Makefile (OBJS): Adding struct.o.
* Add maze generation to test suite.Kaz Kylheku2015-08-241-0/+2
| | | | | | | | | * Makefile (tst/tests/013/maze.out): Add TXR_ARGS. Disable gc-debugging for tests in new directory. * tests/013/maze.expected: New file. * tests/013/maze.tl: New file.
* Start of new way of handling variable arguments.Kaz Kylheku2015-08-171-1/+1
| | | | | | | | * Makefile (OBJS): Add args.o object. * args.c: New file. * args.h: New file.
* Minor dependency fix in Makefile.Kaz Kylheku2015-08-151-3/+6
| | | | | | * Makefile (y.tab.c, y.tab.h, lex.yy.c): Express dependency of these on the configuration material via the DEP macro rather than directly. That way ABBREV can reflect over the dependency.
* Whitespace.Kaz Kylheku2015-08-151-1/+1
|
* Regenerate parser and scanner if config changes.Kaz Kylheku2015-08-151-3/+3
| | | | | | * Makefile (lex.yy.c, y.tab.c, y.tab.h): Add missing dependencies on config.h and config.make so that these files are regenerated if we touch the configuration (for instance change the YACC variable).
* Remove unwanted yyparse declaration from y.tab.h.Kaz Kylheku2015-08-141-1/+8
| | | | | | | | | | * Makefile (y.tab.c): Putting in an ugly workaround for an obnoxious new behavior introduced in Bison 3.x, which breaks our build on platforms that have a newer Bison. After generating y.tab.h, we remove the unwanted declaration with sed. * parser.y (yyparse): Declare, since y.tab.h doesn't any more, and the newer Bison's parse skeletons expect it.
* Crafting a better parser-priming hack.Kaz Kylheku2015-08-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method of inserting a character sequence which generates a SECRET_TOKEN_E token is being replaced with a purely token based method. Because we don't manipulate the input stream, the lexer is not involved. We don't have to flush its state and deal with the carry-over of the yy_hold_char. This comes about because recent changes expose a weakness in the old scheme. Now that a top-level expression can have the form expr.expr, it means that the Yacc parser reads one token ahead, to see whether there is a dot or something else. This lookahead token is discarded. We must re-create it when we call yyparse again. This re-creation is done by creating a custom yylex function, which can maintain pushback tokens. We can prime this array of pushback tokens to generate the SECRET_TOKEN_E, as well as to re-inject the lookahead symbol that was thrown away by the previous yyparse. To know which lookahead symbol to re-inject is simple: the scanner just keeps a copy of the most recent token that it returns to the parser. When the parser returns, that token must be the lookahead one. The tokens we keep now in the parser structure are subject to garbage collection, and so we must mark them. Since the YYSTYPE union has no type field, a new API is opened up into the garbage collector to help implement a conservative GC technique. * gc.c (gc_is_heap_obj): New function. * gc.h (gc_is_heap_obj): Declared. * match.c: Include y.tab.h. This is now needed by any module that needs to instantiate a parser_t structure, because members of type YYSTYPE occur in the structure. (parser.h can still be included without y.tab.h, but only an incomplete declaration for the parser strucure is then given, and a few functions are not declared.) * parser.c (yy_tok_mark): New static function. (parser_mark): Mark the recent token and the pushback tokens. (parser_common_init): Initialize the recent token, the pushback tokens, and the pushback stack index. (pushback_token): New static function. (prime_parser): hold_byte argument removed. Body considerably simplified. The catenated stream trick is no longer required. All we do here is set up two pushback tokens and prime the scanner, if necessary, so it is in the right start state for Lisp. * parser.l (YY_DECL): Take over definition of scanning function, renaming to yylex_impl, so we can implement yylex. (grammar): Rule which produces SECRET_ESCAPE_E token removed. (reset_scanner): Function removed. (yylex): New function. * parser.h (struct parser): Now only forward-declared unless y.tab.h has been included. New members, recent_tok, tok_pushback and tok_idx. (yyset_hold_char): Declared. (reset_scanner): Declaration removed. (yylex): Declared (if y.tab.h included). (prime_parser): Declaration updated. (prime_scanner): Declared. * Makefile: express new dependency on existence of y.tab.h of txr.o, match.o and parser.o.
* * Makefile (SRCS): When top_srcdir is blank, elide the entireKaz Kylheku2015-08-071-1/+2
| | | | | --work-tree argument to git. On Cygwin, git throws a strange error message when --work-tree is given a blank argument.
* Define TXR_DBG macro when compiling debug build.Kaz Kylheku2015-08-031-2/+2
| | | | | | | | | * Makefile (dbg/%.o): Pass $(DBG_ONLY_FLAGS) to COMPILE_C_WITH_DEPS recipe macro. * configure (debug_only_flags): New macro. (gen_config_make): Generate DBG_ONLY_FLAGS. Add debug-only-flags to usage help text.
* Custom linker flags support.Christopher Meng2015-08-031-2/+3
| | | | | | | | | | | | * Makefile (PLATFORM_FLAGS): Rename to PLATFORM_CFLAGS. (LDFLAGS): New variable. Includes -lm and PLATFORM_CFLAGS. (LINK_PROG): Use $(LDFLAGS) instead of -lm. * configure (platform_flags): Renamed to platform_cflags. (platform_ldflags): New variable. (gen_config_make): Rename PLATFORM_CFLAGS and generate PLATFORM_LDFLAGS. Usage help text updated.
* * Makefile (tst/tets/012/%): Disable --gc-debug forKaz Kylheku2015-07-251-0/+1
| | | | tests in this directory.
* Set up blank top_srcdir if building in source directory.Kaz Kylheku2015-07-231-15/+17
| | | | | | | | | | | | | | | | | | This means short, relative names are used for C source files when compiling in the source directory. * Makefile (CFLAGS): Exclude -iquote $(top_srcdir) arguments if top_srcdir is blank. Remove slash after $(top_srcdir), since the variable includes it now, if its value is not blank. (SRCS, ABBREV, opt/%-win.o, lex.yy.c, y.tab.c, install): Remove slash after $(top_srcdir). (dbg/%.o, opt/%.o): Only include rules for depending on $(top_srcdir)%.c prerequisite if top_srcdir is not blank. In the blank case, the rules are redundant. * configure: if configuring in the root of the source tree, establish top_srcdir as blank, otherwise establish is as an absolute path with a trailing slash.
* Split off test macros from ifa.tl into common file.Kaz Kylheku2015-07-231-4/+3
| | | | | | | | | | | * Makefile (TESTS_OUT): Don't use find to hunt down tests; but rather wildcard. This way common.tl is not mistakenly identified as an independent test file. * tests/012/ifa.tl: Removed test code, placed in new file which is loaded. * tests/common.tl: New file.
* Fixes for building in separate dir.Kaz Kylheku2015-07-231-11/+13
| | | | | | | | | | | | | * Makefile (CFLAGS): Search for mpi header in $(top_srcdir). (ABBREV): Remove top_srcdir prefix from source names. (dbg/%.o, opt/%.o): Extra set of pattern rules for searching for prerequisites in $(top_srcdir) where primary C sources are found and in the local dir where some generated C is found. This way we don't rely on VPATH. (opt/%.res): Bogus target removed. (VPATH): Removed in favor of explicitly referencing $(top_srcdir). Was causing problems for tests. (lex.yy.c, y.tab.c): Prerequisites referenced in $(top_srcdir).
* Implementing caar, cadr, cdar and friends.Kaz Kylheku2015-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | * lib.c (init): Call cadr_init. * lisplib.c (dl_table, set_dlt_entries, dlt_register): Externalize. * lisplib.h (dl_table, set_dlt_entries, dlt_register): Declared. * Makefile (OBJS): Add cadr.o. * cadr.c: New file. * cadr.h: New file. * gencadr.txr: New file. * share/txr/stdlib/cadr.tl: New file. * txr.1: Document cadr accessors.
* Remove places.h generation hack.Kaz Kylheku2015-06-201-17/+1
| | | | | | | | | | | | | | * Makefile (GEN_HDRS, LISP_TO_C_STRING): Variables removed. (%.h: %.tl): Rule removed. The place.h header is no longer generated from place.tl. * lisplib.c (place_instantiate): Load place.tl from stdlib directory, rather than obtaining it from a string literal in generated header place.h. * place.tl: Moved to share/txr/stdlib directory. * genvim.txr: Refer to place.tl in stdlib.
* * Makefile: whitespace fixes.Kaz Kylheku2015-06-191-3/+3
|
* Test ifa macro.Kaz Kylheku2015-06-191-2/+10
| | | | | | | | | * Makefile (TEST_OUT): Include .tl files. (tst/%.out): New rule variant, from .tl prerequisite. * tests/012/ifa.expected: New file. * tests/012/ifa.tl: New file.
* Adding anaphoric ifa macro.Kaz Kylheku2015-06-171-3/+9
| | | | | | | | | | | | | | | | | | | | * Makefile (install): Install .tl files present in stdlib directory. (INSTALL): Handle argument 2 being a list. * eval.c (load): New function. * eval.h (load): Declared. * lisplib.c (ifa_set_entries, ifa_instantiate): New functions to lazily load ifa.tl. (lisplib_init): Register new functions. * txr.c (stdlib_path): New variable. (sysroot_init): Store the stdlib path in stdlib_path. * txr.h (stdlib_path): Declared. * share/txr/stdlib/ifa.tl: New file.
* Represent place.tl more compactly in image.Kaz Kylheku2015-05-191-2/+2
| | | | | | | | | The contents of place.tl are now stored as a UTF-8 ordinary literal instead of a wide char literal. * Makefile (LISP_TO_C_STRING): Generate plain literal. * lisplib.c: Convert plain literal to string.