build: Add stage0 hex2 test.
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 23 Jun 2017 18:18:09 +0000 (20:18 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 23 Jun 2017 18:18:09 +0000 (20:18 +0200)
* configure (HEX2): Check for hex2 from MESCC_tools.
* INSTALL: Mention it.
* GNUmakefile (SUBDIRS): Add stage0.
* make/check-cc.make: New file.
* make/check.make: Remove CC-not-empty guard.
* scaffold/scaffold.make: Update CC check targets.

GNUmakefile
INSTALL
configure
make/check-cc.make [new file with mode: 0644]
make/check.make
scaffold/scaffold.make
stage0/stage0.make [new file with mode: 0644]

index 5d49d1f729020881eb1888ab4326f614b51a6df0..ddd4b3520c1a282a30a33941149f841104c6f1be 100644 (file)
@@ -14,6 +14,7 @@ SUBDIRS:=\
  src\
  scaffold\
  scripts\
+ stage0\
  tests\
  tinycc\
 #
diff --git a/INSTALL b/INSTALL
index b27bb4839fca565376fbaa26ea4d8f643a7ed637..8996a74345f5ee92bf4a3917d95513d50407c9e8 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -12,13 +12,15 @@ Building and Installing Mes
     guix environment --system=i686-linux -l guix.scm #32 bit only
 
 ** Other GNU/Linux
-*** Nyacc, 0.78.0 is known to work.
+*** [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]], 0.0 is known to work.
+
+*** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.78.0 is known to work.
 Matt Wette's C99 LALR parser.
 
-*** A C compiler, GNU Gcc 4.9.3 is known to work.
+*** GNU Gcc, 4.9.3 is known to work.
 The idea is to drop this requirement, of course.
 
-*** Guile, version 2.0.12 or is know to work.
+*** GNU Guile, version 2.0.12 or is know to work.
 Guile is not strictly necessary but it is used by the configure script
 and in development.
 
index 6fdda15665741181459220f8fd30ee747767e180..c5cf4ab2e4d3d684ff5872dfcee5c277acbd354e 100755 (executable)
--- a/configure
+++ b/configure
@@ -173,6 +173,7 @@ exec ${GUILE} --no-auto-compile -L $(pwd) -C $(pwd) -e 'main' -s "$0" ${1+"$@"}
 (define CC32 (or (getenv "CC32")
                  (if (member ARCH '("i686" "arm")) (string-append BUILD_TRIPLET "-" CC)
                      "i686-unknown-linux-gnu-gcc")))
+(define HEX2 (or (getenv "HEX2") "hex2"))
 
 (define (parse-opts args)
   (let* ((option-spec
@@ -230,6 +231,8 @@ Usage: ./configure [OPTION]...
     (check-version 'make '(4 0))
     (check-version 'perl '(5))
     (check-version 'nyacc '(0 78 0) #:command (string-append GUILE " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'"))
+    (if (not (check-version HEX2 '(0) #:optional? #t))
+        (set! HEX2 #f))
 
     (when (pair? required)
       (stderr "\nMissing dependencies [~a], run\n\n" ((->string ", ") required))
@@ -249,6 +252,7 @@ Usage: ./configure [OPTION]...
         (stdout "GUILE_FOR_BUILD:=~a\n" GUILE)
         (stdout "GUILE_EFFECTIVE_VERSION:=~a\n" GUILE_EFFECTIVE_VERSION)
         (stdout "GUIX_P:=~a\n" (if guix? guix? ""))
+        (stdout "HEX2:=~a\n" (or HEX2 ""))
         (stdout "PACKAGE:=~a\n" PACKAGE)
         (stdout "VERSION:=~a\n" VERSION)
         (stdout "PREFIX:=~a\n" (gulp-pipe (string-append "echo " prefix)))
diff --git a/make/check-cc.make b/make/check-cc.make
new file mode 100644 (file)
index 0000000..fcba6ca
--- /dev/null
@@ -0,0 +1,3 @@
+ifneq ($(CC),)
+include make/check.make
+endif
index a7929b50d2f7db6c0592b24bddaff4167113001f..acfaab26ef305e9447ff5ec017946d6b0fd8324d 100644 (file)
@@ -1,4 +1,3 @@
-ifneq ($(CC),)
 ifeq ($(TEST),)
 TEST:=$(TARGET)-check
 $(TEST): EXPECT:=$(EXPECT)
@@ -14,6 +13,4 @@ endif
 CHECK+=$(TEST)
 $(TEST): TEST:=$(TEST)
 $(DIR)-check: $(TEST)
-endif
 include make/reset.make
-
index be1c89ee6f7ef35998a3cd241858a7dac2a809fb..fd585b20f809ce5afb721461125b890a5dc6e622 100644 (file)
@@ -6,7 +6,7 @@ include make/bin.make
 
 TARGET:=m
 EXPECT:=255
-include make/check.make
+include make/check-cc.make
 
 TARGET:=hello
 C_FILES:=$(DIR)/hello.c
@@ -16,7 +16,7 @@ include make/bin.make
 
 TARGET:=hello
 EXPECT:=42
-include make/check.make
+include make/check-cc.make
 
 TARGET:=t
 C_FILES:=$(DIR)/t.c
@@ -25,7 +25,7 @@ INCLUDES:=mlibc
 include make/bin.make
 
 TARGET:=t
-include make/check.make
+include make/check-cc.make
 
 TARGET:=t-tcc
 C_FILES:=$(DIR)/t-tcc.c
@@ -34,7 +34,7 @@ INCLUDES:=mlibc
 include make/bin.make
 
 TARGET:=t-tcc
-include make/check.make
+include make/check-cc.make
 
 TARGET:=m.mlibc
 C_FILES:=$(DIR)/m.c
diff --git a/stage0/stage0.make b/stage0/stage0.make
new file mode 100644 (file)
index 0000000..fc9d62a
--- /dev/null
@@ -0,0 +1,10 @@
+ifneq ($(HEX2),)
+CLEAN+=$(OUT)/exit42
+$(OUT)/exit42: stage0/elf32-header-exit-42.hex2 stage0/elf32-body-exit-42.hex2 stage0/elf32-footer-exit-42.hex2
+       @echo "  HEX2   $(notdir $^) -> $(notdir $@)"
+       $(QUIET)$(HEX2) -f stage0/elf32-header-exit-42.hex2 -f stage0/elf32-body-exit-42.hex2 -f stage0/elf32-footer-exit-42.hex2 --LittleEndian --Architecture 1 --BaseAddress 0x1000000 > $@
+       chmod +x $@
+TARGET:=exit42
+EXPECT:=42
+include make/check.make
+endif