1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
.POSIX:
all:
include config.mk
include makefiles/$(PLATFORM).mk
include makefiles/tests.mk
all: $(BINOUT)/harec
C_DEFINES = \
-DVERSION='"'"$(VERSION)"'"' \
-DDEFAULT_TARGET='"$(DEFAULT_TARGET)"'
headers = \
include/ast.h \
include/check.h \
include/emit.h \
include/eval.h \
include/expr.h \
include/gen.h \
include/identifier.h \
include/lex.h \
include/mod.h \
include/parse.h \
include/qbe.h \
include/scope.h \
include/type_store.h \
include/typedef.h \
include/types.h \
include/utf8.h \
include/util.h
harec_objects = \
src/check.o \
src/emit.o \
src/eval.o \
src/expr.o \
src/gen.o \
src/genutil.o \
src/identifier.o \
src/lex.o \
src/main.o \
src/mod.o \
src/parse.o \
src/qbe.o \
src/qinstr.o \
src/qtype.o \
src/scope.o \
src/type_store.o \
src/typedef.o \
src/types.o \
src/utf8.o \
src/util.o
$(BINOUT)/harec: $(harec_objects)
@mkdir -p -- $(BINOUT)
@printf 'CCLD\t%s\n' '$@'
@$(CC) $(LDFLAGS) -o $@ $(harec_objects) $(LIBS)
.SUFFIXES:
.SUFFIXES: .ssa .td .c .o .s
src/check.o: $(headers)
src/emit.o: $(headers)
src/eval.o: $(headers)
src/expr.o: $(headers)
src/gen.o: $(headers)
src/genutil.o: $(headers)
src/identifier.o: $(headers)
src/lex.o: $(headers)
src/main.o: $(headers)
src/mod.o: $(headers)
src/parse.o: $(headers)
src/qbe.o: $(headers)
src/qinstr.o: $(headers)
src/qtype.o: $(headers)
src/scope.o: $(headers)
src/type_store.o: $(headers)
src/typedef.o: $(headers)
src/types.o: $(headers)
src/utf8.o: $(headers)
src/util.o: $(headers)
.c.o:
@printf 'CC\t%s\n' '$@'
@$(CC) -c $(CFLAGS) $(C_DEFINES) -o $@ $<
.s.o:
@printf 'AS\t%s\n' '$@'
@$(AS) $(ASFLAGS) -o $@ $<
.ssa.s:
@printf 'QBE\t%s\n' '$@'
@$(QBE) $(QBEFLAGS) -o $@.tmp $<
@mv $@.tmp $@
.ssa.td:
@cmp -s $@ $@.tmp 2>/dev/null || cp $@.tmp $@
clean:
@rm -rf -- $(HARECACHE) $(BINOUT) $(harec_objects) $(tests)
check: $(BINOUT)/harec $(tests)
@$(TDENV) ./tests/run
install: $(BINOUT)/harec
install -Dm755 -- $(BINOUT)/harec $(DESTDIR)$(BINDIR)/harec
uninstall:
rm -- '$(DESTDIR)$(BINDIR)/harec'
.PHONY: clean check install uninstall
|