From 5245b079e14796083aa114d516360ce454698584 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 18 Feb 2016 00:33:19 -0600 Subject: [PATCH] Add dist targets to most implementations. TODO: factor groovy guile julia matlab miniMAL swift --- .gitignore | 29 ++++++++++++++++++++++------- Makefile | 11 ++++++++--- clojure/Makefile | 4 +++- erlang/Makefile | 3 ++- forth/Makefile | 13 ++++++++++++- fsharp/Makefile | 5 +++++ go/Makefile | 4 +++- haskell/Makefile | 4 +++- haxe/Makefile | 15 +++++++++++++++ java/Makefile | 10 ++++++++++ java/pom.xml | 13 +++++++++++++ js/Makefile | 6 ++++-- kotlin/Makefile | 7 ++++++- lua/Makefile | 19 +++++++++++++++++-- make/Makefile | 5 +++++ nim/Makefile | 4 +++- ocaml/Makefile | 4 +++- perl/Dockerfile | 2 +- perl/Makefile | 11 ++++++++++- php/Makefile | 10 ++++++++++ ps/Makefile | 15 +++++++++++++++ python/Makefile | 14 +++++++++----- r/Makefile | 10 ++++++++++ racket/Makefile | 9 +++++++++ rpython/Makefile | 7 ++++++- ruby/Makefile | 13 ++++++++++++- rust/Makefile | 7 ++++--- scala/Makefile | 13 ++++++++++++- scala/assembly.sbt | 3 +++ scala/build.sbt | 1 + scala/project/assembly.sbt | 1 + tcl/Makefile | 14 ++++++++++++++ vb/Makefile | 4 +++- vimscript/Makefile | 13 ++++++++++++- 34 files changed, 266 insertions(+), 37 deletions(-) create mode 100644 scala/assembly.sbt create mode 100644 scala/project/assembly.sbt diff --git a/.gitignore b/.gitignore index ab08f8e507..379714fd42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ +.bash_history +.cache +.mal-history +.crystal +.lein +.m2 +.ivy2 +.sbt */experiments */node_modules *.o @@ -13,13 +21,6 @@ */step8_macros */step9_try */stepA_mal -.bash_history -.mal-history -.crystal -.lein -.m2 -.ivy2 -.sbt awk/mal.awk bash/mal.sh c/mal @@ -32,6 +33,7 @@ crystal/mal cs/*.exe cs/*.dll cs/*.mdb +d/*.o d/mal elixir/_build elixir/deps @@ -44,6 +46,7 @@ erlang/.rebar erlang/src/*.beam es6/mal.js es6/build +forth/mal.fs fsharp/*.exe fsharp/*.dll fsharp/*.mdb @@ -57,6 +60,7 @@ haxe/*.n haxe/*.py haxe/cpp/ haxe/*.js +java/mal.jar java/target/ java/dependency-reduced-pom.xml js/mal.js @@ -66,6 +70,7 @@ kotlin/.idea kotlin/*.iml lua/lib lua/linenoise.so +lua/mal.lua make/mal.mk mal/mal.mal nim/mal @@ -76,14 +81,24 @@ ocaml/*.swp ocaml/*.cmx ocaml/*.o ocaml/mal_lib.* +ocaml/mal +perl/mal.pl php/mal.php +ps/mal.ps python/mal.pyz +r/mal.r +racket/mal +rpython/mal +ruby/mal.rb rust/target/ rust/mal rust/Cargo.lock rust/.cargo r/lib +scala/mal.jar scala/target scala/project +tcl/mal.tcl vb/*.exe vb/*.dll +vimscript/mal.vim diff --git a/Makefile b/Makefile index 3927c0879f..cf6958a08d 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,10 @@ STEP5_EXCLUDES += crystal # test completes, even at 1,000,000 PERF_EXCLUDES = mal # TODO: fix this +DIST_EXCLUDES += mal +# TODO: still need to implement dist +DIST_EXCLUDES += factor groovy guile io julia matlab miniMAL swift + # # Utility functions # @@ -182,6 +186,8 @@ forth_RUNSTEP = gforth ../$(2) $(3) fsharp_RUNSTEP = mono ../$(2) --raw $(3) go_RUNSTEP = ../$(2) $(3) groovy_RUNSTEP = groovy ../$(2) $(3) +# needs TERM=dumb to work with readline +guile_RUNSTEP = guile --no-auto-compile -L ../guile ../$(2) $(3) haskell_RUNSTEP = ../$(2) $(3) haxe_RUNSTEP = python3 ../$(2) $(3) haxe_RUNSTEP = $(haxe_RUNSTEP_$(HAXE_MODE)) @@ -211,8 +217,6 @@ swift3_RUNSTEP = ../$(2) $(3) tcl_RUNSTEP = tclsh ../$(2) --raw $(3) vb_RUNSTEP = mono ../$(2) --raw $(3) vimscript_RUNSTEP = ./run_vimscript.sh ../$(2) $(3) -# needs TERM=dumb to work with readline -guile_RUNSTEP = guile --no-auto-compile -L ../guile ../$(2) $(3) vimscript_TEST_OPTS = --test-timeout 30 @@ -233,7 +237,8 @@ ALL_TESTS = $(filter-out $(foreach impl,$(STEP5_EXCLUDES),test^$(impl)^step5),\ IMPL_STATS = $(foreach impl,$(DO_IMPLS),stats^$(impl)) IMPL_STATS_LISP = $(foreach impl,$(DO_IMPLS),stats-lisp^$(impl)) -IMPL_DIST = $(foreach impl,$(DO_IMPLS),dist^$(impl)) +IMPL_DIST = $(filter-out $(foreach impl,$(DIST_EXCLUDES),dist^$(impl)),\ + $(foreach impl,$(DO_IMPLS),dist^$(impl))) DOCKER_BUILD = $(foreach impl,$(DO_IMPLS),docker-build^$(impl)) diff --git a/clojure/Makefile b/clojure/Makefile index fb31b760dd..10c0abf873 100644 --- a/clojure/Makefile +++ b/clojure/Makefile @@ -2,7 +2,9 @@ SOURCES_BASE = src/readline.clj src/reader.clj src/printer.clj SOURCES_LISP = src/env.clj src/core.clj src/stepA_mal.clj SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) -all dist: deps mal.jar +all: deps + +dist: mal.jar deps: lein deps diff --git a/erlang/Makefile b/erlang/Makefile index 6797446025..808a2a9019 100644 --- a/erlang/Makefile +++ b/erlang/Makefile @@ -12,7 +12,7 @@ BINS = $(SRCS:%.erl=%) ##################### -.PHONY: all mal clean stats stats-lisp +.PHONY: all dist clean stats stats-lisp all: $(BINS) @@ -34,6 +34,7 @@ $(foreach b,$(BINS),$(eval $(call dep_template,$(b)))) clean: rebar clean + rm -f mal stats: $(SOURCES) @wc $^ diff --git a/forth/Makefile b/forth/Makefile index c744471682..1dee2ae7c7 100644 --- a/forth/Makefile +++ b/forth/Makefile @@ -1,8 +1,19 @@ -SOURCES_BASE = types.fs str.fs reader.fs printer.fs +SOURCES_BASE = str.fs types.fs reader.fs printer.fs SOURCES_LISP = env.fs core.fs stepA_mal.fs SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: + true + +dist: mal.fs + +mal.fs: $(SOURCES) + echo "#! /usr/bin/env gforth" > $@ + cat $+ | egrep -v "^require |^droprequire " >> $@ + chmod +x $@ + +clean: + rm -f mal.fs .PHONY: stats tests $(TESTS) diff --git a/fsharp/Makefile b/fsharp/Makefile index 4d909ae963..9a9c41b3db 100644 --- a/fsharp/Makefile +++ b/fsharp/Makefile @@ -24,6 +24,11 @@ CSFLAGS = $(if $(strip $(DEBUG)),-debug+,) all: $(patsubst %.fs,%.exe,$(SRCS)) +dist: mal.exe + +mal.exe: stepA_mal.exe + cp $< $@ + Mono.Terminal.dll: $(TERMINAL_SOURCES) mcs $(CSFLAGS) -target:library $+ -out:$@ diff --git a/go/Makefile b/go/Makefile index b83955c138..f35976a37d 100644 --- a/go/Makefile +++ b/go/Makefile @@ -18,7 +18,9 @@ BINS = $(SRCS:%.go=%) ##################### -all: $(BINS) mal +all: $(BINS) + +dist: mal mal: $(word $(words $(BINS)),$(BINS)) cp $< $@ diff --git a/haskell/Makefile b/haskell/Makefile index 71b62342b9..b5912c6927 100644 --- a/haskell/Makefile +++ b/haskell/Makefile @@ -12,7 +12,9 @@ BINS = $(SRCS:%.hs=%) ##################### -all: $(BINS) mal +all: $(BINS) + +dist: mal mal: $(word $(words $(BINS)),$(BINS)) cp $< $@ diff --git a/haxe/Makefile b/haxe/Makefile index 031fddbe1a..3257734684 100644 --- a/haxe/Makefile +++ b/haxe/Makefile @@ -16,6 +16,20 @@ all-cpp: $(foreach x,$(STEPS),cpp/$(x)) all-js: $(foreach x,$(STEPS),$(x).js) +dist: mal.n mal.py cpp/mal mal.js + +mal.n: stepA_mal.n + cp $< $@ + +mal.py: stepA_mal.py + cp $< $@ + +cpp/mal: cpp/stepA_mal + cp $< $@ + +mal.js: stepA_mal.js + cp $< $@ + # Neko target (neko) @@ -65,4 +79,5 @@ node_modules: ### clean: + rm -f mal.n mal.py cpp/mal mal.js rm -r step*.py cpp/ step*.js step*.n diff --git a/java/Makefile b/java/Makefile index 0610ea64d1..f5e28fe05c 100644 --- a/java/Makefile +++ b/java/Makefile @@ -11,12 +11,22 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: mvn install +dist: mal.jar + +mal.jar: target/classes/mal/stepA_mal.class + mvn assembly:assembly + cp target/mal-0.0.1.jar $@ + src/main/mal/%.java: mvn install target/classes/mal/step%.class: src/main/mal/step%.java ${SOURCES} mvn install +clean: + mvn clean + rm -f mal.jar + #.PHONY: stats tests $(TESTS) .PHONY: stats diff --git a/java/pom.xml b/java/pom.xml index fa2b567357..5ee5b7c73b 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -76,6 +76,19 @@ + + maven-assembly-plugin + + + jar-with-dependencies + + + + mal.stepA_mal + + + + diff --git a/js/Makefile b/js/Makefile index 603c6888e8..175e7179ea 100644 --- a/js/Makefile +++ b/js/Makefile @@ -1,12 +1,14 @@ TESTS = tests/types.js tests/reader.js -SOURCES_BASE = node_readline.js types.js reader.js printer.js +SOURCES_BASE = node_readline.js types.js reader.js printer.js interop.js SOURCES_LISP = env.js core.js stepA_mal.js SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) WEB_SOURCES = $(SOURCES:node_readline.js=jq_readline.js) -all: node_modules mal.js web/mal.js +all: node_modules + +dist: mal.js web/mal.js node_modules: npm install diff --git a/kotlin/Makefile b/kotlin/Makefile index 841698b7fd..8ab4903786 100644 --- a/kotlin/Makefile +++ b/kotlin/Makefile @@ -7,8 +7,13 @@ JARS = $(SOURCES_LISP:%.kt=%.jar) all: $(JARS) +dist: mal.jar + +mal.jar: stepA_mal.jar + cp $< $@ + clean: - rm -vf $(JARS) + rm -vf $(JARS) mal.jar $(JARS): %.jar: src/mal/%.kt $(SOURCES_BASE:%.kt=src/mal/%.kt) kotlinc src/mal/$(@:%.jar=%.kt) $(SOURCES_BASE:%.kt=src/mal/%.kt) -include-runtime -d $@ diff --git a/lua/Makefile b/lua/Makefile index 494f3f4c00..ec48fc9fc0 100644 --- a/lua/Makefile +++ b/lua/Makefile @@ -6,12 +6,27 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: libs -.PHONY: stats tests $(TESTS) +dist: mal.lua + +SOURCE_NAMES = $(patsubst %.lua,%,$(SOURCES)) +mal.lua: $(SOURCES) + echo "#!/usr/bin/env lua" > $@ + echo "local $(foreach n,$(SOURCE_NAMES),$(n),) M" >> $@ + echo "M={} $(foreach n,$(SOURCE_NAMES),$(n)=M);" >> $@ + cat $+ | grep -v -e "return M$$" \ + -e "return Env" \ + -e "local M =" \ + -e "^#!" \ + $(foreach n,$(SOURCE_NAMES),-e "require('$(n)')") >> $@ + chmod +x $@ + clean: - rm -f linenoise.so + rm -f linenoise.so mal.lua rm -rf lib/lua/5.1 +.PHONY: stats tests $(TESTS) + stats: $(SOURCES) @wc $^ @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*--|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" diff --git a/make/Makefile b/make/Makefile index 6dec57dd81..2270cacd20 100644 --- a/make/Makefile +++ b/make/Makefile @@ -6,6 +6,11 @@ SOURCES_BASE = util.mk numbers.mk readline.mk gmsl.mk types.mk \ SOURCES_LISP = env.mk core.mk stepA_mal.mk SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) +all: + true + +dist: mal.mk + mal.mk: $(SOURCES) echo "#!/usr/bin/make -f" > $@ cat $+ | grep -v "^include " >> $@ diff --git a/nim/Makefile b/nim/Makefile index 6183cc3921..9b145d653f 100644 --- a/nim/Makefile +++ b/nim/Makefile @@ -14,7 +14,9 @@ BINS = $(SRCS:%.nim=%) ##################### -all: $(BINS) mal +all: $(BINS) + +dist: mal mal: $(word $(words $(BINS)),$(BINS)) cp $< $@ diff --git a/ocaml/Makefile b/ocaml/Makefile index 3b98b937e6..6a2bb69ae1 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -8,7 +8,9 @@ MAL_LIB = mal_lib.cmxa STEP_BINS = $(STEPS:%.ml=%) LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS)) -all: $(STEP_BINS) mal +all: $(STEP_BINS) + +dist: mal mal: $(LAST_STEP_BIN) cp $< $@ diff --git a/perl/Dockerfile b/perl/Dockerfile index 85bdfe4c72..b36833e072 100644 --- a/perl/Dockerfile +++ b/perl/Dockerfile @@ -21,4 +21,4 @@ WORKDIR /mal # Specific implementation requirements ########################################################## -RUN apt-get -y install perl +RUN apt-get -y install perl libapp-fatpacker-perl diff --git a/perl/Makefile b/perl/Makefile index 512c17ce4b..3774919734 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -5,7 +5,16 @@ SOURCES_BASE = readline.pm types.pm reader.pm printer.pm \ SOURCES_LISP = env.pm core.pm stepA_mal.pl SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) -#all: mal.pl +all: + +dist: mal.pl + +mal.pl: $(SOURCES) + echo "#!/usr/bin/env perl" > $@ + fatpack pack stepA_mal.pl >> $@ + +clean: + rm -f mal.pl .PHONY: stats tests $(TESTS) diff --git a/php/Makefile b/php/Makefile index e31bb8f848..bea654cd98 100644 --- a/php/Makefile +++ b/php/Makefile @@ -7,6 +7,16 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: +dist: mal.php + +mal.php: $(SOURCES) + echo "#!/usr/bin/env php" > $@ + cat $+ | grep -v "^require_once" >> $@ + chmod +x $@ + +clean: + rm mal.php + .PHONY: stats tests $(TESTS) stats: $(SOURCES) diff --git a/ps/Makefile b/ps/Makefile index 7a708096a7..39f7a09f34 100644 --- a/ps/Makefile +++ b/ps/Makefile @@ -5,6 +5,21 @@ SOURCES_BASE = types.ps reader.ps printer.ps SOURCES_LISP = env.ps core.ps stepA_mal.ps SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) +all: + true + +dist: mal.ps + +mal.ps: $(SOURCES) + echo "#!/bin/sh" > $@ + echo "\":\" pop pop pop pop %#; exec gs -d'#!'=null -d'\":\"'=null -q -dNODISPLAY -- \"\$$0\" \"\$$@\"" >> $@ + cat $+ | grep -v "runlibfile$$" >> $@ + chmod +x $@ + +clean: + rm -f mal.ps + + .PHONY: stats tests $(TESTS) stats: $(SOURCES) diff --git a/python/Makefile b/python/Makefile index 944e14dca7..592a7ca4b0 100644 --- a/python/Makefile +++ b/python/Makefile @@ -6,16 +6,20 @@ SOURCES_BASE = mal_readline.py mal_types.py reader.py printer.py SOURCES_LISP = env.py core.py stepA_mal.py SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) -all: mal.py +all: true -mal.py: stepA_mal.py - echo "#!/usr/bin/env python" > $@ - cat $+ >> $@ +dist: mal.pyz + +SHELL := bash +mal.pyz: $(SOURCES) + cp stepA_mal.py __main__.py + cat <(echo '#!/usr/bin/env python') <(zip -q - __main__.py $+) > $@ + rm __main__.py chmod +x $@ clean: - rm -f mal.py + rm -f mal.pyz .PHONY: stats tests $(TESTS) diff --git a/r/Makefile b/r/Makefile index c1eec79976..c1caebf7e5 100644 --- a/r/Makefile +++ b/r/Makefile @@ -6,6 +6,16 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: libs +dist: mal.r + +mal.r: $(SOURCES) + echo "#!/usr/bin/env Rscript" > $@ + cat $+ | grep -v " source(" >> $@ + chmod +x $@ + +clean: + rm -f mal.r + .PHONY: stats tests $(TESTS) stats: $(SOURCES) diff --git a/racket/Makefile b/racket/Makefile index e2da5565d7..3d55efe430 100644 --- a/racket/Makefile +++ b/racket/Makefile @@ -4,6 +4,15 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: +dist: mal + +mal: $(SOURCES) + raco exe stepA_mal.rkt + mv stepA_mal $@ + +clean: + mal + .PHONY: stats stats: $(SOURCES) diff --git a/rpython/Makefile b/rpython/Makefile index 837ca80794..a86b4dd499 100644 --- a/rpython/Makefile +++ b/rpython/Makefile @@ -10,6 +10,11 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: $(STEPS) +dist: mal + +mal: stepA_mal + cp $< $@ + %: %.py $(RPYTHON) --output=$@ $< @@ -26,7 +31,7 @@ $(UPPER_STEPS): $(STEP4_DEPS) .PHONY: clean stats stats-lisp clean: - rm -f $(STEPS) *.pyc + rm -f mal $(STEPS) *.pyc rm -rf __pycache__ stats: $(SOURCES) diff --git a/ruby/Makefile b/ruby/Makefile index f59681df83..f43de1c86f 100644 --- a/ruby/Makefile +++ b/ruby/Makefile @@ -4,7 +4,18 @@ SOURCES_BASE = mal_readline.rb types.rb reader.rb printer.rb SOURCES_LISP = env.rb core.rb stepA_mal.rb SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) -#all: mal.rb +all: + true + +dist: mal.rb + +mal.rb: $(SOURCES) + echo "#!/usr/bin/env ruby" > $@ + cat $+ | grep -v "^require_relative" >> $@ + chmod +x $@ + +clean: + rm -f mal.rb .PHONY: stats tests $(TESTS) diff --git a/rust/Makefile b/rust/Makefile index ae5f2eea20..e51072b2d0 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -17,9 +17,10 @@ BINS = $(SRCS:%.rs=target/release/%) all: mal -mal: ${SOURCES_BASE} $(word $(words ${SOURCES_LISP}),${SOURCES_LISP}) - cargo build --release - cp $(word $(words ${BINS}),${BINS}) $@ +dist: mal + +mal: target/release/stepA_mal + cp $< $@ # TODO: would be nice to build just the step requested $(BINS): target/release/%: src/bin/%.rs $(wildcard src/*.rs) diff --git a/scala/Makefile b/scala/Makefile index e4f2a82cf6..b98922b8dd 100644 --- a/scala/Makefile +++ b/scala/Makefile @@ -4,9 +4,20 @@ SOURCES_BASE = types.scala reader.scala printer.scala SOURCES_LISP = env.scala core.scala stepA_mal.scala SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) -all: +all: build + +build: sbt 'run-main stepA_mal ../tests/incA.mal' +dist: mal.jar + +mal.jar: $(SOURCES) + sbt assembly + cp target/scala-*/mal-assembly*.jar $@ + +clean: + rm -f mal.jar + .PHONY: stats tests $(TESTS) stats: $(SOURCES) diff --git a/scala/assembly.sbt b/scala/assembly.sbt new file mode 100644 index 0000000000..d7a8cdfb27 --- /dev/null +++ b/scala/assembly.sbt @@ -0,0 +1,3 @@ +import AssemblyKeys._ // put this at the top of the file + +assemblySettings diff --git a/scala/build.sbt b/scala/build.sbt index d2a2802e6c..a48150acaa 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -13,3 +13,4 @@ showSuccess := false logLevel in runMain := Level.Warn +mainClass in Compile := Some("stepA_mal") diff --git a/scala/project/assembly.sbt b/scala/project/assembly.sbt new file mode 100644 index 0000000000..54c32528e9 --- /dev/null +++ b/scala/project/assembly.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") diff --git a/tcl/Makefile b/tcl/Makefile index d030e1ae72..0e5396dbff 100644 --- a/tcl/Makefile +++ b/tcl/Makefile @@ -4,6 +4,20 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) .PHONY: stats stats-lisp +all: + true + +dist: mal.tcl + +mal.tcl: $(SOURCES) + echo "#!/usr/bin/env tclsh" > $@ + cat $+ | grep -v "^source " >> $@ + chmod +x $@ + +clean: + rm -f mal.tcl + + stats: $(SOURCES) @wc $^ @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*\"|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" diff --git a/vb/Makefile b/vb/Makefile index 43d71d9c2e..ce5145a08f 100644 --- a/vb/Makefile +++ b/vb/Makefile @@ -21,7 +21,9 @@ FLAGS = $(if $(strip $(DEBUG)),-debug:full,) ##################### -all: mal.exe $(patsubst %.vb,%.exe,$(SRCS)) +all: $(patsubst %.vb,%.exe,$(SRCS)) + +dist: mal.exe mal.exe: $(patsubst %.vb,%.exe,$(word $(words $(SOURCES)),$(SOURCES))) cp $< $@ diff --git a/vimscript/Makefile b/vimscript/Makefile index 69cdf2b457..dfb12715dc 100644 --- a/vimscript/Makefile +++ b/vimscript/Makefile @@ -4,6 +4,17 @@ SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) all: libvimreadline.so +dist: mal.vim + +mal.vim: $(SOURCES) + echo "#!/bin/sh" > $@ + echo "\":\" ; rundir=\`dirname \$$0\`" >> $@ + echo "\":\" ; export LD_LIBRARY_PATH=\`readlink -f \$$rundir\`" >> $@ + echo "\":\" ; exec vim -i NONE -V1 -nNesS \"\$$0\" -- \"\$$@\"" >> $@ + cat $+ | grep -v "^source " >> $@ + chmod +x $@ + + libvimreadline.so: vimreadline.o $(CC) -g -shared -o $@ $< -lreadline @@ -11,7 +22,7 @@ vimreadline.o: vimreadline.c $(CC) -g -fPIC -c $< -o $@ clean: - rm -f vimreadline.o libvimreadline.so + rm -f vimreadline.o libvimreadline.so mal.vim stats: $(SOURCES) @wc $^