harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5c9990c863e8eaf8eb47d23b4fb9a73c9ce8056c
parent 7cc7111d4d7717bbdd42ca65b5e0bb3c1d5fdf26
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 28 Apr 2022 15:05:34 +0200

configure: drop cpp header analysis

This is broken and needlessly complicated

Fixes: https://todo.sr.ht/~sircmpwn/hare/655

Diffstat:
MMakefile | 4----
Mconfig.sh | 13++++++++++---
Mconfigure | 18++++++++++++++++++
3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile @@ -2,7 +2,6 @@ .SUFFIXES: OUTDIR=.build include $(OUTDIR)/config.mk -include $(OUTDIR)/cppcache harec: $(harec_objects) @printf 'CCLD\t$@\n' @@ -15,9 +14,6 @@ include tests/Makefile .c.o: @printf 'CC\t$@\n' - @touch $(OUTDIR)/cppcache - @grep $< $(OUTDIR)/cppcache >/dev/null || \ - $(CPP) $(CFLAGS) -MM -MT $@ $< >> $(OUTDIR)/cppcache @$(CC) -c $(CFLAGS) -o $@ $< .s.o: diff --git a/config.sh b/config.sh @@ -44,6 +44,15 @@ subdir() { eval ". $srcdir/$1/configure" } +headers() { + printf 'HEADERS=\\\n' + while [ $# -ne 0 ] + do + printf '\tinclude/%s \\\n' "$1" + shift + done +} + genrules() { target="$1" shift @@ -57,7 +66,7 @@ genrules() { then deps=" harec" fi - printf '%s.o: %s.%s%s\n' "$file" "$file" "$ext" "$deps" + printf '%s.o: %s.%s%s $(HEADERS)\n' "$file" "$file" "$ext" "$deps" done printf '%s_objects=\\\n' "$target" n=0 @@ -189,8 +198,6 @@ EOF done echo done - touch "$outdir"/cppcache - cat <<-EOF >harec.sh export PATH="$(pwd)":\$PATH EOF diff --git a/configure b/configure @@ -4,6 +4,24 @@ srcdir=${SRCDIR:-$(dirname "$0")} eval ". $srcdir/config.sh" harec() { + headers \ + "ast.h" \ + "check.h" \ + "emit.h" \ + "eval.h" \ + "expr.h" \ + "gen.h" \ + "identifier.h" \ + "lex.h" \ + "mod.h" \ + "parse.h" \ + "qbe.h" \ + "scope.h" \ + "type_store.h" \ + "typedef.h" \ + "types.h" \ + "utf8.h" \ + "util.h" genrules harec \ src/check.c \ src/emit.c \