diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-06-20 08:07:18 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-06-20 08:07:18 -0700 |
commit | d1e775648cba50537070b3bb598ed7dc7e5cbb64 (patch) | |
tree | 312260a6fb5bfcc315253389d0ae1544b55d3299 | |
parent | 55a691ccd9972e8c7dc077107e6cd065b0c37259 (diff) | |
download | txr-d1e775648cba50537070b3bb598ed7dc7e5cbb64.tar.gz txr-d1e775648cba50537070b3bb598ed7dc7e5cbb64.tar.bz2 txr-d1e775648cba50537070b3bb598ed7dc7e5cbb64.zip |
Remove places.h generation hack.
* 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.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | genvim.txr | 6 | ||||
-rw-r--r-- | lisplib.c | 5 | ||||
-rw-r--r-- | share/txr/stdlib/place.tl (renamed from place.tl) | 0 |
5 files changed, 22 insertions, 23 deletions
@@ -1,5 +1,21 @@ 2015-06-20 Kaz Kylheku <kaz@kylheku.com> + Remove places.h generation hack. + + * 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. + +2015-06-20 Kaz Kylheku <kaz@kylheku.com> + * eval.c (eval_init): Register have function, synonym of true. * txr.1: Document have. @@ -52,7 +52,6 @@ OBJS-$(have_syslog) += syslog.o OBJS-$(have_glob) += glob.o OBJS-$(have_posix_sigs) += signal.o EXTRA_OBJS-$(add_win_res) += win/txr.res -GEN_HDRS := place.h ifneq ($(have_git),) SRCS := $(addprefix $(top_srcdir)/,\ @@ -108,13 +107,6 @@ $(call ABBREV,LINK) $(V)$(CC) $(1) $(CFLAGS) -o $@ $^ -lm endef -define LISP_TO_C_STRING -$(call ABBREV,L2C) -$(V)echo "const char *${@:.h=}_code =" > $@ -$(V)sed -e 's/;.*//' -e 's/["\\]/\\&/g' -e 's/$$/\\n/' -e 's/.*/"&"/' $< >> $@ -$(V)echo ";" >> $@ -endef - define WINDRES $(call ABBREV,RES) $(V)mkdir -p $(dir $@) @@ -139,9 +131,6 @@ opt/%.res: win/%.rc %.res: %.rc $(call WINDRES) -%.h: %.tl - $(call LISP_TO_C_STRING) - # The following pattern rule is used for test targets built by configure %.o: %.c $(call COMPILE_C) @@ -168,10 +157,6 @@ $(PROG)-win: $(patsubst %/txr.o,%/txr-win.o,$(OPT_OBJS)) $(EXTRA_OBJS-y) $(PROG)-win-dbg: $(patsubst %/txr.o,%/txr-win.o,$(DBG_OBJS)) $(EXTRA_OBJS-y) $(call LINK_PROG,-mwindows) -$(call ADD_CONF,dbg,lisplib.o): $(GEN_HDRS) - -$(call ADD_CONF,opt,lisplib.o): $(GEN_HDRS) - VPATH := $(top_srcdir) # Newline constant @@ -242,13 +227,12 @@ distclean: rm -rf config rm -rf config.* rm -rf mpi-1.?.? - rm -rf $(GEN_HDRS) else rebuild: clean repatch $(PROG) clean: conftest.clean tests.clean rm -f $(PROG)$(EXE) $(PROG)-dbg$(EXE) y.tab.c lex.yy.c y.tab.h y.output - rm -rf opt dbg $(EXTRA_OBJS-y) $(GEN_HDRS) + rm -rf opt dbg $(EXTRA_OBJS-y) distclean: clean rm -rf $(conf_dir) @@ -7,9 +7,9 @@ static void dir_tables_init(void) @(until) } @(end) -@(next @(open-files '("eval.c" "rand.c" "signal.c" "stream.c" "gc.c" "glob.c" - "syslog.c" "filter.c" "txr.c" "arith.c" "unwind.c" - "sysif.c" "place.tl"))) +@(next @(open-files ^(#*"eval.c rand.c signal.c stream.c gc.c glob.c" + #*"syslog.c filter.c txr.c arith.c unwind.c" + ,*#`sysif.c @stdlib/place.tl`))) @(collect) @ (block) @ (cases) @@ -35,7 +35,6 @@ #include "stream.h" #include "hash.h" #include "gc.h" -#include "place.h" #include "txr.h" #include "lisplib.h" @@ -79,8 +78,8 @@ static val place_set_entries(val dlt, val fun) static val place_instantiate(val set_fun) { funcall1(set_fun, nil); - return eval_intrinsic(lisp_parse(string_utf8(place_code), std_error, - colon_k, lit("place.tl")), nil); + load(format(nil, lit("~a/place.tl"), stdlib_path, nao)); + return nil; } static val ver_set_entries(val dlt, val fun) diff --git a/place.tl b/share/txr/stdlib/place.tl index 83c2d813..83c2d813 100644 --- a/place.tl +++ b/share/txr/stdlib/place.tl |