[Ecls-list] Question about command-line switches
John Wiegley
jwiegley at gmail.com
Wed Nov 14 11:43:08 UTC 2007
I was trying to use automake the other day to build a small project that
turns some Lisp code into an executable binary. Using ECL, of course.
The top part of my Makefile.am file was as trivial as can be, since ECL
has very nice command-line switches for producing object files:
bin_PROGRAMS = hello
hello_SOURCES = hello.lisp
ECL = ecl
.lisp.o:
$(ECL) -s -o $@ -compile $<
However, the rule to create an executable, although it works, is not
trivial at all (I hope I'm just missing something here):
hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES)
$(ECL) -eval "(require 'cmp)" \
-eval "(let ((args (nthcdr 8 (ext:command-args)))) \
(c:build-program (first args) :lisp-files (rest
args)))" \
-eval "(quit)" -- $@ $(hello_OBJECTS)
I was wondering if a command-line switch could be added so that
producing
a binary from a set of objects could be as simple as this:
hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES)
$(ECL) -s -o $@ -link $<
Once that's in place, it would not be hard to write a set of autoconf/
automake
macros so that once a person installs ECL, building simple Lisp
executables
wouldn't require writing any rules at all, just defining the PROGRAMS
and
SOURCES lines.
John
More information about the ecl-devel
mailing list