diff --git a/GNUmakefile b/GNUmakefile index 6af3ae74..ba7196ef 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,8 +11,17 @@ default: all all: ./build.sh +cc: + build-aux/build-cc.sh + +mlibc: + build-aux/build-mlibc.sh + +mes: + build-aux/build-mes.sh + clean: - true + git clean -dfx all-go: build-aux/build-guile.sh @@ -30,12 +39,31 @@ install: .config.make: ./configure seed: - cd ../mes-seed && git reset --hard HEAD - MES=guile GUILE=guile SEED=1 build-aux/build-mes.sh - cd ../mes-seed && ./refresh.sh && cd ../mes - MES=guile GUILE=guile SEED=1 build-aux/build-mes.sh + cd $(MES_SEED) && git reset --hard HEAD + MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh + cd $(MES_SEED) && MES_PREFIX=$(PWD) ./refresh.sh + MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh build-aux/build-mlibc.sh - cd ../tinycc-seed && ./refresh.sh && cd ../mes + cd $(TINYCC_SEED) && MES_PREFIX=$(PWD) ./refresh.sh + +define HELP_TOP +Usage: make [OPTION]... [TARGET]... + +Targets: + all update everything + all-go update .go files + cc update src/mes.gcc-out + mlibc update src/mes.mlibc-out + mes update src/mes + check run unit tests + clean run git clean -dfx + clean-go clean .go files + install install in $(PREFIX) + seed update mes-seed in $(MES_SEED) +endef +export HELP_TOP +help: + @echo "$$HELP_TOP" ifdef PREFIX export PREFIX @@ -53,6 +81,10 @@ ifdef CC32 export CC32 endif +ifdef BLOOD_ELF +export BLOOD_ELF +endif + ifdef M1 export M1 endif @@ -65,6 +97,10 @@ ifdef GUILE export GUILE endif +ifdef GUILE_TOOLS +export GUILE_TOOLS +endif + ifdef GUILE_LOAD_PATH export GUILE_LOAD_PATH endif @@ -93,4 +129,10 @@ ifdef MESCCFLAGS export MESCCFLAGS endif +ifdef MES_SEED +export MES_SEED +endif +ifdef TINYCC_SEED +export TINYCC_SEED +endif diff --git a/configure b/configure index 7ecc29a0..81b18a63 100755 --- a/configure +++ b/configure @@ -24,7 +24,7 @@ Missing dependencies, run EOF exit 1 fi -exec ${GUILE-guile} --no-auto-compile -e '(configure)' -s "$0" ${1+"$@"} +exec ${GUILE-guile} -L . --no-auto-compile -e '(configure)' -s "$0" ${1+"$@"} !# ;;; Mes --- Maxwell Equations of Software @@ -220,6 +220,10 @@ Some influential environment variables: CFLAGS C compiler flags CC32 x86 C compiler command C32FLAGS x86 C compiler flags + GUILE guile command + GUILE_TOOLS guile-tools command + MES_SEED location of mes-seed + TINYCC_SEED location of tinycc-seed " PACKAGE VERSION (getenv "PREFIX"))) (define (main args) @@ -240,20 +244,28 @@ Some influential environment variables: (let ((CC32 (or (getenv "CC32") (if (member ARCH '("i686" "arm")) (string-append BUILD_TRIPLET "-" CC) "i686-unknown-linux-gnu-gcc"))) + (GUILE_TOOLS (or (getenv "GUILE_TOOLS") "guile-tools")) + (BLOOD_ELF (or (getenv "BLOOD_ELF") "blood-elf")) (HEX2 (or (getenv "HEX2") "hex2")) (M1 (or (getenv "M1") "M1")) (CFLAGS (getenv "CFLAGS")) (C32FLAGS (getenv "C32FLAGS")) (HEX2FLAGS (getenv "HEX2FLAGS")) (M1FLAGS (getenv "M1FLAGS")) - (MESCCFLAGS (getenv "MESCCFLAGS"))) + (MESCCFLAGS (getenv "MESCCFLAGS")) + (MES_SEED (or (getenv "MES_SEED") "../mes-seed")) + (TINYCC_SEED (or (getenv "TINYCC_SEED") "../tinycc-seed"))) (when help? (print-help) (exit 0)) (set! *verbose?* verbose?) (check-version "guile" '(2 0)) - (check-version HEX2 '(0 1)) - (check-version M1 '(0 2)) + (check-version "guile-tools" '(2 0)) + (check-version "mes-seed" '(0 14) #:optional? #t #:command (string-append MES_SEED "/refresh.sh")) + (check-version "tinycc-seed" '(0 14) #:optional? #t #:command (string-append TINYCC_SEED "/refresh.sh")) + (check-version BLOOD_ELF '(0 1)) + (check-version HEX2 '(0 3)) + (check-version M1 '(0 3)) (check-version "nyacc" '(0 80 41) #:command (string-append GUILE " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'")) (check-version "bash" '(4 0)) @@ -284,9 +296,13 @@ Some influential environment variables: (stdout "ARCH:=~a\n" ARCH) (stdout "CC:=~a\n" (or CC "")) (stdout "CC32:=~a\n" (or CC32 "")) + (stdout "BLOOD_ELF:=~a\n" (or BLOOD_ELF "")) + (stdout "MES_SEED:=~a\n" (or MES_SEED "")) + (stdout "TINYCC_SEED:=~a\n" (or TINYCC_SEED "")) (stdout "HEX2:=~a\n" (or HEX2 "")) (stdout "M1:=~a\n" (or M1 "")) (stdout "GUILE:=~a\n" GUILE) + (stdout "GUILE_TOOLS:=~a\n" GUILE_TOOLS) (stdout "GUILE_FOR_BUILD:=~a\n" GUILE) (stdout "GUILE_EFFECTIVE_VERSION:=~a\n" GUILE_EFFECTIVE_VERSION) (stdout "GUIX_P:=~a\n" (if guix? guix? ""))