Rust, miniMAL, VHDL: misc fixes.
authorJoel Martin <github@martintribe.org>
Sat, 11 Feb 2017 06:15:34 +0000 (00:15 -0600)
committerJoel Martin <github@martintribe.org>
Sat, 11 Feb 2017 06:40:23 +0000 (00:40 -0600)
- Fix rust Dockerfile working dir.
- Make top-level Makefile more generic. This makes it easier to use
  the Makefile with fewer changes in miniMAL.
- Simplify vhdl build when case is fixed in stepA_mal
- Remove BUILD_IMPL=js from miniMAL travis test. Just use a docker
  image specifically made for miniMAL.
- Update TODO

.travis.yml
Makefile
docs/TODO
rust/Dockerfile
vhdl/Makefile

index 11e28a8..73acf25 100644 (file)
@@ -41,7 +41,7 @@ matrix:
     - {env: IMPL=make,      services: [docker]}
     - {env: IMPL=mal BUILD_IMPL=js NO_PERF=1, services: [docker]}
     - {env: IMPL=matlab, services: [docker]} # Uses Octave
-    - {env: IMPL=miniMAL BUILD_IMPL=js, services: [docker]}
+    - {env: IMPL=miniMAL,   services: [docker]}
     - {env: IMPL=nim,       services: [docker]}
     - {env: IMPL=objpascal, services: [docker]}
     - {env: IMPL=objc NO_DOCKER=1, os: osx, osx_image: xcode7}
index 9648c66..1dbff81 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -84,6 +84,8 @@ IMPLS = ada awk bash basic c d chuck clojure coffee common-lisp cpp crystal cs d
        python r racket rpython ruby rust scala skew swift swift3 tcl vb vhdl \
        vimscript
 
+EXTENSION = .mal
+
 step0 = step0_repl
 step1 = step1_read_print
 step2 = step2_eval
@@ -96,6 +98,9 @@ step8 = step8_macros
 step9 = step9_try
 stepA = stepA_mal
 
+argv_STEP = step6_file
+
+
 regress_step0 = step0
 regress_step1 = step1
 regress_step2 = step2
@@ -144,7 +149,7 @@ opt_OPTIONAL        = $(if $(strip $(OPTIONAL)),$(if $(filter t true T True TRUE
 # being tested.
 STEP_TEST_FILES = $(strip $(wildcard \
                    $(foreach s,$(if $(strip $(REGRESS)),$(regress_$(2)),$(2)),\
-                     $(1)/tests/$($(s)).mal tests/$($(s)).mal)))
+                     $(1)/tests/$($(s))$(EXTENSION) tests/$($(s))$(EXTENSION))))
 
 # Map of step (e.g. "step8") to executable file for that step
 ada_STEP_TO_PROG =     ada/$($(1))
@@ -319,7 +324,7 @@ $(ALL_TESTS): $$(call $$(word 2,$$(subst ^, ,$$(@)))_STEP_TO_PROG,$$(word 3,$$(s
              echo 'Testing $@; step file: $+, test file: $(test)' && \
              echo 'Running: $(call get_runtest_cmd,$(impl),$(step)) ../$(test) -- ../$(impl)/run' && \
              $(call get_runtest_cmd,$(impl),$(step)) ../$(test) -- ../$(impl)/run && \
-             $(if $(filter tests/step6_file.mal,$(test)),\
+             $(if $(filter tests/$(argv_STEP)$(EXTENSION),$(test)),\
                echo '----------------------------------------------' && \
                echo 'Testing ARGV of $@; step file: $+' && \
                echo 'Running: $(call get_argvtest_cmd,$(impl),$(step)) ../$(impl)/run ' && \
index 63df3d1..ef3b531 100644 (file)
--- a/docs/TODO
+++ b/docs/TODO
@@ -7,6 +7,11 @@ General:
       ./core.mal to ./lib directory
 
     - Finish guide.md
+    - Refactor ./run:
+        - java: build step, don't use mvn to run
+        - plpgsql: maybe combine wrap.sh and run
+        - vhdl: combine run_vhdl.sh and run
+        - vimscript: combine run_vimscript.sh and run
 
 All Implementations:
     - regular expression matching in runtest
index dfd365d..ba373a2 100644 (file)
@@ -29,10 +29,8 @@ RUN apt-get -y install g++
 ENV RUST_ARCHIVE=rust-1.14.0-x86_64-unknown-linux-gnu.tar.gz
 ENV RUST_DOWNLOAD_URL=https://static.rust-lang.org/dist/$RUST_ARCHIVE
 
-RUN mkdir /rust
-WORKDIR /rust
-
-RUN curl -fsOSL $RUST_DOWNLOAD_URL \
+RUN mkdir -p /rust && cd /rust \
+    && curl -fsOSL $RUST_DOWNLOAD_URL \
     && curl -s $RUST_DOWNLOAD_URL.sha256 | sha256sum -c - \
     && tar -C /rust -xzf $RUST_ARCHIVE --strip-components=1 \
     && rm $RUST_ARCHIVE \
index 0649e78..dcca4a1 100644 (file)
@@ -36,11 +36,8 @@ $(OBJS): %.o: %.vhdl $(OTHER_OBJS)
 $(patsubst %.o,%,$(filter step%,$(OBJS))): $(OTHER_OBJS)
 $(BINS): %: %.o
        ghdl -e -g $@
-
-# The ghdl linker creates a lowercase executable file; rename it to stepA_mal
-stepA_mal: stepA_mal.o
-       ghdl -e -g $@
-       mv stepa_mal stepA_mal
+       # ghdl linker creates a lowercase executable; rename it to stepA_mal
+       if [ "$@" = "stepA_mal" ]; then mv stepa_mal $@; fi
 
 clean:
        rm -f $(OBJS) $(BINS) $(OTHER_OBJS) work-obj93.cf mal